Skip to content

Commit 196205b

Browse files
committed
refactor and more generalized result
1 parent 61bf430 commit 196205b

5 files changed

Lines changed: 136 additions & 74 deletions

File tree

VeryWeakSubintuitionistic/Modal/Proof/N.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ lemma andIntroRule (hA : Λ ⊢ᴺ A) (hB : Λ ⊢ᴺ B) : Λ ⊢ᴺ A ⋏ B :=
8080

8181
@[simp, grind .] lemma verum : Λ ⊢ᴺ ⊤ := by simp;
8282

83+
lemma ofSubsetAxm (h : Λ₁ ⊆ Λ₂) : Λ₁ ⊢ᴺ A → Λ₂ ⊢ᴺ A := λ ⟨h₁⟩ => ⟨ProofN.ofSubsetAxm h h₁⟩
84+
8385
@[grind =>] lemma dneRule (hA : Λ ⊢ᴺ ∼∼A) : Λ ⊢ᴺ A := mdp dne hA
8486

8587
lemma impTransRule (hAB : Λ ⊢ᴺ A 🡒 B) (hBC : Λ ⊢ᴺ B 🡒 C) : Λ ⊢ᴺ A 🡒 C := by

VeryWeakSubintuitionistic/ModalCompanion/Basic.lean

