Soundness and completeness of normal modal logics
DefinitionTranslation of CSLib's modal propositions#✓fully proved
CSLib's unimodal propositions are translated into modal formulas in the \(\bot\), \(\to\), \(\Box\) basis by recursion, writing \(\varphi'\) for the translation of \(\varphi\): an atom \(p\) goes to \(p\), falsehood to \(\bot\), \(\neg\varphi\) to \(\varphi' \to \bot\), \(\varphi \lor \psi\) to \((\varphi' \to \bot) \to \psi'\), and the diamond (the unimodal triangle) applied to \(\varphi\) goes to \(\Diamond\varphi'\), that is, to \(\Box(\varphi' \to \bot) \to \bot\).
def Formula.ofProposition : Logic.Modal.Unimodal.Proposition Atom → Formula Atom
| .atom p => .atom p
| .false => .bot
| .not phi => (ofProposition phi).neg
| .or phi psi => (ofProposition phi).or (ofProposition psi)
| .triangle _ phis => (ofProposition (phis default)).dia
termination_by structural phi => phi
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
Uses 4 · Used by 11
DefinitionKripke model of a CSLib model#✓fully proved
For a CSLib unimodal model \(m\) on a nonempty type of worlds, the associated Kripke model has the same worlds, the binary accessibility relation of \(m\) as its accessibility relation, and the valuation of \(m\) as its valuation.
def KripkeModel.ofModel [Nonempty World] (m : Logic.Modal.Unimodal.Model World Atom) :
KripkeModel World Atom where
nonempty_world := inferInstance
rel := m.rel
valuation := m.v
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
Uses 1 · Used by 9
TheoremThe translation preserves satisfaction#✓fully proved
Let \(m\) be a CSLib unimodal model on a nonempty type of worlds, \(w\) a world and \(\varphi\) a CSLib unimodal proposition. Then the translation of \(\varphi\) into the \(\bot\), \(\to\), \(\Box\) basis holds at \(w\) in the Kripke model of \(m\) if and only if \(\varphi\) holds at \(w\) in \(m\).
theorem satisfies_ofProposition [Nonempty World]
(m : Logic.Modal.Unimodal.Model World Atom) (w : World)
(phi : Logic.Modal.Unimodal.Proposition Atom) :
(KripkeModel.ofModel m).Satisfies w (Formula.ofProposition phi) ↔
Logic.Modal.Satisfies m w phi
def KripkeModel.ofModel [Nonempty World] (m : Logic.Modal.Unimodal.Model World Atom) :
KripkeModel World Atom where
nonempty_world := inferInstance
rel := m.rel
valuation := m.v
CSLibExt/Logics/Modal/CslibTranslation.lean:66
def Formula.ofProposition : Logic.Modal.Unimodal.Proposition Atom → Formula Atom
| .atom p => .atom p
| .false => .bot
| .not phi => (ofProposition phi).neg
| .or phi psi => (ofProposition phi).or (ofProposition psi)
| .triangle _ phis => (ofProposition (phis default)).dia
termination_by structural phi => phi
CSLibExt/Logics/Modal/CslibTranslation.lean:57
Uses 9 · Used by 2
DefinitionThe CSLib unimodal model of a Kripke model#✓fully proved
A Kripke model \(k\) on worlds \(W\) gives the CSLib unimodal model on \(W\) whose frame is the unimodal frame built from the accessibility relation of \(k\) and whose valuation is the valuation of \(k\).
def KripkeModel.toModel (k : KripkeModel World Atom) :
Logic.Modal.Unimodal.Model World Atom where
toFrame := Frame.ofRelation k.rel
v := k.valuation
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
Uses 1 · Used by 4
TheoremKripke to CSLib and back is the identity#✓fully proved
Let \(k\) be a Kripke model on a nonempty type of worlds. Converting \(k\) to a CSLib unimodal model and converting that model back to a Kripke model gives \(k\).
theorem KripkeModel.ofModel_toModel [Nonempty World] (k : KripkeModel World Atom) :
KripkeModel.ofModel (KripkeModel.toModel k) = k
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
def KripkeModel.ofModel [Nonempty World] (m : Logic.Modal.Unimodal.Model World Atom) :
KripkeModel World Atom where
nonempty_world := inferInstance
rel := m.rel
valuation := m.v
CSLibExt/Logics/Modal/CslibTranslation.lean:66
def KripkeModel.toModel (k : KripkeModel World Atom) :
Logic.Modal.Unimodal.Model World Atom where
toFrame := Frame.ofRelation k.rel
v := k.valuation
CSLibExt/Logics/Modal/CslibTranslation.lean:103
Uses 3
TheoremRound trip from CSLib models through Kripke models#✓fully proved
For a nonempty type of worlds \(W\), converting a CSLib unimodal model \(m\) on \(W\) into a Kripke model and then back into a CSLib unimodal model returns \(m\): a unimodal frame is determined by its binary accessibility relation.
theorem KripkeModel.toModel_ofModel [Nonempty World]
(m : Logic.Modal.Unimodal.Model World Atom) :
(KripkeModel.ofModel m).toModel = m
def KripkeModel.ofModel [Nonempty World] (m : Logic.Modal.Unimodal.Model World Atom) :
KripkeModel World Atom where
nonempty_world := inferInstance
rel := m.rel
valuation := m.v
CSLibExt/Logics/Modal/CslibTranslation.lean:66
Uses 2
DefinitionTranslation of modal formulas into CSLib propositions#✓fully proved
Each modal formula built from atoms, \(\bot\), \(\to\) and \(\Box\) is translated into a CSLib unimodal proposition by recursion: an atom \(p\) goes to the atom \(p\), \(\bot\) goes to false, \(\varphi \to \psi\) goes to \(\neg\varphi' \lor \psi'\), and \(\Box\varphi\) goes to \(\neg\Diamond\neg\varphi'\), where \(\varphi'\) and \(\psi'\) are the translations of \(\varphi\) and \(\psi\) and \(\Diamond\) is the possibility operator of CSLib's unimodal language.
def Formula.toProposition : Formula Atom → Logic.Modal.Unimodal.Proposition Atom
| .atom p => .atom p
| .bot => .false
| .imp phi psi => .or (.not (toProposition phi)) (toProposition psi)
| .box phi => .not (.triangle default (fun _ => .not (toProposition phi)))
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
Uses 1 · Used by 2
TheoremThe reverse translation preserves satisfaction#✓fully proved
Let \(k\) be a Kripke model, \(w\) a world and \(\varphi\) a modal formula in the \(\bot\), \(\to\), \(\Box\) basis. Then \(\varphi\) holds at \(w\) in \(k\) if and only if its translation into a CSLib unimodal proposition holds at \(w\) in the CSLib model associated with \(k\).
Together with the preservation of satisfaction by the forward translation and the two model round trips, this shows that the two presentations have the same unimodal semantics.
theorem satisfies_toProposition (k : KripkeModel World Atom) (w : World)
(phi : Formula Atom) :
k.Satisfies w phi ↔ Logic.Modal.Satisfies k.toModel w (Formula.toProposition phi)
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
def Formula.toProposition : Formula Atom → Logic.Modal.Unimodal.Proposition Atom
| .atom p => .atom p
| .bot => .false
| .imp phi psi => .or (.not (toProposition phi)) (toProposition psi)
| .box phi => .not (.triangle default (fun _ => .not (toProposition phi)))
CSLibExt/Logics/Modal/CslibTranslation.lean:132
Uses 5 · Used by 1
TheoremValidity agrees with its CSLib translation#✓fully proved
A modal formula \(\varphi\) is valid in a Kripke model \(k\) (true at every world of \(k\)) if and only if its translation into a CSLib unimodal proposition is satisfied at every world of the CSLib unimodal model associated with \(k\).
theorem KripkeModel.valid_toProposition (k : KripkeModel World Atom)
(phi : Formula Atom) :
k.Valid phi ↔
∀ w, Logic.Modal.Satisfies k.toModel w (Formula.toProposition phi)
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
def Formula.toProposition : Formula Atom → Logic.Modal.Unimodal.Proposition Atom
| .atom p => .atom p
| .bot => .false
| .imp phi psi => .or (.not (toProposition phi)) (toProposition psi)
| .box phi => .not (.triangle default (fun _ => .not (toProposition phi)))
CSLibExt/Logics/Modal/CslibTranslation.lean:132
TheoremValidity of the translation gives membership in CSLib's logic#✓fully proved
Let \(S\) be a class of CSLib unimodal models on a type of worlds and \(\varphi\) a CSLib unimodal proposition. Suppose that, if the type of worlds is nonempty, the translation of \(\varphi\) into the \(\bot\), \(\to\), \(\Box\) basis is valid in the Kripke model of every model in \(S\). Then \(\varphi\) belongs to CSLib's semantic logic of \(S\): it holds at every world of every model in \(S\).
theorem mem_logic_of_valid {S : Set (Logic.Modal.Unimodal.Model World Atom)}
{phi : Logic.Modal.Unimodal.Proposition Atom}
(h : ∀ m ∈ S, ∀ _ : Nonempty World, (KripkeModel.ofModel m).Valid (Formula.ofProposition phi)) :
phi ∈ Logic.Modal.logic S
def KripkeModel.ofModel [Nonempty World] (m : Logic.Modal.Unimodal.Model World Atom) :
KripkeModel World Atom where
nonempty_world := inferInstance
rel := m.rel
valuation := m.v
CSLibExt/Logics/Modal/CslibTranslation.lean:66
def Formula.ofProposition : Logic.Modal.Unimodal.Proposition Atom → Formula Atom
| .atom p => .atom p
| .false => .bot
| .not phi => (ofProposition phi).neg
| .or phi psi => (ofProposition phi).or (ofProposition psi)
| .triangle _ phis => (ofProposition (phis default)).dia
termination_by structural phi => phi
CSLibExt/Logics/Modal/CslibTranslation.lean:57
Uses 5 · Used by 4
TheoremSoundness for CSLib's K#✓fully proved
Let \(\varphi\) be a CSLib unimodal proposition. If the translation of \(\varphi\) into the \(\bot\), \(\to\), \(\Box\) basis is a theorem of the Hilbert system K, then, for every type of worlds, \(\varphi\) belongs to CSLib's modal logic K: it holds at every world of every CSLib unimodal model on that type.
theorem mem_K (h : Derivable Axioms.K (Formula.ofProposition phi)) :
phi ∈ Logic.Modal.Unimodal.K World Atom
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
def K : Set (Formula Atom) := ∅
CSLibExt/Logics/Modal/Hilbert.lean:91
def Formula.ofProposition : Logic.Modal.Unimodal.Proposition Atom → Formula Atom
| .atom p => .atom p
| .false => .bot
| .not phi => (ofProposition phi).neg
| .or phi psi => (ofProposition phi).or (ofProposition psi)
| .triangle _ phis => (ofProposition (phis default)).dia
termination_by structural phi => phi
CSLibExt/Logics/Modal/CslibTranslation.lean:57
Uses 6 · Used by 1
TheoremSoundness for CSLib's T#✓fully proved
Let \(\varphi\) be a CSLib unimodal proposition. If the translation of \(\varphi\) into the \(\bot\), \(\to\), \(\Box\) basis is a theorem of the Hilbert system T, then, for every type of worlds, \(\varphi\) belongs to CSLib's modal logic T: it holds at every world of every CSLib unimodal model on that type whose accessibility relation is reflexive.
theorem mem_T (h : Derivable Axioms.T (Formula.ofProposition phi)) :
phi ∈ Logic.Modal.Unimodal.T World Atom
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
def T : Set (Formula Atom) := Set.range Formula.axiomT
CSLibExt/Logics/Modal/Hilbert.lean:94
def Formula.ofProposition : Logic.Modal.Unimodal.Proposition Atom → Formula Atom
| .atom p => .atom p
| .false => .bot
| .not phi => (ofProposition phi).neg
| .or phi psi => (ofProposition phi).or (ofProposition psi)
| .triangle _ phis => (ofProposition (phis default)).dia
termination_by structural phi => phi
CSLibExt/Logics/Modal/CslibTranslation.lean:57
Uses 6 · Used by 1
TheoremSoundness for CSLib's S4#✓fully proved
Let \(\varphi\) be a CSLib unimodal proposition. If the translation of \(\varphi\) into the \(\bot\), \(\to\), \(\Box\) basis is a theorem of the Hilbert system S4, then, for every type of worlds, \(\varphi\) belongs to CSLib's modal logic S4: it holds at every world of every CSLib unimodal model on that type whose accessibility relation is reflexive and transitive.
theorem mem_S4 (h : Derivable Axioms.S4 (Formula.ofProposition phi)) :
phi ∈ Logic.Modal.Unimodal.S4 World Atom
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
def S4 : Set (Formula Atom) := Set.range Formula.axiomT ∪ Set.range Formula.axiomFour
CSLibExt/Logics/Modal/Hilbert.lean:97
def Formula.ofProposition : Logic.Modal.Unimodal.Proposition Atom → Formula Atom
| .atom p => .atom p
| .false => .bot
| .not phi => (ofProposition phi).neg
| .or phi psi => (ofProposition phi).or (ofProposition psi)
| .triangle _ phis => (ofProposition (phis default)).dia
termination_by structural phi => phi
CSLibExt/Logics/Modal/CslibTranslation.lean:57
Uses 7 · Used by 1
TheoremSoundness for CSLib's S5#✓fully proved
Let \(\varphi\) be a CSLib unimodal proposition. If the translation of \(\varphi\) into the \(\bot\), \(\to\), \(\Box\) basis is a theorem of the Hilbert system S5, then, for every type of worlds, \(\varphi\) belongs to CSLib's modal logic S5: it holds at every world of every CSLib unimodal model on that type whose accessibility relation \(R\) is reflexive, transitive and Euclidean (\(R(w, u)\) and \(R(w, v)\) imply \(R(u, v)\)).
theorem mem_S5 (h : Derivable Axioms.S5 (Formula.ofProposition phi)) :
phi ∈ Logic.Modal.Unimodal.S5 World Atom
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
def S5 : Set (Formula Atom) := Set.range Formula.axiomT ∪ Set.range Formula.axiomFive
CSLibExt/Logics/Modal/Hilbert.lean:100
def Formula.ofProposition : Logic.Modal.Unimodal.Proposition Atom → Formula Atom
| .atom p => .atom p
| .false => .bot
| .not phi => (ofProposition phi).neg
| .or phi psi => (ofProposition phi).or (ofProposition psi)
| .triangle _ phis => (ofProposition (phis default)).dia
termination_by structural phi => phi
CSLibExt/Logics/Modal/CslibTranslation.lean:57
Uses 7 · Used by 1
DefinitionConsistency relative to a normal modal logic#✓fully proved
For sets of formulas \(\Lambda\) and \(\Gamma\), the set \(\Gamma\) is consistent relative to \(K \oplus \Lambda\) when \(\bot\) is not deducible from \(\Gamma\) in \(K \oplus \Lambda\).
def Consistent (Λ Γ : Set (Formula Atom)) : Prop := ¬Deduces Λ Γ .bot
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
inductive Deduces (Λ : Set (Formula Atom)) (Γ : Set (Formula Atom)) : Formula Atom → Prop
| hyp {phi : Formula Atom} : phi ∈ Γ → Deduces Λ Γ phi
| thm {phi : Formula Atom} : Derivable Λ phi → Deduces Λ Γ phi
| mp {phi psi : Formula Atom} : Deduces Λ Γ (.imp phi psi) → Deduces Λ Γ phi → Deduces Λ Γ psi
CSLibExt/Logics/Modal/Hilbert.lean:81
Uses 2 · Used by 24
TheoremConsistency is of finite character#✓fully proved
For every set \(\Lambda\) of extra axioms, a set of formulas is consistent relative to \(K \oplus \Lambda\) iff all its finite subsets are.
theorem consistent_isOfFiniteCharacter :
Order.IsOfFiniteCharacter {M : Set (Formula Atom) | Consistent Λ M}
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
def Consistent (Λ Γ : Set (Formula Atom)) : Prop := ¬Deduces Λ Γ .bot
CSLibExt/Logics/Modal/Canonical.lean:60
Uses 5 · Used by 1
TheoremLindenbaum's lemma for normal modal logics#✓fully proved
Let \(\Lambda\) be a set of modal formulas and \(\mathrm{K} \oplus \Lambda\) the normal modal logic K extended by the axioms \(\Lambda\). Every set \(\Gamma\) of modal formulas that is consistent relative to \(\mathrm{K} \oplus \Lambda\) is contained in a set \(M\) of modal formulas that is maximal among the sets consistent relative to \(\mathrm{K} \oplus \Lambda\).
The proof applies the Teichmüller–Tukey lemma: consistency is a property of finite character.
theorem exists_maximal_consistent {Γ : Set (Formula Atom)} (hΓ : Consistent Λ Γ) :
∃ M, Γ ⊆ M ∧ Maximal (Consistent Λ) M
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
def Consistent (Λ Γ : Set (Formula Atom)) : Prop := ¬Deduces Λ Γ .bot
CSLibExt/Logics/Modal/Canonical.lean:60
Uses 3 · Used by 4
TheoremMaximal consistent sets of modal formulas are deductively closed#✓fully proved
Let \(\Lambda\) be a set of modal formulas and \(M\) a set of modal formulas that is maximal among the sets consistent relative to the normal modal logic K extended by the axioms \(\Lambda\). Every formula that is a local consequence of \(M\) in that logic belongs to \(M\).
theorem mem_of_deduces {phi : Formula Atom} (h : Deduces Λ M phi) : phi ∈ M
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
inductive Deduces (Λ : Set (Formula Atom)) (Γ : Set (Formula Atom)) : Formula Atom → Prop
| hyp {phi : Formula Atom} : phi ∈ Γ → Deduces Λ Γ phi
| thm {phi : Formula Atom} : Derivable Λ phi → Deduces Λ Γ phi
| mp {phi psi : Formula Atom} : Deduces Λ Γ (.imp phi psi) → Deduces Λ Γ phi → Deduces Λ Γ psi
CSLibExt/Logics/Modal/Hilbert.lean:81
Uses 6 · Used by 13
TheoremIterated modus ponens in maximal consistent sets#✓fully proved
Let \(\Lambda\) be a set of modal formulas, \(M\) a set of modal formulas that is maximal among the sets consistent relative to the normal modal logic K extended by the axioms \(\Lambda\), and \(\varphi\) and \(\gamma_1, \dots, \gamma_n\) modal formulas. If \(\gamma_1 \to (\gamma_2 \to \cdots \to (\gamma_n \to \varphi) \cdots) \in M\) and \(\gamma_1, \dots, \gamma_n \in M\), then \(\varphi \in M\).
theorem mem_of_foldr_imp_mem {l : List (Formula Atom)} {phi : Formula Atom}
(h : l.foldr .imp phi ∈ M) (hl : ∀ psi ∈ l, psi ∈ M) : phi ∈ M
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
Uses 4 · Used by 1
TheoremDischarging a list of hypotheses#✓fully proved
Let \(\Lambda\) and \(\Gamma\) be sets of modal formulas, \(\varphi\) a modal formula and \(\gamma_1, \dots, \gamma_n\) a list of modal formulas. If \(\varphi\) is a local consequence of \(\Gamma \cup \{\gamma_1, \dots, \gamma_n\}\) in the normal modal logic K extended by the axioms \(\Lambda\), then \(\gamma_1 \to (\gamma_2 \to \cdots \to (\gamma_n \to \varphi) \cdots)\) is a local consequence of \(\Gamma\) in the same logic.
theorem Deduces.foldr_imp {Γ : Set (Formula Atom)} {l : List (Formula Atom)}
{phi : Formula Atom} (h : Deduces Λ (Γ ∪ {x | x ∈ l}) phi) :
Deduces Λ Γ (l.foldr .imp phi)
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
inductive Deduces (Λ : Set (Formula Atom)) (Γ : Set (Formula Atom)) : Formula Atom → Prop
| hyp {phi : Formula Atom} : phi ∈ Γ → Deduces Λ Γ phi
| thm {phi : Formula Atom} : Derivable Λ phi → Deduces Λ Γ phi
| mp {phi psi : Formula Atom} : Deduces Λ Γ (.imp phi psi) → Deduces Λ Γ phi → Deduces Λ Γ psi
CSLibExt/Logics/Modal/Hilbert.lean:81
Uses 4 · Used by 1
TheoremBoxing an implication chain#✓fully proved
Let \(\Lambda\) be a set of extra axioms, let \(\gamma_1, \dots, \gamma_n\) be formulas (with \(n \ge 0\)) and let \(\varphi\) be a formula. Then \(\Box(\gamma_1 \to \cdots \to \gamma_n \to \varphi) \to (\Box\gamma_1 \to \cdots \to \Box\gamma_n \to \Box\varphi)\) is a theorem of \(K \oplus \Lambda\).
theorem Derivable.box_foldr_imp (l : List (Formula Atom)) (phi : Formula Atom) :
Derivable Λ (.imp (.box (l.foldr .imp phi)) ((l.map .box).foldr .imp (.box phi)))
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
Uses 7 · Used by 1
DefinitionWorlds of the canonical model#✓fully proved
For a set \(\Lambda\) of extra axioms, the worlds of the canonical model of \(K \oplus \Lambda\) are the maximal consistent sets of \(K \oplus \Lambda\): the sets of formulas that are consistent relative to \(K \oplus \Lambda\) and have no consistent proper superset.
def CanonicalWorld (Λ : Set (Formula Atom)) : Type u :=
{M : Set (Formula Atom) // Maximal (Consistent Λ) M}
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
def Consistent (Λ Γ : Set (Formula Atom)) : Prop := ¬Deduces Λ Γ .bot
CSLibExt/Logics/Modal/Canonical.lean:60
Uses 2 · Used by 20
DefinitionThe canonical accessibility relation#✓fully proved
For a set \(\Lambda\) of modal formulas and maximal \((K \oplus \Lambda)\)-consistent sets \(M\) and \(N\) (worlds of the canonical model), \(M\) is related to \(N\) iff every formula \(\varphi\) with \(\Box\varphi \in M\) belongs to \(N\).
def CanonicalWorld.rel (M N : CanonicalWorld Λ) : Prop := ∀ phi, Formula.box phi ∈ M.1 → phi ∈ N.1
def CanonicalWorld (Λ : Set (Formula Atom)) : Type u :=
{M : Set (Formula Atom) // Maximal (Consistent Λ) M}
CSLibExt/Logics/Modal/Canonical.lean:157
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
Uses 3 · Used by 13
DefinitionThe canonical model#✓fully proved
Let \(\Lambda\) be a set of extra axioms such that \(\bot\) is not a theorem of \(K \oplus \Lambda\). The canonical model of \(K \oplus \Lambda\) is the Kripke model whose worlds are the maximal consistent sets of \(K \oplus \Lambda\) (there is at least one, by Lindenbaum's lemma), in which \(M\) sees \(N\) iff \(\varphi \in N\) for every formula \(\varphi\) with \(\Box\varphi \in M\), and in which an atom \(p\) is true at \(M\) iff \(p \in M\).
def canonicalModel (h : ¬Derivable Λ .bot) : KripkeModel (CanonicalWorld Λ) Atom where
nonempty_world :=
let ⟨M, _, hM⟩ := exists_maximal_consistent (consistent_empty h)
⟨⟨M, hM⟩⟩
rel := CanonicalWorld.rel
valuation M p := Formula.atom p ∈ M.1
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
def CanonicalWorld (Λ : Set (Formula Atom)) : Type u :=
{M : Set (Formula Atom) // Maximal (Consistent Λ) M}
CSLibExt/Logics/Modal/Canonical.lean:157
theorem exists_maximal_consistent {Γ : Set (Formula Atom)} (hΓ : Consistent Λ Γ) :
∃ M, Γ ⊆ M ∧ Maximal (Consistent Λ) M
CSLibExt/Logics/Modal/Canonical.lean:72
theorem consistent_empty (h : ¬Derivable Λ .bot) : Consistent Λ ∅
CSLibExt/Logics/Modal/Canonical.lean:163
def CanonicalWorld.rel (M N : CanonicalWorld Λ) : Prop := ∀ phi, Formula.box phi ∈ M.1 → phi ∈ N.1
CSLibExt/Logics/Modal/Canonical.lean:161
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:89
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
Uses 9 · Used by 9
TheoremExistence lemma#✓fully proved
Let \(\Lambda\) be a set of modal formulas, \(\mathrm{K} \oplus \Lambda\) the normal modal logic K extended by the axioms \(\Lambda\), \(M\) a canonical world, that is, a set of modal formulas maximal among the sets consistent relative to \(\mathrm{K} \oplus \Lambda\), and \(\varphi\) a modal formula. If \(\Box\varphi \notin M\), then there is a canonical world \(N\) with \(\varphi \notin N\) that is accessible from \(M\) in the canonical relation: every \(\psi\) with \(\Box\psi \in M\) lies in \(N\).
theorem CanonicalWorld.exists_rel_not_mem (M : CanonicalWorld Λ) {phi : Formula Atom}
(h : Formula.box phi ∉ M.1) : ∃ N : CanonicalWorld Λ, M.rel N ∧ phi ∉ N.1
def CanonicalWorld (Λ : Set (Formula Atom)) : Type u :=
{M : Set (Formula Atom) // Maximal (Consistent Λ) M}
CSLibExt/Logics/Modal/Canonical.lean:157
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
Uses 16 · Used by 1
TheoremTruth lemma#✓fully proved
A formula holds at a world of the canonical model iff it belongs to it.
theorem satisfies_canonical_iff (h : ¬Derivable Λ .bot) (M : CanonicalWorld Λ)
(phi : Formula Atom) : (canonicalModel h).Satisfies M phi ↔ phi ∈ M.1
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
def CanonicalWorld (Λ : Set (Formula Atom)) : Type u :=
{M : Set (Formula Atom) // Maximal (Consistent Λ) M}
CSLibExt/Logics/Modal/Canonical.lean:157
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
def canonicalModel (h : ¬Derivable Λ .bot) : KripkeModel (CanonicalWorld Λ) Atom where
nonempty_world :=
let ⟨M, _, hM⟩ := exists_maximal_consistent (consistent_empty h)
⟨⟨M, hM⟩⟩
rel := CanonicalWorld.rel
valuation M p := Formula.atom p ∈ M.1
CSLibExt/Logics/Modal/Canonical.lean:167
Uses 16 · Used by 3
TheoremDeducibility from maximal consistent extensions#✓fully proved
Let \(\Lambda\) and \(\Gamma\) be sets of modal formulas and \(\varphi\) a formula. If \(\varphi\) belongs to every maximal \((K \oplus \Lambda)\)-consistent set that contains \(\Gamma\), then \(\Gamma\) deduces \(\varphi\) in \(K \oplus \Lambda\).
theorem Deduces.of_canonical {Γ : Set (Formula Atom)} {phi : Formula Atom}
(h : ∀ M : CanonicalWorld Λ, Γ ⊆ M.1 → phi ∈ M.1) : Deduces Λ Γ phi
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
def CanonicalWorld (Λ : Set (Formula Atom)) : Type u :=
{M : Set (Formula Atom) // Maximal (Consistent Λ) M}
CSLibExt/Logics/Modal/Canonical.lean:157
inductive Deduces (Λ : Set (Formula Atom)) (Γ : Set (Formula Atom)) : Formula Atom → Prop
| hyp {phi : Formula Atom} : phi ∈ Γ → Deduces Λ Γ phi
| thm {phi : Formula Atom} : Derivable Λ phi → Deduces Λ Γ phi
| mp {phi psi : Formula Atom} : Deduces Λ Γ (.imp phi psi) → Deduces Λ Γ phi → Deduces Λ Γ psi
CSLibExt/Logics/Modal/Hilbert.lean:81
Uses 8 · Used by 2
TheoremCompleteness relative to the canonical model#✓fully proved
Let \(\Lambda\) be a set of modal formulas such that \(\bot\) is not a theorem of \(K \oplus \Lambda\), let \(\Gamma\) be a set of formulas and \(\varphi\) a formula. If \(\varphi\) holds at every world of the canonical model of \(K \oplus \Lambda\) at which every formula of \(\Gamma\) holds, then \(\Gamma\) deduces \(\varphi\) in \(K \oplus \Lambda\).
theorem Deduces.of_canonicalModel (h : ¬Derivable Λ .bot) {Γ : Set (Formula Atom)}
{phi : Formula Atom}
(hsem : ∀ M, (∀ psi ∈ Γ, (canonicalModel h).Satisfies M psi) →
(canonicalModel h).Satisfies M phi) : Deduces Λ Γ phi
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
def canonicalModel (h : ¬Derivable Λ .bot) : KripkeModel (CanonicalWorld Λ) Atom where
nonempty_world :=
let ⟨M, _, hM⟩ := exists_maximal_consistent (consistent_empty h)
⟨⟨M, hM⟩⟩
rel := CanonicalWorld.rel
valuation M p := Formula.atom p ∈ M.1
CSLibExt/Logics/Modal/Canonical.lean:167
inductive Deduces (Λ : Set (Formula Atom)) (Γ : Set (Formula Atom)) : Formula Atom → Prop
| hyp {phi : Formula Atom} : phi ∈ Γ → Deduces Λ Γ phi
| thm {phi : Formula Atom} : Derivable Λ phi → Deduces Λ Γ phi
| mp {phi psi : Formula Atom} : Deduces Λ Γ (.imp phi psi) → Deduces Λ Γ phi → Deduces Λ Γ psi
CSLibExt/Logics/Modal/Hilbert.lean:81
Uses 9 · Used by 4
TheoremDouble-negation introduction under a box#✓fully proved
For every set \(\Lambda\) of extra axioms and every modal formula \(\psi\), the formula \(\Box\psi \to \Box\neg\neg\psi\) is a theorem of the normal modal logic \(K \oplus \Lambda\), where \(\neg\chi\) abbreviates \(\chi \to \bot\).
theorem derivable_box_imp_box_neg_neg (psi : Formula Atom) :
Derivable Λ (.imp (.box psi) (.box psi.neg.neg))
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
Uses 8 · Used by 3
DefinitionLocal semantic consequence over a class of Kripke models#✓fully proved
Let \(C\) be a class of Kripke models, given as a predicate on models. A set \(\Gamma\) of modal formulas locally entails a formula \(\varphi\) over \(C\) when, for every Kripke model \(M\) in \(C\) whose type of worlds lies in the universe of the atoms and every world \(w\) of \(M\), if every formula of \(\Gamma\) is satisfied at \(w\) in \(M\), then \(\varphi\) is satisfied at \(w\) in \(M\).
def LocallyEntails (C : ∀ {W : Type u}, KripkeModel W Atom → Prop) (Γ : Set (Formula Atom))
(phi : Formula Atom) : Prop :=
∀ (W : Type u) (M : KripkeModel W Atom) (w : W), C M → (∀ psi ∈ Γ, M.Satisfies w psi) →
M.Satisfies w phi
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
Uses 3 · Used by 8
TheoremStrong completeness of K#✓fully proved
Let \(\Gamma\) be a set of formulas and \(\varphi\) a formula. Suppose that for every Kripke model whose worlds form a type in the universe of the atoms, and every world \(w\) of it at which all formulas of \(\Gamma\) hold, \(\varphi\) holds at \(w\). Then \(\varphi\) is deducible from \(\Gamma\) in K.
theorem completeness_K (hsem : LocallyEntails (fun _ ↦ True) Γ phi) : Deduces Axioms.K Γ phi
def LocallyEntails (C : ∀ {W : Type u}, KripkeModel W Atom → Prop) (Γ : Set (Formula Atom))
(phi : Formula Atom) : Prop :=
∀ (W : Type u) (M : KripkeModel W Atom) (w : W), C M → (∀ psi ∈ Γ, M.Satisfies w psi) →
M.Satisfies w phi
CSLibExt/Logics/Modal/Canonical.lean:281
inductive Deduces (Λ : Set (Formula Atom)) (Γ : Set (Formula Atom)) : Formula Atom → Prop
| hyp {phi : Formula Atom} : phi ∈ Γ → Deduces Λ Γ phi
| thm {phi : Formula Atom} : Derivable Λ phi → Deduces Λ Γ phi
| mp {phi psi : Formula Atom} : Deduces Λ Γ (.imp phi psi) → Deduces Λ Γ phi → Deduces Λ Γ psi
CSLibExt/Logics/Modal/Hilbert.lean:81
def K : Set (Formula Atom) := ∅
CSLibExt/Logics/Modal/Hilbert.lean:91
Uses 11 · Used by 2
TheoremStrong completeness of T#✓fully proved
Let \(\Gamma\) be a set of formulas and \(\varphi\) a formula. Suppose that for every Kripke model with reflexive accessibility relation whose worlds form a type in the universe of the atoms, and every world \(w\) of it at which all formulas of \(\Gamma\) hold, \(\varphi\) holds at \(w\). Then \(\varphi\) is deducible from \(\Gamma\) in T.
theorem completeness_T (hsem : LocallyEntails (fun M ↦ ∀ w, M.rel w w) Γ phi) :
Deduces Axioms.T Γ phi
def LocallyEntails (C : ∀ {W : Type u}, KripkeModel W Atom → Prop) (Γ : Set (Formula Atom))
(phi : Formula Atom) : Prop :=
∀ (W : Type u) (M : KripkeModel W Atom) (w : W), C M → (∀ psi ∈ Γ, M.Satisfies w psi) →
M.Satisfies w phi
CSLibExt/Logics/Modal/Canonical.lean:281
inductive Deduces (Λ : Set (Formula Atom)) (Γ : Set (Formula Atom)) : Formula Atom → Prop
| hyp {phi : Formula Atom} : phi ∈ Γ → Deduces Λ Γ phi
| thm {phi : Formula Atom} : Derivable Λ phi → Deduces Λ Γ phi
| mp {phi psi : Formula Atom} : Deduces Λ Γ (.imp phi psi) → Deduces Λ Γ phi → Deduces Λ Γ psi
CSLibExt/Logics/Modal/Hilbert.lean:81
def T : Set (Formula Atom) := Set.range Formula.axiomT
CSLibExt/Logics/Modal/Hilbert.lean:94
Uses 15 · Used by 2
TheoremStrong completeness of S4#✓fully proved
Let \(\Gamma\) be a set of formulas and \(\varphi\) a formula. Suppose that for every Kripke model with reflexive and transitive accessibility relation whose worlds form a type in the universe of the atoms, and every world \(w\) of it at which all formulas of \(\Gamma\) hold, \(\varphi\) holds at \(w\). Then \(\varphi\) is deducible from \(\Gamma\) in S4.
theorem completeness_S4 (hsem : LocallyEntails (fun M ↦ (∀ w, M.rel w w) ∧
∀ {a b c}, M.rel a b → M.rel b c → M.rel a c) Γ phi) : Deduces Axioms.S4 Γ phi
def LocallyEntails (C : ∀ {W : Type u}, KripkeModel W Atom → Prop) (Γ : Set (Formula Atom))
(phi : Formula Atom) : Prop :=
∀ (W : Type u) (M : KripkeModel W Atom) (w : W), C M → (∀ psi ∈ Γ, M.Satisfies w psi) →
M.Satisfies w phi
CSLibExt/Logics/Modal/Canonical.lean:281
inductive Deduces (Λ : Set (Formula Atom)) (Γ : Set (Formula Atom)) : Formula Atom → Prop
| hyp {phi : Formula Atom} : phi ∈ Γ → Deduces Λ Γ phi
| thm {phi : Formula Atom} : Derivable Λ phi → Deduces Λ Γ phi
| mp {phi psi : Formula Atom} : Deduces Λ Γ (.imp phi psi) → Deduces Λ Γ phi → Deduces Λ Γ psi
CSLibExt/Logics/Modal/Hilbert.lean:81
def S4 : Set (Formula Atom) := Set.range Formula.axiomT ∪ Set.range Formula.axiomFour
CSLibExt/Logics/Modal/Hilbert.lean:97
Uses 16 · Used by 2
TheoremStrong completeness of S5#✓fully proved
Let \(\Gamma\) be a set of formulas and \(\varphi\) a formula. Suppose that for every Kripke model whose accessibility relation is an equivalence relation and whose worlds form a type in the universe of the atoms, and every world \(w\) of it at which all formulas of \(\Gamma\) hold, \(\varphi\) holds at \(w\). Then \(\varphi\) is deducible from \(\Gamma\) in S5.
theorem completeness_S5 (hsem : LocallyEntails (fun M ↦ Equivalence M.rel) Γ phi) :
Deduces Axioms.S5 Γ phi
def LocallyEntails (C : ∀ {W : Type u}, KripkeModel W Atom → Prop) (Γ : Set (Formula Atom))
(phi : Formula Atom) : Prop :=
∀ (W : Type u) (M : KripkeModel W Atom) (w : W), C M → (∀ psi ∈ Γ, M.Satisfies w psi) →
M.Satisfies w phi
CSLibExt/Logics/Modal/Canonical.lean:281
inductive Deduces (Λ : Set (Formula Atom)) (Γ : Set (Formula Atom)) : Formula Atom → Prop
| hyp {phi : Formula Atom} : phi ∈ Γ → Deduces Λ Γ phi
| thm {phi : Formula Atom} : Derivable Λ phi → Deduces Λ Γ phi
| mp {phi psi : Formula Atom} : Deduces Λ Γ (.imp phi psi) → Deduces Λ Γ phi → Deduces Λ Γ psi
CSLibExt/Logics/Modal/Hilbert.lean:81
def S5 : Set (Formula Atom) := Set.range Formula.axiomT ∪ Set.range Formula.axiomFive
CSLibExt/Logics/Modal/Hilbert.lean:100
Uses 20 · Used by 2
TheoremSoundness and completeness of K#✓fully proved
A modal formula \(\varphi\) is a theorem of K if and only if \(\varphi\) is valid, that is, true at every world, in every Kripke model whose worlds live in the universe of the atoms.
theorem derivable_K_iff :
Derivable Axioms.K phi ↔ ∀ (W : Type u) (M : KripkeModel W Atom), M.Valid phi
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
def K : Set (Formula Atom) := ∅
CSLibExt/Logics/Modal/Hilbert.lean:91
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
Uses 10 · Used by 1
TheoremSoundness and completeness of T#✓fully proved
A modal formula \(\varphi\) is a theorem of T if and only if \(\varphi\) is valid in every Kripke model whose accessibility relation is reflexive and whose type of worlds lies in the same universe as the type of atoms.
theorem derivable_T_iff :
Derivable Axioms.T phi ↔
∀ (W : Type u) (M : KripkeModel W Atom), (∀ w, M.rel w w) → M.Valid phi
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
def T : Set (Formula Atom) := Set.range Formula.axiomT
CSLibExt/Logics/Modal/Hilbert.lean:94
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
Uses 10 · Used by 2
TheoremSoundness and completeness of S4#✓fully proved
A modal formula \(\varphi\) is a theorem of S4 if and only if \(\varphi\) is valid in every Kripke model whose accessibility relation is reflexive and transitive and whose type of worlds lies in the same universe as the type of atoms.
theorem derivable_S4_iff :
Derivable Axioms.S4 phi ↔
∀ (W : Type u) (M : KripkeModel W Atom), (∀ w, M.rel w w) →
(∀ {a b c}, M.rel a b → M.rel b c → M.rel a c) → M.Valid phi
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
def S4 : Set (Formula Atom) := Set.range Formula.axiomT ∪ Set.range Formula.axiomFour
CSLibExt/Logics/Modal/Hilbert.lean:97
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
Uses 10 · Used by 2
TheoremSoundness and completeness of S5#✓fully proved
A modal formula \(\varphi\) is a theorem of S5 if and only if \(\varphi\) is valid in every Kripke model whose accessibility relation is an equivalence relation and whose type of worlds lies in the same universe as the type of atoms.
theorem derivable_S5_iff :
Derivable Axioms.S5 phi ↔
∀ (W : Type u) (M : KripkeModel W Atom), Equivalence M.rel → M.Valid phi
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
def S5 : Set (Formula Atom) := Set.range Formula.axiomT ∪ Set.range Formula.axiomFive
CSLibExt/Logics/Modal/Hilbert.lean:100
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
Uses 10 · Used by 2
TheoremModel existence from the canonical model#✓fully proved
Let \(\Lambda\) be a set of modal formulas and \(C\) a class of Kripke models whose worlds lie in the universe of the atoms, such that \(C\) contains the canonical model of \(K \oplus \Lambda\) whenever \(\bot\) is not a theorem of \(K \oplus \Lambda\). Then every \((K \oplus \Lambda)\)-consistent set \(\Gamma\) of formulas is satisfiable in \(C\): some model in \(C\) has a world at which every formula of \(\Gamma\) holds.
This is strong completeness in satisfiability form. The converse needs every model in \(C\) to validate \(\Lambda\); for K, T, S4 and S5 it is soundness.
theorem satisfiable_of_consistent {C : ∀ {W : Type u}, KripkeModel W Atom → Prop}
(hC : ∀ h : ¬Derivable Λ .bot, C (canonicalModel h)) (hΓ : Consistent Λ Γ) :
∃ (W : Type u) (M : KripkeModel W Atom) (w : W), C M ∧ ∀ psi ∈ Γ, M.Satisfies w psi
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
def canonicalModel (h : ¬Derivable Λ .bot) : KripkeModel (CanonicalWorld Λ) Atom where
nonempty_world :=
let ⟨M, _, hM⟩ := exists_maximal_consistent (consistent_empty h)
⟨⟨M, hM⟩⟩
rel := CanonicalWorld.rel
valuation M p := Formula.atom p ∈ M.1
CSLibExt/Logics/Modal/Canonical.lean:167
def Consistent (Λ Γ : Set (Formula Atom)) : Prop := ¬Deduces Λ Γ .bot
CSLibExt/Logics/Modal/Canonical.lean:60
Uses 10 · Used by 4
TheoremModel existence for K#✓fully proved
For every K-consistent set \(\Gamma\) of modal formulas there are a Kripke model, whose worlds lie in the universe of the atoms, and a world of it at which every formula of \(\Gamma\) holds.
theorem satisfiable_K (hΓ : Consistent Axioms.K Γ) :
∃ (W : Type u) (M : KripkeModel W Atom) (w : W), ∀ psi ∈ Γ, M.Satisfies w psi
def Consistent (Λ Γ : Set (Formula Atom)) : Prop := ¬Deduces Λ Γ .bot
CSLibExt/Logics/Modal/Canonical.lean:60
def K : Set (Formula Atom) := ∅
CSLibExt/Logics/Modal/Hilbert.lean:91
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
TheoremModel existence for T#✓fully proved
For every T-consistent set \(\Gamma\) of modal formulas there are a reflexive Kripke model, whose worlds lie in the universe of the atoms, and a world of it at which every formula of \(\Gamma\) holds.
theorem satisfiable_T (hΓ : Consistent Axioms.T Γ) :
∃ (W : Type u) (M : KripkeModel W Atom) (w : W), (∀ w, M.rel w w) ∧
∀ psi ∈ Γ, M.Satisfies w psi
def Consistent (Λ Γ : Set (Formula Atom)) : Prop := ¬Deduces Λ Γ .bot
CSLibExt/Logics/Modal/Canonical.lean:60
def T : Set (Formula Atom) := Set.range Formula.axiomT
CSLibExt/Logics/Modal/Hilbert.lean:94
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
Uses 12
TheoremModel existence for S4#✓fully proved
For every S4-consistent set \(\Gamma\) of modal formulas there are a reflexive transitive Kripke model, whose worlds lie in the universe of the atoms, and a world of it at which every formula of \(\Gamma\) holds.
theorem satisfiable_S4 (hΓ : Consistent Axioms.S4 Γ) :
∃ (W : Type u) (M : KripkeModel W Atom) (w : W), ((∀ w, M.rel w w) ∧
∀ {a b c}, M.rel a b → M.rel b c → M.rel a c) ∧ ∀ psi ∈ Γ, M.Satisfies w psi
def Consistent (Λ Γ : Set (Formula Atom)) : Prop := ¬Deduces Λ Γ .bot
CSLibExt/Logics/Modal/Canonical.lean:60
def S4 : Set (Formula Atom) := Set.range Formula.axiomT ∪ Set.range Formula.axiomFour
CSLibExt/Logics/Modal/Hilbert.lean:97
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
Uses 14
TheoremModel existence for S5#✓fully proved
For every S5-consistent set \(\Gamma\) of modal formulas there are a Kripke model whose accessibility relation is an equivalence and whose worlds lie in the universe of the atoms, and a world of it at which every formula of \(\Gamma\) holds.
theorem satisfiable_S5 (hΓ : Consistent Axioms.S5 Γ) :
∃ (W : Type u) (M : KripkeModel W Atom) (w : W), Equivalence M.rel ∧
∀ psi ∈ Γ, M.Satisfies w psi
def Consistent (Λ Γ : Set (Formula Atom)) : Prop := ¬Deduces Λ Γ .bot
CSLibExt/Logics/Modal/Canonical.lean:60
def S5 : Set (Formula Atom) := Set.range Formula.axiomT ∪ Set.range Formula.axiomFive
CSLibExt/Logics/Modal/Hilbert.lean:100
structure KripkeModel (World : Type u) (Atom : Type v) where
/-- There is at least one world. -/
nonempty_world : Nonempty World
/-- The accessibility relation. -/
rel : World → World → Prop
/-- The atoms true at each world. -/
valuation : World → Atom → Prop
CSLibExt/Logics/Modal/Kripke.lean:83
Uses 17
TheoremStrong soundness and completeness of K#✓fully proved
For every set \(\Gamma\) of modal formulas and every modal formula \(\varphi\), \(\varphi\) is a local consequence of \(\Gamma\) in K if and only if \(\Gamma\) locally entails \(\varphi\) over all Kripke models: \(\varphi\) holds at every world of every Kripke model, with worlds in the universe of the atoms, at which every formula of \(\Gamma\) holds.
theorem deduces_K_iff : Deduces Axioms.K Γ phi ↔ LocallyEntails (fun _ ↦ True) Γ phi
inductive Deduces (Λ : Set (Formula Atom)) (Γ : Set (Formula Atom)) : Formula Atom → Prop
| hyp {phi : Formula Atom} : phi ∈ Γ → Deduces Λ Γ phi
| thm {phi : Formula Atom} : Derivable Λ phi → Deduces Λ Γ phi
| mp {phi psi : Formula Atom} : Deduces Λ Γ (.imp phi psi) → Deduces Λ Γ phi → Deduces Λ Γ psi
CSLibExt/Logics/Modal/Hilbert.lean:81
def K : Set (Formula Atom) := ∅
CSLibExt/Logics/Modal/Hilbert.lean:91
def LocallyEntails (C : ∀ {W : Type u}, KripkeModel W Atom → Prop) (Γ : Set (Formula Atom))
(phi : Formula Atom) : Prop :=
∀ (W : Type u) (M : KripkeModel W Atom) (w : W), C M → (∀ psi ∈ Γ, M.Satisfies w psi) →
M.Satisfies w phi
CSLibExt/Logics/Modal/Canonical.lean:281
TheoremStrong soundness and completeness of T#✓fully proved
For every set \(\Gamma\) of modal formulas and every modal formula \(\varphi\), \(\varphi\) is a local consequence of \(\Gamma\) in T if and only if \(\Gamma\) locally entails \(\varphi\) over reflexive Kripke models: \(\varphi\) holds at every world of every Kripke model with reflexive accessibility relation, with worlds in the universe of the atoms, at which every formula of \(\Gamma\) holds.
theorem deduces_T_iff :
Deduces Axioms.T Γ phi ↔ LocallyEntails (fun M ↦ ∀ w, M.rel w w) Γ phi
inductive Deduces (Λ : Set (Formula Atom)) (Γ : Set (Formula Atom)) : Formula Atom → Prop
| hyp {phi : Formula Atom} : phi ∈ Γ → Deduces Λ Γ phi
| thm {phi : Formula Atom} : Derivable Λ phi → Deduces Λ Γ phi
| mp {phi psi : Formula Atom} : Deduces Λ Γ (.imp phi psi) → Deduces Λ Γ phi → Deduces Λ Γ psi
CSLibExt/Logics/Modal/Hilbert.lean:81
def T : Set (Formula Atom) := Set.range Formula.axiomT
CSLibExt/Logics/Modal/Hilbert.lean:94
def LocallyEntails (C : ∀ {W : Type u}, KripkeModel W Atom → Prop) (Γ : Set (Formula Atom))
(phi : Formula Atom) : Prop :=
∀ (W : Type u) (M : KripkeModel W Atom) (w : W), C M → (∀ psi ∈ Γ, M.Satisfies w psi) →
M.Satisfies w phi
CSLibExt/Logics/Modal/Canonical.lean:281
TheoremStrong soundness and completeness of S4#✓fully proved
For every set \(\Gamma\) of modal formulas and every modal formula \(\varphi\), \(\varphi\) is a local consequence of \(\Gamma\) in S4 if and only if \(\Gamma\) locally entails \(\varphi\) over reflexive transitive Kripke models: \(\varphi\) holds at every world of every Kripke model with reflexive and transitive accessibility relation, with worlds in the universe of the atoms, at which every formula of \(\Gamma\) holds.
theorem deduces_S4_iff :
Deduces Axioms.S4 Γ phi ↔ LocallyEntails (fun M ↦ (∀ w, M.rel w w) ∧
∀ {a b c}, M.rel a b → M.rel b c → M.rel a c) Γ phi
inductive Deduces (Λ : Set (Formula Atom)) (Γ : Set (Formula Atom)) : Formula Atom → Prop
| hyp {phi : Formula Atom} : phi ∈ Γ → Deduces Λ Γ phi
| thm {phi : Formula Atom} : Derivable Λ phi → Deduces Λ Γ phi
| mp {phi psi : Formula Atom} : Deduces Λ Γ (.imp phi psi) → Deduces Λ Γ phi → Deduces Λ Γ psi
CSLibExt/Logics/Modal/Hilbert.lean:81
def S4 : Set (Formula Atom) := Set.range Formula.axiomT ∪ Set.range Formula.axiomFour
CSLibExt/Logics/Modal/Hilbert.lean:97
def LocallyEntails (C : ∀ {W : Type u}, KripkeModel W Atom → Prop) (Γ : Set (Formula Atom))
(phi : Formula Atom) : Prop :=
∀ (W : Type u) (M : KripkeModel W Atom) (w : W), C M → (∀ psi ∈ Γ, M.Satisfies w psi) →
M.Satisfies w phi
CSLibExt/Logics/Modal/Canonical.lean:281
TheoremStrong soundness and completeness of S5#✓fully proved
For every set \(\Gamma\) of modal formulas and every modal formula \(\varphi\), \(\varphi\) is a local consequence of \(\Gamma\) in S5 if and only if \(\Gamma\) locally entails \(\varphi\) over Kripke models whose accessibility relation is an equivalence relation: \(\varphi\) holds at every world of every such Kripke model, with worlds in the universe of the atoms, at which every formula of \(\Gamma\) holds.
theorem deduces_S5_iff :
Deduces Axioms.S5 Γ phi ↔ LocallyEntails (fun M ↦ Equivalence M.rel) Γ phi
inductive Deduces (Λ : Set (Formula Atom)) (Γ : Set (Formula Atom)) : Formula Atom → Prop
| hyp {phi : Formula Atom} : phi ∈ Γ → Deduces Λ Γ phi
| thm {phi : Formula Atom} : Derivable Λ phi → Deduces Λ Γ phi
| mp {phi psi : Formula Atom} : Deduces Λ Γ (.imp phi psi) → Deduces Λ Γ phi → Deduces Λ Γ psi
CSLibExt/Logics/Modal/Hilbert.lean:81
def S5 : Set (Formula Atom) := Set.range Formula.axiomT ∪ Set.range Formula.axiomFive
CSLibExt/Logics/Modal/Hilbert.lean:100
def LocallyEntails (C : ∀ {W : Type u}, KripkeModel W Atom → Prop) (Γ : Set (Formula Atom))
(phi : Formula Atom) : Prop :=
∀ (W : Type u) (M : KripkeModel W Atom) (w : W), C M → (∀ psi ∈ Γ, M.Satisfies w psi) →
M.Satisfies w phi
CSLibExt/Logics/Modal/Canonical.lean:281
DefinitionThe canonical model as a CSLib model#✓fully proved
For a set \(\Lambda\) of extra axioms, this is the unimodal model of CSLib's modal semantics whose worlds are the maximal consistent sets of \(K \oplus \Lambda\), in which \(M\) sees \(N\) iff \(\varphi \in N\) for every formula \(\varphi\) with \(\Box\varphi \in M\), and in which an atom \(p\) is true at \(M\) iff \(p \in M\).
No consistency hypothesis on \(K \oplus \Lambda\) is needed here, since a CSLib model may have no worlds.
def canonicalCslibModel : Logic.Modal.Unimodal.Model (CanonicalWorld Λ) Atom where
toFrame := Frame.ofRelation (τ := Logic.Modal.τUnimodal Atom) CanonicalWorld.rel
v M p := Formula.atom p ∈ M.1
def CanonicalWorld (Λ : Set (Formula Atom)) : Type u :=
{M : Set (Formula Atom) // Maximal (Consistent Λ) M}
CSLibExt/Logics/Modal/Canonical.lean:157
def CanonicalWorld.rel (M N : CanonicalWorld Λ) : Prop := ∀ phi, Formula.box phi ∈ M.1 → phi ∈ N.1
CSLibExt/Logics/Modal/Canonical.lean:161
inductive Formula (α : Type u) : Type u where
| atom : α → Formula α
| bot : Formula α
| imp : Formula α → Formula α → Formula α
| box : Formula α → Formula α
deriving DecidableEq, Repr
CSLibExt/Logics/Modal/Kripke.lean:34
Uses 4 · Used by 5
TheoremValidity in a class containing the canonical model gives derivability#✓fully proved
Let \(\Lambda\) be a set of extra axioms, and let \(S\) be a set of CSLib unimodal models whose worlds are the maximal consistent sets of \(K \oplus \Lambda\). If \(S\) contains the canonical model of \(K \oplus \Lambda\), viewed as a CSLib model, and a CSLib proposition \(\varphi\) holds at every world of every model in \(S\), then the translation of \(\varphi\) into the \(\bot\), \(\to\), \(\Box\) basis is a theorem of \(K \oplus \Lambda\).
theorem derivable_ofProposition_of_mem_logic
{S : Set (Logic.Modal.Unimodal.Model (CanonicalWorld Λ) Atom)}
(hphi : phi ∈ Logic.Modal.logic S)
(hS : canonicalCslibModel ∈ S) : Derivable Λ (Formula.ofProposition phi)
def CanonicalWorld (Λ : Set (Formula Atom)) : Type u :=
{M : Set (Formula Atom) // Maximal (Consistent Λ) M}
CSLibExt/Logics/Modal/Canonical.lean:157
def canonicalCslibModel : Logic.Modal.Unimodal.Model (CanonicalWorld Λ) Atom where
toFrame := Frame.ofRelation (τ := Logic.Modal.τUnimodal Atom) CanonicalWorld.rel
v M p := Formula.atom p ∈ M.1
CSLibExt/Logics/Modal/Canonical.lean:425
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
def Formula.ofProposition : Logic.Modal.Unimodal.Proposition Atom → Formula Atom
| .atom p => .atom p
| .false => .bot
| .not phi => (ofProposition phi).neg
| .or phi psi => (ofProposition phi).or (ofProposition psi)
| .triangle _ phis => (ofProposition (phis default)).dia
termination_by structural phi => phi
CSLibExt/Logics/Modal/CslibTranslation.lean:57
Uses 16 · Used by 4
TheoremCompleteness for CSLib's K#✓fully proved
Let \(\varphi\) be a proposition of CSLib's unimodal language over a type of atoms \(A\). Then the translation of \(\varphi\) into the \(\bot\), \(\to\), \(\Box\) basis is a theorem of K if and only if, for every type of worlds \(W\) in the universe of \(A\), \(\varphi\) belongs to CSLib's semantic logic K over \(W\) and \(A\), that is, \(\varphi\) holds at every world of every CSLib model with worlds \(W\).
theorem derivable_ofProposition_K_iff :
Derivable Axioms.K (Formula.ofProposition phi) ↔
∀ World : Type u, phi ∈ Logic.Modal.Unimodal.K World Atom
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
def K : Set (Formula Atom) := ∅
CSLibExt/Logics/Modal/Hilbert.lean:91
def Formula.ofProposition : Logic.Modal.Unimodal.Proposition Atom → Formula Atom
| .atom p => .atom p
| .false => .bot
| .not phi => (ofProposition phi).neg
| .or phi psi => (ofProposition phi).or (ofProposition psi)
| .triangle _ phis => (ofProposition (phis default)).dia
termination_by structural phi => phi
CSLibExt/Logics/Modal/CslibTranslation.lean:57
Uses 7
TheoremCompleteness for CSLib's T#✓fully proved
For a CSLib unimodal proposition \(\varphi\), the translation of \(\varphi\) into the \(\bot\), \(\to\), \(\Box\) basis is a theorem of the Hilbert system T if and only if, for every type of worlds in the universe of the atoms, \(\varphi\) belongs to CSLib's modal logic T over that type, that is, \(\varphi\) holds at every world of every CSLib model on that type whose accessibility relation is reflexive.
theorem derivable_ofProposition_T_iff :
Derivable Axioms.T (Formula.ofProposition phi) ↔
∀ World : Type u, phi ∈ Logic.Modal.Unimodal.T World Atom
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
def T : Set (Formula Atom) := Set.range Formula.axiomT
CSLibExt/Logics/Modal/Hilbert.lean:94
def Formula.ofProposition : Logic.Modal.Unimodal.Proposition Atom → Formula Atom
| .atom p => .atom p
| .false => .bot
| .not phi => (ofProposition phi).neg
| .or phi psi => (ofProposition phi).or (ofProposition psi)
| .triangle _ phis => (ofProposition (phis default)).dia
termination_by structural phi => phi
CSLibExt/Logics/Modal/CslibTranslation.lean:57
Uses 13
TheoremCompleteness for CSLib's S4#✓fully proved
Let \(\varphi\) be a proposition of CSLib's unimodal language over a type of atoms \(A\). Then the translation of \(\varphi\) into the \(\bot\), \(\to\), \(\Box\) basis is a theorem of S4 if and only if, for every type of worlds \(W\) in the universe of \(A\), \(\varphi\) belongs to CSLib's semantic logic S4 over \(W\) and \(A\), that is, \(\varphi\) holds at every world of every CSLib model with worlds \(W\) whose accessibility relation is reflexive and transitive.
theorem derivable_ofProposition_S4_iff :
Derivable Axioms.S4 (Formula.ofProposition phi) ↔
∀ World : Type u, phi ∈ Logic.Modal.Unimodal.S4 World Atom
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
def S4 : Set (Formula Atom) := Set.range Formula.axiomT ∪ Set.range Formula.axiomFour
CSLibExt/Logics/Modal/Hilbert.lean:97
def Formula.ofProposition : Logic.Modal.Unimodal.Proposition Atom → Formula Atom
| .atom p => .atom p
| .false => .bot
| .not phi => (ofProposition phi).neg
| .or phi psi => (ofProposition phi).or (ofProposition psi)
| .triangle _ phis => (ofProposition (phis default)).dia
termination_by structural phi => phi
CSLibExt/Logics/Modal/CslibTranslation.lean:57
Uses 14
TheoremCompleteness for CSLib's S5#✓fully proved
Let \(\varphi\) be a proposition of CSLib's unimodal language over a type of atoms \(A\). Then the translation of \(\varphi\) into the \(\bot\), \(\to\), \(\Box\) basis is a theorem of S5 if and only if, for every type of worlds \(W\) in the universe of \(A\), \(\varphi\) belongs to CSLib's semantic logic S5 over \(W\) and \(A\), that is, \(\varphi\) holds at every world of every CSLib model with worlds \(W\) whose accessibility relation \(R\) is reflexive, transitive and right Euclidean (\(w R u\) and \(w R v\) imply \(u R v\)).
theorem derivable_ofProposition_S5_iff :
Derivable Axioms.S5 (Formula.ofProposition phi) ↔
∀ World : Type u, phi ∈ Logic.Modal.Unimodal.S5 World Atom
inductive Derivable (Λ : Set (Formula Atom)) : Formula Atom → Prop
| ax1 (phi psi : Formula Atom) : Derivable Λ (.imp phi (.imp psi phi))
| ax2 (phi psi chi : Formula Atom) :
Derivable Λ (.imp (.imp phi (.imp psi chi)) (.imp (.imp phi psi) (.imp phi chi)))
| dne (phi : Formula Atom) : Derivable Λ (.imp phi.neg.neg phi)
| distrib (phi psi : Formula Atom) : Derivable Λ (Formula.axiomK phi psi)
| extra {phi : Formula Atom} : phi ∈ Λ → Derivable Λ phi
| mp {phi psi : Formula Atom} : Derivable Λ (.imp phi psi) → Derivable Λ phi → Derivable Λ psi
| nec {phi : Formula Atom} : Derivable Λ phi → Derivable Λ (.box phi)
CSLibExt/Logics/Modal/Hilbert.lean:69
def S5 : Set (Formula Atom) := Set.range Formula.axiomT ∪ Set.range Formula.axiomFive
CSLibExt/Logics/Modal/Hilbert.lean:100
def Formula.ofProposition : Logic.Modal.Unimodal.Proposition Atom → Formula Atom
| .atom p => .atom p
| .false => .bot
| .not phi => (ofProposition phi).neg
| .or phi psi => (ofProposition phi).or (ofProposition psi)
| .triangle _ phis => (ofProposition (phis default)).dia
termination_by structural phi => phi
CSLibExt/Logics/Modal/CslibTranslation.lean:57
Uses 18
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.