Skip to content

Commit de05f21

Browse files
committed
feat(SetTheory/Ordinal/FixedPointApproximants): add zero and limit lemmas for approximants (leanprover-community#37375)
Add helper lemmas `lfpApprox_zero`, `lfpApprox_limit`, and the corresponding `gfpApprox` lemmas by duality. Co-authored-by: NoneMore <hellgoingup@outlook.com>
1 parent 58df4fc commit de05f21

1 file changed

Lines changed: 40 additions & 13 deletions

File tree

Mathlib/SetTheory/Ordinal/FixedPointApproximants.lean

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,36 @@ theorem lfpApprox_mono_right : Monotone (lfpApprox f x) := by
8484

8585
@[deprecated (since := "2026-03-30")] alias lfpApprox_monotone := lfpApprox_mono_right
8686

87+
theorem lfpApprox_zero : lfpApprox f x 0 = x := by
88+
rw [lfpApprox]
89+
simp
90+
8791
theorem le_lfpApprox {a : Ordinal} : x ≤ lfpApprox f x a := by
8892
rw [lfpApprox]
8993
exact le_sup_left
9094

95+
theorem apply_lfpApprox_le_lfpApprox_of_lt {a b : Ordinal} (h : a < b) :
96+
f (lfpApprox f x a) ≤ lfpApprox f x b := by
97+
nth_rw 2 [lfpApprox]
98+
exact le_sup_of_le_right <| le_iSup₂_of_le a h le_rfl
99+
91100
theorem lfpApprox_add_one (hx : x ≤ f x) (a : Ordinal) :
92101
lfpApprox f x (a + 1) = f (lfpApprox f x a) := by
102+
apply (apply_lfpApprox_le_lfpApprox_of_lt f (lt_add_one a)).antisymm'
93103
rw [lfpApprox]
94-
apply (sup_le (hx.trans (f.mono (le_lfpApprox ..))) _).antisymm
95-
· exact le_sup_of_le_right <| le_iSup₂ (f := fun b _ ↦ f (lfpApprox f x b)) a (lt_add_one a)
96-
· simpa using fun i h ↦ f.monotone.comp (lfpApprox_mono_right f) h
97-
98-
theorem lfpApprox_mono_left : Monotone (lfpApprox (α := α)) := by
104+
apply sup_le <| hx.trans (f.mono (le_lfpApprox f))
105+
simpa using fun i h ↦ f.monotone.comp (lfpApprox_mono_right f) h
106+
107+
theorem lfpApprox_of_isSuccLimit {a : Ordinal} (ha : Order.IsSuccLimit a) :
108+
lfpApprox f x a = ⨆ b : Set.Iio a, lfpApprox f x b := by
109+
apply (iSup_le fun b => lfpApprox_mono_right f b.2.le).antisymm'
110+
rw [lfpApprox, sup_le_iff, iSup_le_iff]
111+
constructor
112+
· refine le_iSup_of_le ⟨0, ha.bot_lt⟩ (by simp [lfpApprox_zero])
113+
· exact fun b => iSup_mono' fun hab => ⟨⟨b + 1, ha.succ_lt hab⟩, (by
114+
simpa using apply_lfpApprox_le_lfpApprox_of_lt f (lt_add_one b))⟩
115+
116+
theorem lfpApprox_mono_left : Monotone (lfpApprox : (α →o α) → _) := by
99117
intro f g h x a
100118
induction a using WellFoundedLT.induction with | ind i IH
101119
rw [lfpApprox, lfpApprox]
@@ -108,7 +126,7 @@ theorem lfpApprox_mono_mid : Monotone (lfpApprox f) := by
108126
exact sup_le_sup h <| iSup₂_mono fun j hj ↦ f.mono (IH j hj)
109127

