@@ -17,6 +17,11 @@ namespace SequentPart
17
17
18
18
def isFreshLabel (x : Label) (Γ : SequentPart) : Prop := (x ∉ Γ.fmls.map LabelledFormula.label) ∧ (∀ y, (x, y) ∉ Γ.rels) ∧ (∀ y, (y, x) ∉ Γ.rels)
19
19
20
+ /-
21
+ instance : Decidable (isFreshLabel Γ x) := by
22
+ simp [ isFreshLabel ] ;
23
+ -/
24
+
20
25
variable {x : Label} {Γ : SequentPart}
21
26
22
27
lemma not_include_labelledFml_of_isFreshLabel (h : Γ.isFreshLabel x) : ∀ φ, (x ∶ φ) ∉ Γ.fmls := by have := h.1 ; aesop;
@@ -50,24 +55,26 @@ end Sequent
50
55
51
56
52
57
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⟩ ⟹ Δ)
55
60
| 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⟩ ⟹ Δ)
59
64
| 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⟩)
62
67
| 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⟩ ⟹ Δ)
65
70
| boxR {Γ Δ : SequentPart} {x y} {φ} :
66
71
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⟩)
69
74
prefix :70 "⊢ᵍ " => Derivation
70
75
76
+ export Derivation (axA axBot impL impR boxL boxR)
77
+
71
78
abbrev Derivable (S : Sequent) : Prop := Nonempty (⊢ᵍ S)
72
79
prefix :70 "⊢ᵍ! " => Derivable
73
80
@@ -77,10 +84,10 @@ section
77
84
theorem soundness {S : Sequent} : ⊢ᵍ S → ∀ (M : Kripke.Model), ∀ (f : Assignment M), S.Satisfies M f := by
78
85
intro d;
79
86
induction d with
80
- | initA =>
87
+ | axA =>
81
88
rintro M f ⟨hΓ, hX⟩;
82
89
simp_all;
83
- | bot =>
90
+ | axBot =>
84
91
rintro M f ⟨hΓ, hX⟩;
85
92
simp at hΓ;
86
93
| @impL Γ Δ x φ ψ d₁ d₂ ih₁ ih₂ =>
@@ -197,12 +204,42 @@ theorem soundness {S : Sequent} : ⊢ᵍ S → ∀ (M : Kripke.Model), ∀ (f :
197
204
have : ¬(f a) ≺ (f b) := hΔ₁ a b h₁;
198
205
contradiction;
199
206
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
201
208
rintro ⟨d⟩ M f;
202
209
simpa [Sequent.Satisfies] using soundness d M f
203
210
204
211
end
205
212
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
+
206
243
end Gentzen
207
244
208
245
0 commit comments