Skip to content

Commit 2d6c4ef

Browse files
committed
Gentzen axF and axiomK wip
1 parent 91536fe commit 2d6c4ef

File tree

1 file changed

+51
-14
lines changed

1 file changed

+51
-14
lines changed

ModalTableau/Gentzen/Basic.lean

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ namespace SequentPart
1717

1818
def isFreshLabel (x : Label) (Γ : SequentPart) : Prop := (x ∉ Γ.fmls.map LabelledFormula.label) ∧ (∀ y, (x, y) ∉ Γ.rels) ∧ (∀ y, (y, x) ∉ Γ.rels)
1919

20+
/-
21+
instance : Decidable (isFreshLabel Γ x) := by
22+
simp [isFreshLabel];
23+
-/
24+
2025
variable {x : Label} {Γ : SequentPart}
2126

2227
lemma not_include_labelledFml_of_isFreshLabel (h : Γ.isFreshLabel x) : ∀ φ, (x ∶ φ) ∉ Γ.fmls := by have := h.1; aesop;
@@ -50,24 +55,26 @@ end Sequent
5055

5156

5257
inductive Derivation : Sequent → Type _
53-
| initA {Γ Δ : SequentPart} {x} {a} : Derivation (⟨insert (x ∶ atom a) Γ.fmls, Γ.rels⟩ ⟹ ⟨insert (x ∶ atom a) Δ.fmls, Δ.rels⟩)
54-
| bot {Γ Δ : SequentPart} {x} : Derivation (⟨insert (x ∶ ⊥) Γ.fmls, Γ.rels⟩ ⟹ Δ)
58+
| axA {Γ Δ : SequentPart} {x} {a} : Derivation (⟨(x ∶ atom a) ::ₘ Γ.fmls, Γ.rels⟩ ⟹ ⟨(x ∶ atom a) ::ₘ Δ.fmls, Δ.rels⟩)
59+
| axBot {Γ Δ : SequentPart} {x} : Derivation (⟨(x ∶ ⊥) ::ₘ Γ.fmls, Γ.rels⟩ ⟹ Δ)
5560
| impL {Γ Δ : SequentPart} {x} {φ ψ} :
56-
Derivation (Γ ⟹ ⟨insert (x ∶ φ) Δ.fmls, Δ.rels⟩) →
57-
Derivation (⟨insert (x ∶ ψ) Γ.fmls, Γ.rels⟩ ⟹ Δ) →
58-
Derivation (⟨insert (x ∶ φ ➝ ψ) Γ.fmls, Γ.rels⟩ ⟹ Δ)
61+
Derivation (Γ ⟹ ⟨(x ∶ φ) ::ₘ Δ.fmls, Δ.rels⟩) →
62+
Derivation (⟨(x ∶ ψ) ::ₘ Γ.fmls, Γ.rels⟩ ⟹ Δ) →
63+
Derivation (⟨(x ∶ φ ➝ ψ) ::ₘ Γ.fmls, Γ.rels⟩ ⟹ Δ)
5964
| impR {Γ Δ : SequentPart} {x} {φ ψ} :
60-
Derivation (⟨insert (x ∶ φ) Γ.fmls, Γ.rels⟩ ⟹ ⟨insert (x ∶ ψ) Δ.fmls, Δ.rels⟩) →
61-
Derivation (Γ ⟹ ⟨insert (x ∶ φ ➝ ψ) Δ.fmls, Δ.rels⟩)
65+
Derivation (⟨(x ∶ φ) ::ₘ Γ.fmls, Γ.rels⟩ ⟹ ⟨(x ∶ ψ) ::ₘ Δ.fmls, Δ.rels⟩) →
66+
Derivation (Γ ⟹ ⟨(x ∶ φ ➝ ψ) ::ₘ Δ.fmls, Δ.rels⟩)
6267
| boxL {Γ Δ : SequentPart} {x y} {φ} :
63-
Derivation (⟨insert (x ∶ □φ) $ insert (y ∶ φ) Γ.fmls, insert (x, y) Γ.rels⟩ ⟹ Δ) →
64-
Derivation (⟨insert (x ∶ □φ) Γ.fmls, insert (x, y) Γ.rels⟩ ⟹ Δ)
68+
Derivation (⟨(x ∶ □φ) ::ₘ (y ∶ φ) ::ₘ Γ.fmls, (x, y) ::ₘ Γ.rels⟩ ⟹ Δ) →
69+
Derivation (⟨(x ∶ □φ) ::ₘ Γ.fmls, (x, y) ::ₘ Γ.rels⟩ ⟹ Δ)
6570
| boxR {Γ Δ : SequentPart} {x y} {φ} :
6671
x ≠ y → Γ.isFreshLabel y → Δ.isFreshLabel y →
67-
Derivation (⟨Γ.fmls, insert (x, y) Γ.rels⟩ ⟹ ⟨insert (y ∶ φ) Δ.fmls, Δ.rels⟩) →
68-
Derivation (Γ ⟹ ⟨insert (x ∶ □φ) Δ.fmls, Δ.rels⟩)
72+
Derivation (⟨Γ.fmls, (x, y) ::ₘ Γ.rels⟩ ⟹ ⟨(y ∶ φ) ::ₘ Δ.fmls, Δ.rels⟩) →
73+
Derivation (Γ ⟹ ⟨(x ∶ □φ) ::ₘ Δ.fmls, Δ.rels⟩)
6974
prefix:70 "⊢ᵍ " => Derivation
7075