110128
/-- The approximations of the least fixed point stabilize at a fixed point of `f` -/
111-
theorem lfpApprox_eq_of_mem_fixedPoints (hx : x ≤ f x) (hab : a ≤ b)
129+
theorem lfpApprox_eq_of_mem_fixedPoints (hab : a ≤ b)
112130
(hf : lfpApprox f x a ∈ fixedPoints f) : lfpApprox f x b = lfpApprox f x a := by
113131
rw [mem_fixedPoints_iff] at hf
114132
induction b using WellFoundedLT.induction with | ind b IH
@@ -118,10 +136,8 @@ theorem lfpApprox_eq_of_mem_fixedPoints (hx : x ≤ f x) (hab : a ≤ b)
118136
rw [iSup₂_le_iff]
119137
intro i hi
120138
by_cases! hi' : i < a
121-
· rw [← lfpApprox_add_one f hx]
122-
apply lfpApprox_mono_right
123-
rwa [add_one_le_iff]
124-
· rw [IH _ hi hi', hf]
139+
· exact apply_lfpApprox_le_lfpApprox_of_lt f hi'
140+
· simp [IH i hi hi', hf]
125141

126142
variable (x) in
127143
/-- There are distinct indices smaller than the successor of the domain's cardinality
@@ -145,7 +161,7 @@ lemma lfpApprox_mem_fixedPoints_of_eq (hx : x ≤ f x) (hab : a < b) (hac : a
145161
rw [mem_fixedPoints_iff, ← lfpApprox_add_one f hx]
146162
exact (lfpApprox_mono_right f).eq_of_ge_of_le
147163
hf (lt_add_one a).le (add_one_le_of_lt hab)
148-
rwa [lfpApprox_eq_of_mem_fixedPoints f hx hac H]
164+
rwa [lfpApprox_eq_of_mem_fixedPoints f hac H]
149165

150166
/-- The approximation at the index of the successor of the domain's cardinality is a fixed point -/
151167
theorem lfpApprox_ord_mem_fixedPoint (hx : x ≤ f x) :
@@ -195,6 +211,9 @@ termination_by a
195211
-- by definitional equality
196212
unseal gfpApprox lfpApprox
197213

214+
theorem gfpApprox_zero : gfpApprox f x 0 = x := by
215+
exact lfpApprox_zero f.dual
216+
198217
theorem gfpApprox_anti_right : Antitone (gfpApprox f x) :=
199218
lfpApprox_mono_right f.dual
200219

@@ -207,6 +226,14 @@ theorem gfpApprox_add_one (hx : f x ≤ x) (a : Ordinal) :
207226
gfpApprox f x (a + 1) = f (gfpApprox f x a) :=
208227
lfpApprox_add_one f.dual hx a
209228

229+
theorem gfpApprox_le_apply_gfpApprox_of_lt {a b : Ordinal} (h : a < b) :
230+
gfpApprox f x b ≤ f (gfpApprox f x a) :=
231+
apply_lfpApprox_le_lfpApprox_of_lt f.dual h
232+
233+
theorem gfpApprox_of_isSuccLimit {a : Ordinal} (ha : Order.IsSuccLimit a) :
234+
gfpApprox f x a = ⨅ b : Set.Iio a, gfpApprox f x b :=
235+
lfpApprox_of_isSuccLimit f.dual ha
236+
210237
theorem gfpApprox_mono_left : Monotone (gfpApprox : (α →o α) → _) := by
211238
intro f g h
212239
have : g.dual ≤ f.dual := h
@@ -216,9 +243,9 @@ theorem gfpApprox_mono_mid : Monotone (gfpApprox f) :=
216243
fun _ _ h => lfpApprox_mono_mid f.dual h
217244

218245
/-- The approximations of the greatest fixed point stabilize at a fixed point of `f` -/
219-
theorem gfpApprox_eq_of_mem_fixedPoints {a b : Ordinal} (hx : f x ≤ x) (hab : a ≤ b)
246+
theorem gfpApprox_eq_of_mem_fixedPoints {a b : Ordinal} (h_ab : a ≤ b)
220247
(h : gfpApprox f x a ∈ fixedPoints f) : gfpApprox f x b = gfpApprox f x a :=
221-
lfpApprox_eq_of_mem_fixedPoints f.dual hx hab h
248+
lfpApprox_eq_of_mem_fixedPoints f.dual h_ab h
222249

223250
/-- There are distinct indices smaller than the successor of the domain's cardinality
224251
yielding the same value -/

0 commit comments

Comments
 (0)