Lines changed: 111 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def modalToPropModel (MM : Modal.FMT.Model κ α) : FMTSemantics.Model (κ ⊕ U
7979
| .inl k => MM.Val a k
8080
| .inr () => True
8181

82+
/-- Lemma 6.9 -/
8283
theorem modalToProp_truthlemma {x : MM.World} :
8384
Modal.FMT.Forced (M := MM) x (A.corsi) ↔ FMTSemantics.Forces (M := modalToPropModel MM) (.inl x) A := by
8485
induction A generalizing x with
@@ -132,49 +133,10 @@ end ModalToProp
132133

133134

134135

135-
namespace Formula
136-
137-
@[grind]
138-
def IsNegation : Formula α → Prop
139-
| ∼_ => True
140-
| _ => False
141-
142-
instance : DecidablePred (IsNegation : Formula α → Prop) := by
143-
intro A;
144-
match A with
145-
| ∼_ => exact isTrue trivial
146-
| #_ | ⊥ | _ ⋏ _ | _ ⋎ _
147-
| _ 🡒 #_ | _ 🡒 (_ ⋏ _) | _ 🡒 (_ 🡒 _) | _ 🡒 (_ ⋎ _)
148-
=> exact isFalse (by grind);
149-
150-
end Formula
151136

152137

153138
variable {α : Type u} [DecidableEq α]
154139

155-
namespace Formula
156-
157-
def cases_neg {P : Formula α → Prop}
158-
(falsum : P (⊥ : Formula α))
159-
(atom : ∀ a, P (#a))
160-
(and : ∀ A B, P (A ⋏ B))
161-
(or : ∀ A B, P (A ⋎ B))
162-
(imp : ∀ A B, B ≠ (⊥ : Formula α) → P (A 🡒 B))
163-
(neg : ∀ A, P (∼A))
164-
: ∀ A, P A := by
165-
intro A;
166-
match A with
167-
| ⊥ | #_ | _ ⋏ _ | _ ⋎ _
168-
| _ 🡒 ⊥ | _ 🡒 #_
169-
| _ 🡒 (_ ⋏ _) | _ 🡒 (_ ⋎ _) | _ 🡒 (_ 🡒 _)
170-
=> grind;
171-
172-
omit [DecidableEq α] in
173-
@[grind →]
174-
lemma isClosed_of_isCNA {A : Formula α} : A.IsClosedNegativeAxiom → A.Closed := by grind;
175-
176-
end Formula
177-
178140
namespace Axioms
179141

180142
def star (Λ : Axioms α) := Λ.filterMap (λ A => match A with | ∼B => some (∼(B.corsi)) | _ => none) $ by
@@ -193,51 +155,127 @@ lemma mem_star_of_mem_neg {B : Formula α} (hB : ∼B ∈ Λ) : ∼(B.corsi) ∈
193155
end Axioms
194156

195157

158+
namespace Modal.Formula
159+
160+
@[grind]
161+
def negRepeat : ℕ → Formula α → Formula α
162+
| 0 , A => A
163+
| n + 1, A => ∼(negRepeat n A)
164+
165+
notation "∼^[" n "]" A => negRepeat n A
166+
167+
lemma negRepeat_succ_rw {n : ℕ} : (∼^[2 * (n + 1)]A) = ∼(∼^[2 * n](∼A)) := by
168+
induction n <;> simp_all [negRepeat];
169+
170+
end Modal.Formula
196171

197-
theorem modal_companion
198-
{Λ : Axioms α} (hX : ∀ B ∈ Λ, B.IsClosedNegativeAxiom)
199-
[Fact ((Λ.star) ⊬ᴺ ⊥)] [Axioms.DisjunctiveVF Λ]
200-
: (Λ ⊢ⱽ A) ↔ ((Λ.star) ⊢ᴺ A.corsi) := by
201-
have : Fact (∀ B ∈ Λ, B.IsClosedNegativeAxiom) := ⟨hX⟩;
172+
173+
namespace Formula
174+
175+
variable {C : Formula α}
176+
177+
omit [DecidableEq α] in
178+
@[simp, grind .]
179+
lemma top_neq_corsi : (⊤ : Modal.Formula α) ≠ C.corsi := by induction C <;> grind [Formula.corsi];
180+
181+
omit [DecidableEq α] in
182+
@[simp, grind .]
183+
lemma double_negRepeat_top_neq_corsi {n} {C : Formula α} : (∼^[2 * n]⊤) ≠ C.corsi := by
184+
match n with
185+
| 0 => grind [top_neq_corsi];
186+
| n + 1 => induction C <;> grind [Formula.corsi, double_negRepeat_top_neq_corsi (n := n)];
187+
188+
omit [DecidableEq α] in
189+
@[simp, grind .]
190+
lemma double_negRepeat_bot_neq_corsi_imp {n} {C D : Formula α} : (∼^[2 * n]⊥) ≠ (C.corsi 🡒 D.corsi) := by
191+
cases n <;> grind [Modal.Formula.negRepeat_succ_rw, Modal.Formula.negRepeat];
192+
193+
end Formula
194+
195+
196+
namespace Modal.FMT
197+
198+
omit [DecidableEq α] in
199+
@[grind =]
200+
lemma notForces_double_negRepeat {M : Model κ α} {x : M.World} : (x ⊩ (∼^[2 * n]A)) ↔ (x ⊩ A) := by
201+
induction n with
202+
| zero => grind;
203+
| succ n ih =>
204+
apply Iff.trans ?_ ih;
205+
simp [Modal.Formula.negRepeat];
206+
grind;
207+
208+
end Modal.FMT
209+
210+
211+
section
212+
213+
variable {Λ : Axioms α} {A : Formula α}
214+
215+
lemma provableN_star_of_provableVF
216+
[Fact (∀ B ∈ Λ, B.IsClosedNegativeAxiom)] [Fact ((Λ.star) ⊬ᴺ ⊥)]
217+
: (Λ ⊢ⱽ A) → (Λ.star ⊢ᴺ A.corsi) := by
218+
have hCNA : ∀ B ∈ Λ, B.IsClosedNegativeAxiom := Fact.out;
219+
intro h;
220+
apply Modal.FMT.finite_model_property;
221+
intro κ _ MM hValid x;
222+
apply (modalToProp_truthlemma).mpr;
223+
apply FMTSemantics.soundness_model h (modalToPropModel MM);
224+
intro B hB;
225+
obtain ⟨C, rfl, hCClosed, _⟩ := Formula.iff_isCNA.mp (Fact.elim (p := ∀ B ∈ Λ, B.IsClosedNegativeAxiom) inferInstance B hB);
226+
intro y z Ryz hzC;
227+
have hValC : ∀ y, ¬ Modal.FMT.Forced (M := MM) y (C.corsi) := by
228+
intro y';
229+
have hMem : ∼(C.corsi) ∈ Λ.star := Axioms.mem_star_of_mem_neg hB;
230+
exact hValid _ hMem y';
231+
exact modalToProp_notForces_closed_of_neg hCClosed hValC hzC;
232+
233+
lemma provableN_star_repeatNeg_of_provableN_star {N : Finset ℕ} : Λ.star ⊢ᴺ A.corsi → (Λ.star ∪ N.image (λ n => ∼□∼^[2 * n]⊥)) ⊢ᴺ A.corsi := by
234+
apply Modal.ProvableN.ofSubsetAxm;
235+
grind;
236+
237+
lemma provableVF_of_provableN_star_repeatNeg
238+
{N : Finset ℕ}
239+
[Fact (∀ B ∈ Λ, B.IsClosedNegativeAxiom)]
240+
[Fact (Λ.star ∪ Finset.image (λ n ↦ ∼□∼^[2 * n]⊥) N ⊬ᴺ ⊥)]
241+
: (Λ.star ∪ N.image (λ n => ∼□(∼^[2 * n]⊥))) ⊢ᴺ A.corsi → Λ ⊢ⱽ A := by
242+
have hCNA : ∀ B ∈ Λ, B.IsClosedNegativeAxiom := Fact.out;
243+
contrapose;
244+
intro h;
245+
replace h := FMTSemantics.result_frame (Λ := Λ) (by grind) |>.not.out 0 1 |>.mp h;
246+
push Not at h;
247+
obtain ⟨_, PF, hPF, h⟩ := h;
248+
obtain ⟨PV, x, hx⟩ := FMTSemantics.iff_notFrameValid_exists_model_world.mp h;
249+
apply Modal.FMT.result_model.not.out 0 1 |>.mpr;
250+
push Not;
251+
use ‹_›, propToModalModel ⟨PF, PV⟩;
202252
constructor;
203-
· intro h;
204-
apply Modal.FMT.finite_model_property;
205-
intro κ _ MM hValid x;
206-
apply (modalToProp_truthlemma).mpr;
207-
apply FMTSemantics.soundness_model h (modalToPropModel MM);
208-
intro B hB;
209-
obtain ⟨C, rfl, hCClosed, _⟩ := Formula.iff_isCNA.mp (hX B hB);
210-
intro y z Ryz hzC;
211-
have hValC : ∀ y, ¬ Modal.FMT.Forced (M := MM) y (C.corsi) := by
212-
intro y';
213-
have hMem : ∼(C.corsi) ∈ Λ.star := Axioms.mem_star_of_mem_neg hB;
214-
exact hValid _ hMem y';
215-
exact modalToProp_notForces_closed_of_neg hCClosed hValC hzC;
216-
· contrapose;
217-
intro h;
218-
replace h := FMTSemantics.result_frame (Λ := Λ) (by grind) |>.not.out 0 1 |>.mp h;
219-
push Not at h;
220-
obtain ⟨_, PF, hPF, h⟩ := h;
221-
obtain ⟨PV, x, hx⟩ := FMTSemantics.iff_notFrameValid_exists_model_world.mp h;
222-
apply Modal.FMT.result_model.not.out 0 1 |>.mpr;
223-
push Not;
224-
use ‹_›, propToModalModel ⟨PF, PV⟩;
225-
constructor;
226-
. intro B hB;
227-
obtain ⟨C, hC₁, hC₂⟩ := Finset.mem_filterMap _ |>.mp hB;
253+
. intro B hB;
254+
simp only [Finset.mem_union, Finset.mem_image] at hB;
255+
rcases hB with (hB | ⟨n, hN, rfl⟩);
256+
. obtain ⟨C, hC₁, hC₂⟩ := Finset.mem_filterMap _ |>.mp hB;
228257
split at hC₂;
229258
. simp only [Option.some.injEq] at hC₂;
230259
subst hC₂;
231260
rename_i C;
232-
obtain ⟨D, _, _, _⟩ := Formula.iff_isCNA.mp $ hX (∼C) ‹_›;
261+
obtain ⟨D, _, _, _⟩ := Formula.iff_isCNA.mp $ hCNA (∼C) ‹_›;
233262
intro y;
234263
apply Modal.FMT.forces_not.mpr;
235264
apply propToModal_truthlemma.not.mp;
236265
exact FMTSemantics.iff_FrameForces_Forces_of_closed (by grind) |>.not.mp
237266
$ FMTSemantics.iff_FrameValid_neg_of_closed (by grind) |>.mp (hPF _ hC₁) y;
238267
. contradiction;
239-
. replace hx := propToModal_truthlemma.not.mp hx;
240-
apply Modal.FMT.iff_Valid_exists_world_not_Forces.mpr;
241-
use x;
268+
. intro y;
269+
apply Modal.FMT.notForces_box.mpr;
270+
use y;
271+
constructor;
272+
. intro C D;
273+
grind;
274+
. grind;
275+
. replace hx := propToModal_truthlemma.not.mp hx;
276+
apply Modal.FMT.iff_Valid_exists_world_not_Forces.mpr;
277+
use x;
278+
279+
end
242280

243281
end

VeryWeakSubintuitionistic/Propositional/FMT/Completeness.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ theorem result_frame (h_closed : ∀ B ∈ Λ, B.Closed) : List.TFAE [
406406
tfae_have 31 := finite_frame_property (by grind);
407407
tfae_finish;
408408

409+
410+
411+
409412
theorem VF_completeness : List.TFAE [
410413
∅ ⊢ⱽ A,
411414
∀ {κ : Type u}, ∀ F : Frame κ α, F ⊨ A,

VeryWeakSubintuitionistic/Propositional/Slash.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ lemma iff_isCNA : A.IsClosedNegativeAxiom ↔ (∃ B, A = ∼B ∧ B.Closed ∧
4646
| #a | ⊥ | A ⋎ B | A ⋏ B => simp [IsClosedNegativeAxiom]
4747
| A 🡒 B => dsimp [IsClosedNegativeAxiom]; grind;
4848

49+
@[grind →]
50+
lemma isClosed_of_isCNA {A : Formula α} : A.IsClosedNegativeAxiom → A.Closed := by grind;
51+
4952
end Formula
5053

5154

VeryWeakSubintuitionistic/Propositional/Syntax.lean

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ variable {α : Type*}
88

99
inductive Formula (α : Type u) : Type u
1010
| atom : α → Formula α
11-
| bot : Formula α
11+
| bot : Formula α
1212
| and : Formula α → Formula α → Formula α
1313
| or : Formula α → Formula α → Formula α
1414
| imp : Formula α → Formula α → Formula α
@@ -72,6 +72,22 @@ def Closed : Formula α → Prop
7272
| A ⋏ B
7373
| A 🡒 B => A.Closed ∧ B.Closed
7474

75+
76+
def cases_neg {P : Formula α → Prop}
77+
(bot : P (⊥ : Formula α))
78+
(atom : ∀ a, P (#a))
79+
(and : ∀ A B, P (A ⋏ B))
80+
(or : ∀ A B, P (A ⋎ B))
81+
(imp : ∀ A B, B ≠ (⊥ : Formula α) → P (A 🡒 B))
82+
(neg : ∀ A, P (∼A))
83+
: ∀ A, P A := by
84+
intro A;
85+
match A with
86+
| ⊥ | #_ | _ ⋏ _ | _ ⋎ _
87+
| _ 🡒 ⊥ | _ 🡒 #_
88+
| _ 🡒 (_ ⋏ _) | _ 🡒 (_ ⋎ _) | _ 🡒 (_ 🡒 _)
89+
=> grind;
90+
7591
end Formula
7692

7793
end

0 commit comments

Comments
 (0)