76+
export Derivation (axA axBot impL impR boxL boxR)
77+
7178
abbrev Derivable (S : Sequent) : Prop := Nonempty (⊢ᵍ S)
7279
prefix:70 "⊢ᵍ! " => Derivable
7380

@@ -77,10 +84,10 @@ section
7784
theorem soundness {S : Sequent} : ⊢ᵍ S → ∀ (M : Kripke.Model), ∀ (f : Assignment M), S.Satisfies M f := by
7885
intro d;
7986
induction d with
80-
| initA =>
87+
| axA =>
8188
rintro M f ⟨hΓ, hX⟩;
8289
simp_all;
83-
| bot =>
90+
| axBot =>
8491
rintro M f ⟨hΓ, hX⟩;
8592
simp at hΓ;
8693
| @impL Γ Δ x φ ψ d₁ d₂ ih₁ ih₂ =>
@@ -197,12 +204,42 @@ theorem soundness {S : Sequent} : ⊢ᵍ S → ∀ (M : Kripke.Model), ∀ (f :
197204
have : ¬(f a) ≺ (f b) := hΔ₁ a b h₁;
198205
contradiction;
199206

200-
theorem soundness_fml : ⊢ᵍ! ⟨⟨{}, {}⟩, ⟨{default ∶ φ}, {}⟩⟩ → ∀ (M : Kripke.Model), ∀ (f : Assignment M), f default ⊧ φ := by
207+
theorem soundness_fml : ⊢ᵍ! ⟨⟨∅, ∅⟩, ⟨{0 ∶ φ}, ⟩⟩ → ∀ (M : Kripke.Model), ∀ (f : Assignment M), f 0 ⊧ φ := by
201208
rintro ⟨d⟩ M f;
202209
simpa [Sequent.Satisfies] using soundness d M f
203210

204211
end
205212

213+
def axF {Γ Δ : SequentPart} {x} {φ} : ⊢ᵍ (⟨(x ∶ φ) ::ₘ Γ.fmls, Γ.rels⟩ ⟹ ⟨(x ∶ φ) ::ₘ Δ.fmls, Δ.rels⟩) := by
214+
induction φ using Formula.rec' generalizing Γ Δ x with
215+
| hatom a => exact axA
216+
| hfalsum => exact axBot
217+
| himp φ ψ ihφ ihψ =>
218+
apply impR;
219+
simpa [Multiset.cons_swap] using impL ihφ ihψ;
220+
| hbox φ ih =>
221+
letI y := x + 1;
222+
apply boxR (y := y) (by simp [y]) (by sorry) (by sorry);
223+
apply boxL;
224+
simpa [Multiset.cons_swap] using ih (Γ := ⟨(x ∶ □φ) ::ₘ Γ.fmls, _ ::ₘ Γ.rels⟩);
225+
226+
def axiomK : ⊢ᵍ ⟨⟨∅, ∅⟩, ⟨{0 ∶ □(φ ➝ ψ) ➝ □φ ➝ □ψ}, ∅⟩⟩ := by
227+
apply impR (Δ := ⟨_, _⟩);
228+
apply impR;
229+
apply boxR (y := 1) (by simp) (by simp [SequentPart.isFreshLabel]) (by simp [SequentPart.isFreshLabel]);
230+
suffices ⊢ᵍ (⟨(0 ∶ □φ) ::ₘ {0 ∶ □(φ ➝ ψ)}, {(0, 1)}⟩ ⟹ ⟨{1 ∶ ψ}, ∅⟩) by simpa;
231+
apply boxL (Γ := ⟨_, _⟩);
232+
suffices ⊢ᵍ (⟨(0 ∶ □(φ ➝ ψ)) ::ₘ (1 ∶ φ) ::ₘ {(0 ∶ □φ)}, {(0, 1)}⟩ ⟹ ⟨{1 ∶ ψ}, ∅⟩) by
233+
have e : (0 ∶ □(φ ➝ ψ)) ::ₘ (1 ∶ φ) ::ₘ {0 ∶ □φ} = (0 ∶ □φ) ::ₘ (1 ∶ φ) ::ₘ {0 ∶ □(φ ➝ ψ)} := by sorry;
234+
simpa [e];
235+
apply boxL (x := 0) (φ := φ ➝ ψ) (Γ := ⟨{1 ∶ φ, 0 ∶ □φ}, _⟩);
236+
suffices ⊢ᵍ (⟨(1 ∶ φ ➝ ψ) ::ₘ {1 ∶ φ, 0 ∶ □φ, 0 ∶ □(φ ➝ ψ)}, {(0, 1)}⟩ ⟹ ⟨{1 ∶ ψ}, ∅⟩) by
237+
have e : (0 ∶ □(φ ➝ ψ)) ::ₘ (1 ∶ φ ➝ ψ) ::ₘ (1 ∶ φ) ::ₘ {0 ∶ □φ} = (1 ∶ φ ➝ ψ) ::ₘ {1 ∶ φ, 0 ∶ □φ, 0 ∶ □(φ ➝ ψ)} := by sorry;
238+
simpa [e];
239+
apply impL (Γ := ⟨_, _⟩);
240+
. simpa using axF (Γ := ⟨_, _⟩) (Δ := ⟨_, _⟩);
241+
. simpa using axF (Γ := ⟨_, _⟩) (Δ := ⟨_, _⟩);
242+
206243
end Gentzen
207244

208245

0 commit comments

Comments
 (0)