Formulas of first-order logic #
This file defines the formulas of first-order logic.
φ : Semiformula L ξ n is a (semi-)formula of language L with bounded variables of Fin n and
free variables of ξ.
The quantification is represented by de Bruijn index.
Imported declaration from the Incompleteness formalization.
- verum {L : Language} {ξ : Type u_1} {n : ℕ} : Semiformula L ξ n
- falsum {L : Language} {ξ : Type u_1} {n : ℕ} : Semiformula L ξ n
- rel {L : Language} {ξ : Type u_1} {n arity : ℕ} : L.Rel arity → (Fin arity → Semiterm L ξ n) → Semiformula L ξ n
- nrel {L : Language} {ξ : Type u_1} {n arity : ℕ} : L.Rel arity → (Fin arity → Semiterm L ξ n) → Semiformula L ξ n
- and {L : Language} {ξ : Type u_1} {n : ℕ} : Semiformula L ξ n → Semiformula L ξ n → Semiformula L ξ n
- or {L : Language} {ξ : Type u_1} {n : ℕ} : Semiformula L ξ n → Semiformula L ξ n → Semiformula L ξ n
- all {L : Language} {ξ : Type u_1} {n : ℕ} : Semiformula L ξ (n + 1) → Semiformula L ξ n
- ex {L : Language} {ξ : Type u_1} {n : ℕ} : Semiformula L ξ (n + 1) → Semiformula L ξ n
Instances For
Imported declaration from the Incompleteness formalization.
Equations
- LO.FirstOrder.Formula L ξ = LO.FirstOrder.Semiformula L ξ 0
Instances For
Imported declaration from the Incompleteness formalization.
Equations
Instances For
Imported declaration from the Incompleteness formalization.
Equations
Instances For
Imported declaration from the Incompleteness formalization.
Equations
Instances For
Imported declaration from the Incompleteness formalization.
Equations
Instances For
Imported declaration from the Incompleteness formalization.
Equations
- LO.FirstOrder.Semiformula.verum.neg = LO.FirstOrder.Semiformula.falsum
- LO.FirstOrder.Semiformula.falsum.neg = LO.FirstOrder.Semiformula.verum
- (LO.FirstOrder.Semiformula.rel r v).neg = LO.FirstOrder.Semiformula.nrel r v
- (LO.FirstOrder.Semiformula.nrel r v).neg = LO.FirstOrder.Semiformula.rel r v
- (φ.and ψ).neg = φ.neg.or ψ.neg
- (φ.or ψ).neg = φ.neg.and ψ.neg
- φ.all.neg = φ.neg.ex
- φ.ex.neg = φ.neg.all
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- LO.FirstOrder.Semiformula.instQuantifier = { univ := fun {n : ℕ} => LO.FirstOrder.Semiformula.all, ex := fun {n : ℕ} => LO.FirstOrder.Semiformula.ex }
Imported declaration from the Incompleteness formalization.
Equations
- LO.FirstOrder.Semiformula.verum.toStr = "\\top"
- LO.FirstOrder.Semiformula.falsum.toStr = "\\bot"
- (LO.FirstOrder.Semiformula.rel r a).toStr = "{" ++ toString r ++ "}"
- (LO.FirstOrder.Semiformula.rel r v).toStr = ("{" ++ toString r ++ "} \\left(" ++ String.vecToStr fun (i : Fin (n_1 + 1)) => toString (v i)) ++ "\\right)"
- (LO.FirstOrder.Semiformula.nrel r a).toStr = "\\lnot {" ++ toString r ++ "}"
- (LO.FirstOrder.Semiformula.nrel r v).toStr = ("\\lnot {" ++ toString r ++ "} \\left(" ++ String.vecToStr fun (i : Fin (n_1 + 1)) => toString (v i)) ++ "\\right)"
- (φ.and ψ).toStr = "\\left(" ++ φ.toStr ++ " \\land " ++ ψ.toStr ++ "\\right)"
- (φ.or ψ).toStr = "\\left(" ++ φ.toStr ++ " \\lor " ++ ψ.toStr ++ "\\right)"
- φ.all.toStr = "(\\forall x_{" ++ toString n ++ "}) " ++ φ.toStr
- φ.ex.toStr = "(\\exists x_{" ++ toString n ++ "}) " ++ φ.toStr
Instances For
Equations
- LO.FirstOrder.Semiformula.instRepr = { reprPrec := fun (t : LO.FirstOrder.Semiformula L ξ n) (x : ℕ) => Std.Format.text t.toStr }
Imported declaration from the Incompleteness formalization.
Equations
Instances For
Imported declaration from the Incompleteness formalization.
Equations
Instances For
Imported declaration from the Incompleteness formalization.
Equations
- LO.FirstOrder.Semiformula.verum.complexity = 0
- LO.FirstOrder.Semiformula.falsum.complexity = 0
- (LO.FirstOrder.Semiformula.rel r v).complexity = 0
- (LO.FirstOrder.Semiformula.nrel r v).complexity = 0
- (φ.and ψ).complexity = max φ.complexity ψ.complexity + 1
- (φ.or ψ).complexity = max φ.complexity ψ.complexity + 1
- φ.all.complexity = φ.complexity + 1
- φ.ex.complexity = φ.complexity + 1
Instances For
Imported declaration from the Incompleteness formalization.
Equations
- LO.FirstOrder.Semiformula.cases' hverum hfalsum hrel hnrel hand hor hall hex LO.FirstOrder.Semiformula.verum = hverum
- LO.FirstOrder.Semiformula.cases' hverum hfalsum hrel hnrel hand hor hall hex LO.FirstOrder.Semiformula.falsum = hfalsum
- LO.FirstOrder.Semiformula.cases' hverum hfalsum hrel hnrel hand hor hall hex (LO.FirstOrder.Semiformula.rel r v) = hrel r v
- LO.FirstOrder.Semiformula.cases' hverum hfalsum hrel hnrel hand hor hall hex (LO.FirstOrder.Semiformula.nrel r v) = hnrel r v
- LO.FirstOrder.Semiformula.cases' hverum hfalsum hrel hnrel hand hor hall hex (φ.and ψ) = hand φ ψ
- LO.FirstOrder.Semiformula.cases' hverum hfalsum hrel hnrel hand hor hall hex (φ.or ψ) = hor φ ψ
- LO.FirstOrder.Semiformula.cases' hverum hfalsum hrel hnrel hand hor hall hex φ.all = hall φ
- LO.FirstOrder.Semiformula.cases' hverum hfalsum hrel hnrel hand hor hall hex φ.ex = hex φ
Instances For
Imported declaration from the Incompleteness formalization.
Equations
- One or more equations did not get rendered due to their size.
- LO.FirstOrder.Semiformula.rec' hverum hfalsum hrel hnrel hand hor hall hex LO.FirstOrder.Semiformula.verum = hverum
- LO.FirstOrder.Semiformula.rec' hverum hfalsum hrel hnrel hand hor hall hex LO.FirstOrder.Semiformula.falsum = hfalsum
- LO.FirstOrder.Semiformula.rec' hverum hfalsum hrel hnrel hand hor hall hex (LO.FirstOrder.Semiformula.rel r v) = hrel r v
- LO.FirstOrder.Semiformula.rec' hverum hfalsum hrel hnrel hand hor hall hex (LO.FirstOrder.Semiformula.nrel r v) = hnrel r v
Instances For
Imported declaration from the Incompleteness formalization.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Quantifier Rank
Imported declaration from the Incompleteness formalization.
Equations
Instances For
Open (Semi-)Formula
Free Variables
Imported declaration from the Incompleteness formalization.
Equations
- (LO.FirstOrder.Semiformula.rel a v).freeVariables = Finset.univ.biUnion fun (i : Fin arity) => (v i).freeVariables
- (LO.FirstOrder.Semiformula.nrel a v).freeVariables = Finset.univ.biUnion fun (i : Fin arity) => (v i).freeVariables
- LO.FirstOrder.Semiformula.verum.freeVariables = ∅
- LO.FirstOrder.Semiformula.falsum.freeVariables = ∅
- (φ.and ψ).freeVariables = φ.freeVariables ∪ ψ.freeVariables
- (φ.or ψ).freeVariables = φ.freeVariables ∪ ψ.freeVariables
- φ.all.freeVariables = φ.freeVariables
- φ.ex.freeVariables = φ.freeVariables
Instances For
Imported declaration from the Incompleteness formalization.
Equations
- φ.FVar? x = (x ∈ φ.freeVariables)
Instances For
Imported declaration from the Incompleteness formalization.
Equations
Instances For
Imported declaration from the Incompleteness formalization.
Equations
- LO.FirstOrder.Semiformula.lMapAux Φ LO.FirstOrder.Semiformula.verum = ⊤
- LO.FirstOrder.Semiformula.lMapAux Φ LO.FirstOrder.Semiformula.falsum = ⊥
- LO.FirstOrder.Semiformula.lMapAux Φ (LO.FirstOrder.Semiformula.rel r v) = LO.FirstOrder.Semiformula.rel (Φ.rel r) (LO.FirstOrder.Semiterm.lMap Φ ∘ v)
- LO.FirstOrder.Semiformula.lMapAux Φ (LO.FirstOrder.Semiformula.nrel r v) = LO.FirstOrder.Semiformula.nrel (Φ.rel r) (LO.FirstOrder.Semiterm.lMap Φ ∘ v)
- LO.FirstOrder.Semiformula.lMapAux Φ (φ.and ψ) = LO.FirstOrder.Semiformula.lMapAux Φ φ ⋏ LO.FirstOrder.Semiformula.lMapAux Φ ψ
- LO.FirstOrder.Semiformula.lMapAux Φ (φ.or ψ) = LO.FirstOrder.Semiformula.lMapAux Φ φ ⋎ LO.FirstOrder.Semiformula.lMapAux Φ ψ
- LO.FirstOrder.Semiformula.lMapAux Φ φ.all = ∀' LO.FirstOrder.Semiformula.lMapAux Φ φ
- LO.FirstOrder.Semiformula.lMapAux Φ φ.ex = ∃' LO.FirstOrder.Semiformula.lMapAux Φ φ
Instances For
Imported declaration from the Incompleteness formalization.
Equations
- LO.FirstOrder.Semiformula.lMap Φ = { toTr := LO.FirstOrder.Semiformula.lMapAux Φ, map_top' := ⋯, map_bot' := ⋯, map_neg' := ⋯, map_imply' := ⋯, map_and' := ⋯, map_or' := ⋯ }
Instances For
Imported declaration from the Incompleteness formalization.
Equations
Instances For
Imported declaration from the Incompleteness formalization.
Equations
Instances For
Equations
- LO.FirstOrder.Theory.instAdd = { add := fun (x1 x2 : LO.FirstOrder.Theory L) => x1 ∪ x2 }