Skip to content

Commit 98c4c4e

Browse files
authored
feat(Modal/Kripke): Kripke Completeness of Logics with McKinsey Axioms (#212)
1 parent ece59e5 commit 98c4c4e

14 files changed

Lines changed: 559 additions & 6 deletions

File tree

Foundation/Logic/HilbertStyle/Basic.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ def Conj_intro (Γ : List F) (b : (φ : F) → φ ∈ Γ → 𝓢 ⊢ φ) : 𝓢
327327
match Γ with
328328
| [] => verum
329329
| ψ :: Γ => K_intro (b ψ (by simp)) (Conj_intro Γ (fun ψ hq ↦ b ψ (by simp [hq])))
330+
lemma Conj!_intro {Γ : List F} (b : (φ : F) → φ ∈ Γ → 𝓢 ⊢! φ) : 𝓢 ⊢! Γ.conj := ⟨Conj_intro Γ λ φ hφ => (b φ hφ).some⟩
330331

331332
def right_Conj_intro (φ : F) (Γ : List F) (b : (ψ : F) → ψ ∈ Γ → 𝓢 ⊢ φ ➝ ψ) : 𝓢 ⊢ φ ➝ Γ.conj :=
332333
match Γ with

Foundation/Logic/HilbertStyle/Supplemental.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ lemma K!_assoc : 𝓢 ⊢! (φ ⋏ ψ) ⋏ χ ⭤ φ ⋏ (ψ ⋏ χ) := by
148148
. exact K!_intro hp hq;
149149
. exact hr;
150150

151+
omit [DecidableEq F] in lemma K!_assoc_mp (h : 𝓢 ⊢! (φ ⋏ ψ) ⋏ χ) : 𝓢 ⊢! φ ⋏ (ψ ⋏ χ) := C_of_E_mp! K!_assoc ⨀ h
152+
omit [DecidableEq F] in lemma K!_assoc_mpr (h : 𝓢 ⊢! φ ⋏ (ψ ⋏ χ)) : 𝓢 ⊢! (φ ⋏ ψ) ⋏ χ := C_of_E_mpr! K!_assoc ⨀ h
153+
151154
def K_replace_left (hc : 𝓢 ⊢ φ ⋏ ψ) (h : 𝓢 ⊢ φ ➝ χ) : 𝓢 ⊢ χ ⋏ ψ := K_intro (h ⨀ K_left hc) (K_right hc)
152155
omit [DecidableEq F] in lemma K!_replace_left (hc : 𝓢 ⊢! φ ⋏ ψ) (h : 𝓢 ⊢! φ ➝ χ) : 𝓢 ⊢! χ ⋏ ψ := ⟨K_replace_left hc.some h.some⟩
153156

Foundation/Modal/Entailment/Basic.lean

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,21 @@ instance (Γ : Context F 𝓢) : HasAxiomZ Γ := ⟨fun _ ↦ Context.of axiomZ
461461
end
462462

463463

464+
class HasAxiomM (𝓢 : S) where
465+
M (φ : F) : 𝓢 ⊢ Axioms.M φ
466+
467+
section
468+
469+
variable [HasAxiomM 𝓢]
470+
471+
def axiomM : 𝓢 ⊢ □◇φ ➝ ◇□φ := HasAxiomM.M _
472+
@[simp] lemma axiomM! : 𝓢 ⊢! □◇φ ➝ ◇□φ := ⟨axiomM⟩
473+
474+
variable [Entailment.Minimal 𝓢]
475+
instance (Γ : FiniteContext F 𝓢) : HasAxiomM Γ := ⟨fun _ ↦ FiniteContext.of axiomM⟩
476+
instance (Γ : Context F 𝓢) : HasAxiomM Γ := ⟨fun _ ↦ Context.of axiomM⟩
477+
478+
end
464479

465480
section
466481

@@ -530,9 +545,12 @@ instance [Entailment.Modal.Triv 𝓢] : Entailment.Modal.KTc 𝓢 where
530545

531546
protected class Ver extends Entailment.Modal.K 𝓢, HasAxiomVer 𝓢
532547

548+
protected class KM extends Entailment.Modal.K 𝓢, HasAxiomM 𝓢
549+
533550
protected class K4 extends Entailment.Modal.K 𝓢, HasAxiomFour 𝓢
534-
protected class K4Point2 extends Entailment.Modal.K 𝓢, HasAxiomFour 𝓢, HasAxiomWeakPoint2 𝓢
535-
protected class K4Point3 extends Entailment.Modal.K 𝓢, HasAxiomFour 𝓢, HasAxiomWeakPoint3 𝓢
551+
protected class K4Point1 extends Entailment.Modal.K4 𝓢, HasAxiomM 𝓢
552+
protected class K4Point2 extends Entailment.Modal.K4 𝓢, HasAxiomWeakPoint2 𝓢
553+
protected class K4Point3 extends Entailment.Modal.K4 𝓢, HasAxiomWeakPoint3 𝓢
536554
protected class KD4Point3Z extends Entailment.Modal.K 𝓢, HasAxiomD 𝓢, HasAxiomFour 𝓢, HasAxiomWeakPoint3 𝓢, HasAxiomZ 𝓢
537555

538556
protected class K5 extends Entailment.Modal.K 𝓢, HasAxiomFive 𝓢
@@ -541,6 +559,8 @@ protected class S4 extends Entailment.Modal.K 𝓢, HasAxiomT 𝓢, HasAxiomFour
541559
instance [Entailment.Modal.S4 𝓢] : Entailment.Modal.K4 𝓢 where
542560
instance [Entailment.Modal.S4 𝓢] : Entailment.Modal.KT 𝓢 where
543561

562+
protected class S4Point1 extends Entailment.Modal.S4 𝓢, HasAxiomM 𝓢
563+
544564
protected class S4Point2 extends Entailment.Modal.S4 𝓢, HasAxiomPoint2 𝓢
545565

546566
protected class S4Point3 extends Entailment.Modal.S4 𝓢, HasAxiomPoint3 𝓢

Foundation/Modal/Entailment/K.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ def diaK' (h : 𝓢 ⊢ φ ➝ ψ) : 𝓢 ⊢ ◇φ ➝ ◇ψ := by
161161
assumption;
162162
lemma diaK'! (h : 𝓢 ⊢! φ ➝ ψ) : 𝓢 ⊢! ◇φ ➝ ◇ψ := ⟨diaK' h.some⟩
163163

164+
lemma diaK''! (h₁ : 𝓢 ⊢! φ ➝ ψ) (h₂ : 𝓢 ⊢! ◇φ) : 𝓢 ⊢! ◇ψ := (diaK'! h₁) ⨀ h₂
165+
164166
lemma CMultidiaMultidia_of_C (h : 𝓢 ⊢! φ ➝ ψ) : 𝓢 ⊢! ◇^[n]φ ➝ ◇^[n]ψ := by
165167
induction n with
166168
| zero => simpa;
@@ -221,6 +223,15 @@ def boxDuality_mpr : 𝓢 ⊢ ∼(◇(∼φ)) ➝ □φ := K_right boxDuality
221223
def boxDuality_mpr' (h : 𝓢 ⊢ ∼(◇(∼φ))) : 𝓢 ⊢ □φ := boxDuality_mpr ⨀ h
222224
lemma boxDuality_mpr'! (h : 𝓢 ⊢! ∼(◇(∼φ))) : 𝓢 ⊢! □φ := ⟨boxDuality_mpr' h.some⟩
223225

226+
@[simp]
227+
lemma CNDiaBoxN! : 𝓢 ⊢! □(∼φ) ➝ ∼◇φ := by
228+
apply C!_trans boxDuality_mp!;
229+
apply contra!;
230+
apply diaK'!;
231+
simp;
232+
233+
lemma NDia_of_BoxN! (h : 𝓢 ⊢! □(∼φ)) : 𝓢 ⊢! ∼◇φ := CNDiaBoxN! ⨀ h
234+
224235
lemma multibox_duality'! : 𝓢 ⊢! □^[n]φ ↔ 𝓢 ⊢! ∼(◇^[n](∼φ)) := by
225236
constructor;
226237
. intro h; exact (K!_left multibox_duality!) ⨀ h;

Foundation/Modal/Entailment/K4.lean

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ open FiniteContext
77
variable {S F : Type*} [BasicModalLogicalConnective F] [DecidableEq F] [Entailment F S]
88
variable {𝓢 : S} [Entailment.Modal.K4 𝓢]
99

10+
@[simp]
11+
lemma diaFour! : 𝓢 ⊢! ◇◇φ ➝ ◇φ := by
12+
apply C!_replace diaDuality_mp! diaDuality_mpr!;
13+
apply contra!;
14+
suffices 𝓢 ⊢! □□(∼φ) ➝ □(∼◇φ) by apply C!_trans axiomFour! this;
15+
apply axiomK'!;
16+
apply nec!;
17+
simp;
18+
lemma diaFour'! (h : 𝓢 ⊢! ◇◇φ) : 𝓢 ⊢! ◇φ := diaFour! ⨀ h
19+
1020
def imply_BoxBoxdot_Box: 𝓢 ⊢ □⊡φ ➝ □φ := by
1121
exact C_trans distribute_box_and and₁
1222
@[simp] lemma imply_boxboxdot_box : 𝓢 ⊢! □⊡φ ➝ □φ := ⟨imply_BoxBoxdot_Box⟩

Foundation/Modal/Hilbert/WellKnown.lean

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,19 @@ instance [hZ : H.HasZ] : Entailment.HasAxiomZ H where
228228
. use (λ b => if hZ.p = b then φ else (.atom b));
229229
simp;
230230

231+
class HasM (H : Hilbert α) where
232+
p : α
233+
mem_M : Axioms.M (.atom p) ∈ H.axioms := by tauto;
234+
235+
instance [hM : H.HasM] : Entailment.HasAxiomM H where
236+
M φ := by
237+
apply maxm;
238+
use Axioms.M (.atom hM.p);
239+
constructor;
240+
. exact hM.mem_M;
241+
. use (λ b => if hM.p = b then φ else (.atom b));
242+
simp;
243+
231244
end
232245

233246
protected abbrev KT : Hilbert ℕ := ⟨{Axioms.K (.atom 0) (.atom 1), Axioms.T (.atom 0)}⟩
@@ -261,12 +274,31 @@ instance : (Hilbert.KTB).HasT where p := 0
261274
instance : (Hilbert.KTB).HasB where p := 0
262275
instance : Entailment.Modal.KTB (Hilbert.KTB) where
263276

277+
protected abbrev KM : Hilbert ℕ := ⟨{Axioms.K (.atom 0) (.atom 1), Axioms.M (.atom 0)}⟩
278+
instance : (Hilbert.KM).HasK where p := 0; q := 1;
279+
instance : (Hilbert.KM).HasM where p := 0
280+
instance : Entailment.Modal.KM (Hilbert.KM) where
281+
282+
instance K_weakerThan_KM : Hilbert.K ⪯ Hilbert.KM := weakerThan_of_dominate_axioms $ by simp;
264283

265284
protected abbrev K4 : Hilbert ℕ := ⟨{Axioms.K (.atom 0) (.atom 1), Axioms.Four (.atom 0)}⟩
266285
instance : (Hilbert.K4).HasK where p := 0; q := 1;
267286
instance : (Hilbert.K4).HasFour where p := 0
268287
instance : Entailment.Modal.K4 (Hilbert.K4) where
269288

289+
protected abbrev K4Point1 : Hilbert ℕ := ⟨{Axioms.K (.atom 0) (.atom 1), Axioms.Four (.atom 0), Axioms.M (.atom 0)}⟩
290+
instance : (Hilbert.K4Point1).HasK where p := 0; q := 1;
291+
instance : (Hilbert.K4Point1).HasFour where p := 0
292+
instance : (Hilbert.K4Point1).HasM where p := 0
293+
instance : Entailment.Modal.K4Point1 (Hilbert.K4Point1) where
294+
295+
instance K_weakerThan_K4Point1 : Hilbert.K ⪯ Hilbert.K4Point1 := weakerThan_of_dominate_axioms $ by simp;
296+
297+
noncomputable instance {H : Hilbert _} [Hilbert.K4Point1 ⪯ H] : Entailment.Modal.K4Point1 H where
298+
K _ _ := Entailment.WeakerThan.pbl (𝓢 := Hilbert.K4Point1) (by simp) |>.some
299+
Four _ := Entailment.WeakerThan.pbl (𝓢 := Hilbert.K4Point1) (by simp) |>.some
300+
M _ := Entailment.WeakerThan.pbl (𝓢 := Hilbert.K4Point1) (by simp) |>.some
301+
270302
protected abbrev K4Point2 : Hilbert ℕ := ⟨{Axioms.K (.atom 0) (.atom 1), Axioms.Four (.atom 0), Axioms.WeakPoint2 (.atom 0) (.atom 1)}⟩
271303
instance : (Hilbert.K4Point2).HasK where p := 0; q := 1;
272304
instance : (Hilbert.K4Point2).HasFour where p := 0
@@ -335,7 +367,16 @@ instance : (Hilbert.S4).HasT where p := 0
335367
instance : (Hilbert.S4).HasFour where p := 0
336368
instance : Entailment.Modal.S4 (Hilbert.S4) where
337369

338-
lemma K4_weakerThan_S4 : Hilbert.K4 ⪯ Hilbert.S4 := weakerThan_of_dominate_axioms $ by simp;
370+
instance K4_weakerThan_S4 : Hilbert.K4 ⪯ Hilbert.S4 := weakerThan_of_dominate_axioms $ by simp;
371+
372+
protected abbrev S4Point1 : Hilbert ℕ := ⟨{Axioms.K (.atom 0) (.atom 1), Axioms.T (.atom 0), Axioms.Four (.atom 0), Axioms.M (.atom 0)}⟩
373+
instance : (Hilbert.S4Point1).HasK where p := 0; q := 1;
374+
instance : (Hilbert.S4Point1).HasT where p := 0
375+
instance : (Hilbert.S4Point1).HasFour where p := 0
376+
instance : (Hilbert.S4Point1).HasM where p := 0
377+
instance : Entailment.Modal.S4Point1 (Hilbert.S4Point1) where
378+
379+
instance K4Point1_weakerThan_S4Point1 : Hilbert.K4Point1 ⪯ Hilbert.S4Point1 := weakerThan_of_dominate_axioms $ by simp;
339380

340381
protected abbrev S4Point2 : Hilbert ℕ := ⟨{Axioms.K (.atom 0) (.atom 1), Axioms.T (.atom 0), Axioms.Four (.atom 0), Axioms.Point2 (.atom 0)}⟩
341382
instance : (Hilbert.S4Point2).HasK where p := 0; q := 1;
@@ -421,7 +462,6 @@ instance : (Hilbert.KTc).HasK where p := 0; q := 1;
421462
instance : (Hilbert.KTc).HasTc where p := 0
422463
instance : Entailment.Modal.KTc (Hilbert.KTc) where
423464

424-
425465
protected abbrev KD4Point3Z : Hilbert ℕ := ⟨{Axioms.K (.atom 0) (.atom 1), Axioms.D (.atom 0), Axioms.Four (.atom 0), Axioms.WeakPoint3 (.atom 0) (.atom 1), Axioms.Z (.atom 0)}⟩
426466
instance : (Hilbert.KD4Point3Z).HasK where p := 0; q := 1;
427467
instance : (Hilbert.KD4Point3Z).HasD where p := 0

Foundation/Modal/Kripke/AxiomGeach.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ instance [Entailment.HasAxiomGeach g 𝓢] : IsGeachean g _ (canonicalFrame 𝓢
222222
exact hu.2 hφ;
223223
224224

225-
instance [Entailment.HasAxiomFour 𝓢] : IsTrans _ (canonicalFrame 𝓢).Rel := inferInstance
225+
instance isTrans [Entailment.HasAxiomFour 𝓢] : IsTrans _ (canonicalFrame 𝓢).Rel := inferInstance
226226
instance [Entailment.HasAxiomT 𝓢] : IsRefl _ (canonicalFrame 𝓢).Rel := inferInstance
227227
instance [Entailment.HasAxiomFive 𝓢] : IsEuclidean _ (canonicalFrame 𝓢).Rel := inferInstance
228228
instance [Entailment.HasAxiomD 𝓢] : IsSerial _ (canonicalFrame 𝓢).Rel := inferInstance

0 commit comments

Comments
 (0)