Skip to content

Commit 4f28543

Browse files
SnO2WMaNclaude
andcommitted
Define Model.toTail as RootedModel and fill its sorries
- Change toTail return type from Model to RootedModel (κ ⊕ ℕ∞) α, folding the root (.inr ⊤) into the structure; fix r : M.World (was broken M.root) - root field: .inr ⊤ relates to every other world via lt_top_iff_ne_top - IsTrans / Std.Irrefl instances for the tail relation - toTail.tail_isChain via exact_mod_cast Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b753e66 commit 4f28543

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

SeqPL/Kripke/Tail.lean

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module
22

33
public import SeqPL.Kripke.RootExtension
4-
public import Mathlib
4+
public import Mathlib.Data.ENat.Basic
55

66
@[expose]
77
public section
@@ -10,7 +10,7 @@ variable [Nonempty κ] {M : Model κ α} {n : ℕ+} {A B : Formula α} {Γ Γ'
1010

1111
namespace Model
1212

13-
abbrev toTail (M : Model κ α) (r : M.root) : Model (κ ⊕ ℕ∞) α where
13+
abbrev toTail (M : Model κ α) (r : M.World) : RootedModel (κ ⊕ ℕ∞) α where
1414
Rel' x y :=
1515
match x, y with
1616
| .inl x, .inl y => M.Rel x y
@@ -21,19 +21,18 @@ abbrev toTail (M : Model κ α) (r : M.root) : Model (κ ⊕ ℕ∞) α where
2121
match x with
2222
| .inl x => M.Val x a
2323
| .inr _ => M.Val r a
24+
root := ⟨.inr ⊤, by
25+
intro x hx;
26+
match x with
27+
| .inl x => simp [Model.Rel];
28+
| .inr i =>
29+
simp only [Model.Rel];
30+
exact lt_top_iff_ne_top.mpr (by simpa using hx);
31+
2432

2533
namespace toTail
2634

27-
variable {r : M.root}
28-
29-
protected abbrev root (M : Model κ α) (r : M.root) : (M.toTail r).root := ⟨.inr ⊤, by
30-
intro x hx;
31-
match x with
32-
| .inl x => simp_all [toTail, Model.Rel]
33-
| .inr i => simp_all [Model.Rel]; grind;
34-
35-
36-
instance : Nonempty (M.toTail r).root := ⟨toTail.root M r⟩
35+
variable {r : M.World}
3736

3837
instance [IsTrans _ M.Rel] : IsTrans _ (M.toTail r).Rel := by
3938
constructor;
@@ -42,8 +41,9 @@ instance [IsTrans _ M.Rel] : IsTrans _ (M.toTail r).Rel := by
4241
| .inl x, .inl y, .inl z =>
4342
simp_all only [Model.Rel];
4443
exact IsTrans.trans _ _ _ Rxy Ryz;
45-
| .inr _, .inr _, .inr _ =>
46-
grind;
44+
| .inr a, .inr b, .inr c =>
45+
simp_all only [Model.Rel];
46+
exact lt_trans Ryz Rxy;
4747
| _, .inl _, .inr _
4848
| .inl _, .inr _, _
4949
| .inr _, _, .inl _ =>
@@ -56,11 +56,12 @@ instance [Std.Irrefl M.Rel] : Std.Irrefl (M.toTail r).Rel := by
5656
| .inl x => simp_all only [Model.Rel]; apply Std.Irrefl.irrefl
5757
| .inr i => simp [Model.Rel];
5858

59-
protected abbrev tail (M : Model κ α) (r : M.root) : ℕ+ → (M.toTail r).World := λ n => .inr n
59+
protected abbrev tail (M : Model κ α) (r : M.World) : ℕ+ → (M.toTail r).World := λ n => .inr (n : ℕ∞)
6060

6161
@[simp]
6262
lemma tail_isChain (h : i < j) : ((toTail.tail M r) j ≺ (toTail.tail M r) i) := by
63-
simp [Model.Rel]; grind;
63+
simp only [Model.Rel];
64+
exact_mod_cast h;
6465

6566
end toTail
6667

0 commit comments

Comments
 (0)