@@ -40,7 +40,12 @@ abbrev RootedModel.extendRoot (M : RootedModel κ α) (n : ℕ+) : RootedModel (
4040 intro x hx;
4141 match x with
4242 | .inl x => simp [Model.Rel];
43- | .inr i => simp_all [Model.Rel, Fin.posLast]; sorry ;
43+ | .inr i =>
44+ replace hx : i ≠ Fin.posLast n := by simpa using hx;
45+ have h1 := i.2 ;
46+ have h2 : i.val ≠ n.natPred := by simpa [Fin.ext_iff, Fin.posLast] using hx;
47+ simp only [Model.Rel, Fin.lt_def, Fin.posLast, PNat.natPred] at *;
48+ omega;
4449 ⟩
4550
4651namespace RootedModel.extendRoot
@@ -81,7 +86,33 @@ instance [Std.Irrefl M.Rel] : Std.Irrefl (M.extendRoot n).Rel := by
8186 | .inr i => simp [Model.Rel];
8287
8388instance [IsConverseWellFounded _ M.Rel] : IsConverseWellFounded _ (M.extendRoot n).Rel where
84- cwf := by sorry
89+ cwf := by
90+ have accInl : ∀ x : M.World, Acc (flip (M.extendRoot n).Rel) (Sum.inl x) := by
91+ intro x;
92+ apply WellFounded.induction (IsConverseWellFounded.cwf (r := M.Rel)) x;
93+ intro x ih;
94+ constructor;
95+ intro y hy;
96+ match y with
97+ | .inl y => exact ih y hy;
98+ | .inr j => simp [flip, Model.Rel] at hy;
99+ have accInr : ∀ i : Fin n, Acc (flip (M.extendRoot n).Rel) (Sum.inr i) := by
100+ suffices ∀ k, ∀ i : Fin n, i.val = k → Acc (flip (M.extendRoot n).Rel) (Sum.inr i) by
101+ intro i; exact this i.val i rfl;
102+ intro k;
103+ induction k using Nat.strong_induction_on with
104+ | _ k ih =>
105+ intro i rfl;
106+ constructor;
107+ intro y hy;
108+ match y with
109+ | .inl x => exact accInl x;
110+ | .inr j => exact ih j.val (by simpa [flip, Model.Rel] using hy) j rfl;
111+ apply WellFounded.intro;
112+ intro x;
113+ match x with
114+ | .inl x => exact accInl x;
115+ | .inr i => exact accInr i;
85116
86117instance [M.IsGL] : (M.extendRoot n).IsGL where
87118
@@ -132,8 +163,8 @@ lemma tail_length : (extendRoot.tail M n).length = n := by simp [extendRoot.tail
132163lemma tail_isChain : List.IsChain (· ≺ ·) (extendRoot.tail M n) := by
133164 apply List.isChain_map_of_isChain (R := λ a b => b < a);
134165 . simp [Model.Rel]
135- . simp [List.isChain_reverse]
136- sorry ;
166+ . simp only [List.isChain_reverse];
167+ simp [List.isChain_iff_pairwise, List.pairwise_lt_finRange] ;
137168
138169
139170namespace Ext1
0 commit comments