Skip to content

Commit a8dd560

Browse files
committed
a lot
1 parent ee445e0 commit a8dd560

6 files changed

Lines changed: 77 additions & 12 deletions

File tree

Mathlib/Data/Fintype/Order.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,14 @@ lemma Directed.finite_le {ι κ : Sort*} [Nonempty ι] [Finite κ] {f : ι →
195195
simpa using
196196
(hf.comp_of_surjective PLift.down_surjective).finite_set_le (Set.finite_range (PLift.up ∘ g))
197197

198+
theorem DirectedOn.finite_le {s : Set α} (hs₀ : s.Nonempty) (D : DirectedOn r s)
199+
(hs : s.Finite) : ∃ z ∈ s, ∀ i ∈ s, r i z := by
200+
have := hs₀.to_subtype
201+
have := hs.to_subtype
202+
obtain ⟨⟨z, hzs⟩, hz⟩ := D.directed_val.finite_le id
203+
use z, hzs
204+
simpa using hz
205+
198206
variable [Nonempty α] [Preorder α]
199207

200208
theorem Finite.exists_le [IsDirectedOrder α] (f : β → α) : ∃ M, ∀ i, f i ≤ M :=

Mathlib/Order/DirSupClosed.lean

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ Authors: Christopher Hoskin, Violeta Hernández Palacios
55
-/
66
module
77

8+
public import Mathlib.Data.Fintype.Order
89
public import Mathlib.Order.Antisymmetrization
910
public import Mathlib.Order.CompleteLattice.Defs
1011
public import Mathlib.Order.UpperLower.Basic
1112

12-
import Mathlib.Data.Set.Lattice
13+
import Mathlib.Data.Nat.Lattice
1314

1415
/-!
1516
# Sets closed under directed suprema
@@ -300,6 +301,29 @@ theorem dirSupClosed_singleton (a : α) : DirSupClosed {a} := by
300301
theorem dirSupClosedOn_singleton (a : α) : DirSupClosedOn D {a} :=
301302
(dirSupClosed_singleton a).dirSupClosedOn
302303

304+
theorem DirSupClosed.of_finite (hs : s.Finite) : DirSupClosed s := by
305+
intro t ht ht₀ ht₁ a ha
306+
obtain ⟨b, hbt, hb⟩ := ht₁.finite_le ht₀ (hs.subset ht)
307+
exact ht <| ha.unique ⟨hb, fun x hx ↦ hx hbt⟩ ▸ hbt
308+
309+
theorem dirSupClosed_range_nat {f : ℕ → α} (hf : Monotone f) (hf' : IsCofinal (.range f)) :
310+
DirSupClosed (range f) := by
311+
intro s hs hs₀ hs₁ a ha
312+
obtain ⟨_, ⟨n, rfl⟩, han⟩ := hf' a
313+
obtain rfl | han := han.eq_or_lt
314+
· simp
315+
have hfb : BddAbove (f ⁻¹' s) := by
316+
refine ⟨n, fun m hm ↦ ?_⟩
317+
by_contra! hnm
318+
exact (ha.1 hm).not_gt (han.trans_le (hf hnm.le))
319+
refine ⟨sSup (f ⁻¹' s), IsLUB.unique ⟨?_, ?_⟩ ha⟩ <;> intro x hx
320+
· obtain ⟨m, rfl⟩ := hs hx
321+
exact hf (le_csSup hfb hx)
322+
· apply hx (Nat.sSup_mem _ hfb)
323+
obtain ⟨x, hx⟩ := hs₀
324+
obtain ⟨m, rfl⟩ := hs hx
325+
exact ⟨m, hx⟩
326+
303327
end PartialOrder
304328

305329
section LinearOrder

Mathlib/SetTheory/Cardinal/Cofinality/Basic.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ theorem cof_congr_of_strictMono {f : α → γ} (hf : StrictMono f) (hf' : IsCof
131131
cof α = cof γ := by
132132
simpa using lift_cof_congr_of_strictMono hf hf'
133133

134+
theorem cof_eq_of_isCofinal {s : Set α} (hs : IsCofinal s) : cof s = cof α :=
135+
cof_congr_of_strictMono (Subtype.strictMono_coe _) (by simpa)
136+
134137
@[simp]
135138
theorem cof_lt_aleph0_iff : Order.cof α < ℵ₀ ↔ Order.cof α ≤ 1 := by
136139
refine ⟨fun h ↦ ?_, (lt_of_le_of_lt · one_lt_aleph0)⟩

Mathlib/SetTheory/Cardinal/Cofinality/Club.lean

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ Authors: Violeta Hernández Palacios
55
-/
66
module
77

8-
public import Mathlib.Order.DirSupClosed
9-
public import Mathlib.Order.IsNormal
10-
public import Mathlib.SetTheory.Cardinal.Cofinality.Basic
8+
public import Mathlib.SetTheory.Cardinal.Cofinality.Ordinal
119

1210
/-!
1311
# Club sets
@@ -27,7 +25,7 @@ public section
2725

2826
universe u v
2927

30-
open Cardinal Order
28+
open Cardinal Order Ordinal
3129

3230
/-- A club set is closed under suprema and cofinal. -/
3331
structure IsClub {α : Type*} [LinearOrder α] (s : Set α) where
@@ -51,7 +49,7 @@ theorem IsClub.univ : IsClub (α := α) .univ :=
5149
protected theorem IsClub.nonempty [Nonempty α] (hs : IsClub s) : s.Nonempty :=
5250
hs.isCofinal.nonempty
5351

54-
theorem _root_.isClub_empty_iff : IsClub (α := α) ∅ ↔ IsEmpty α :=
52+
theorem isClub_empty_iff : IsClub (α := α) ∅ ↔ IsEmpty α :=
5553
fun h ↦ isCofinal_empty_iff.1 h.isCofinal, fun _ ↦ .of_isEmpty⟩
5654

5755
theorem IsClub.union (hs : IsClub s) (ht : IsClub t) : IsClub (s ∪ t) :=
@@ -127,7 +125,7 @@ theorem IsClub.inter {s t : Set α} (hα : cof α ≠ ℵ₀) (hs : IsClub s) (h
127125
rw [← Set.sInter_pair]
128126
have H : ∀ x ∈ ({s, t} : Set _), IsClub x := by simpa [hs]
129127
obtain hα | hα' := hα.lt_or_gt
130-
· rw [cof_lt_aleph0_iff] at hα
128+
· rw [Order.cof_lt_aleph0_iff] at hα
131129
exact .sInter_of_cof_le_one hα H
132130
· exact .sInter hα (hα'.trans_le' <| by simp) H
133131

@@ -180,7 +178,7 @@ theorem not_isStationary_empty : ¬ IsStationary (∅ : Set α) := by
180178

181179
theorem IsClub.isStationary [Nonempty α] [WellFoundedLT α] (hα : cof α ≠ ℵ₀) (hs : IsClub s) :
182180
IsStationary s :=
183-
fun t ht ↦ (hs.inter hα ht).nonempty
181+
fun _ ht ↦ (hs.inter hα ht).nonempty
184182

185183
/-- Non-stationary sets form an ideal. -/
186184
theorem not_isStationary_union [WellFoundedLT α] (hα : cof α ≠ ℵ₀)
@@ -191,6 +189,11 @@ theorem not_isStationary_union [WellFoundedLT α] (hα : cof α ≠ ℵ₀)
191189
refine ⟨_, hu.inter hα hv, ?_⟩
192190
grind
193191

192+
theorem dirSupClosed_of_type_le_omega0 [WellFoundedLT α] {s : Set α} (hs : typeLT s ≤ ω) :
193+
DirSupClosed s := by
194+
195+
sorry
196+
194197
theorem IsStationary.of_not_isCofinal_compl (hs : ¬ IsCofinal (sᶜ)) : IsStationary s := by
195198
intro t ht
196199
obtain ⟨a, ha⟩ := not_isCofinal_iff.1 hs
@@ -199,5 +202,9 @@ theorem IsStationary.of_not_isCofinal_compl (hs : ¬ IsCofinal (sᶜ)) : IsStati
199202
contrapose! ha
200203
exact ⟨b, ha, hb'⟩
201204

202-
proof_wanted isStationary_iff_not_isCofinal_compl (hα : cof α ≤ ℵ₀) :
203-
IsStationary s ↔ ¬ IsCofinal (sᶜ)
205+
theorem isStationary_iff_not_isCofinal_compl [WellFoundedLT α] (hα : cof α ≤ ℵ₀) :
206+
IsStationary s ↔ ¬ IsCofinal (sᶜ) where
207+
mp hs h := by
208+
obtain ⟨t, ht, ht', htα⟩ := Ordinal.ord_cof_eq_of_isCofinal h
209+
sorry
210+
mpr := .of_not_isCofinal_compl

Mathlib/SetTheory/Cardinal/Cofinality/Ordinal.lean

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ theorem cof_omega0 : cof ω = ℵ₀ :=
151151

152152
@[deprecated (since := "2026-02-18")] alias cof_eq_one_iff_is_succ := cof_eq_one_iff
153153

154-
theorem ord_cof_eq (α : Type*) [LinearOrder α] [WellFoundedLT α] :
154+
variable (α) in
155+
theorem ord_cof_eq [LinearOrder α] [WellFoundedLT α] :
155156
∃ s : Set α, IsCofinal s ∧ typeLT s = (Order.cof α).ord := by
156157
obtain ⟨s, hs, hs'⟩ := Order.cof_eq α
157158
obtain ⟨r, hr, hr'⟩ := exists_ord_eq s
@@ -166,8 +167,18 @@ theorem ord_cof_eq (α : Type*) [LinearOrder α] [WellFoundedLT α] :
166167
· obtain ⟨x, z, hz, rfl⟩ := x
167168
exact (hz _ hxy').asymm hxy
168169

170+
theorem ord_cof_eq_of_isCofinal [LinearOrder α] [WellFoundedLT α] {s : Set α} (hs : IsCofinal s) :
171+
∃ t ⊆ s, IsCofinal t ∧ typeLT t = (Order.cof α).ord := by
172+
obtain ⟨t, ht, ht'⟩ := ord_cof_eq s
173+
rw [cof_eq_of_isCofinal hs] at ht'
174+
refine ⟨t, ?_, hs.trans ht, ?_⟩
175+
· simp
176+
· rw [← ht']
177+
exact ((Subtype.strictMono_coe _).strictMonoOn _).orderIso.ordinal_type_eq.symm
178+
179+
variable (α) in
169180
@[simp]
170-
theorem _root_.Order.cof_ord_cof (α : Type*) [LinearOrder α] [WellFoundedLT α] :
181+
theorem _root_.Order.cof_ord_cof [LinearOrder α] [WellFoundedLT α] :
171182
(Order.cof α).ord.cof = Order.cof α := by
172183
obtain ⟨s, hs, hs'⟩ := ord_cof_eq α
173184
rw [← hs', cof_type]
@@ -183,6 +194,14 @@ theorem cof_ord_cof (o : Ordinal) : o.cof.ord.cof = o.cof := by
183194

184195
@[deprecated (since := "2026-03-21")] alias cof_cof := cof_ord_cof
185196

197+
theorem dirSupClosed_of_type_le_omega0 [LinearOrder α] [WellFoundedLT α]
198+
{s : Set α} (hs : IsCofinal s) (hs' : typeLT s ≤ ω) : DirSupClosed s := by
199+
obtain rfl | hs₀ := s.eq_empty_or_nonempty
200+
· simp
201+
let f (n : ℕ) : α := if hn : n < typeLT s then enum (· < · : s → _) ⟨n, hn⟩
202+
sorry
203+
204+
#exit
186205
/-! ### Cofinalities and suprema -/
187206

188207
section LinearOrder

Mathlib/SetTheory/Ordinal/Basic.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ theorem _root_.RelIso.ordinal_type_eq {α β} {r : α → α → Prop} {s : β
169169
[IsWellOrder β s] (h : r ≃r s) : type r = type s :=
170170
type_eq.2 ⟨h⟩
171171

172+
theorem _root_.OrderIso.ordinal_type_eq {α β} [LinearOrder α] [LinearOrder β]
173+
[WellFoundedLT α] [WellFoundedLT β] (h : α ≃o β) : typeLT α = typeLT β :=
174+
h.toRelIsoLT.ordinal_type_eq
175+
172176
theorem type_eq_zero_of_empty (r) [IsWellOrder α r] [IsEmpty α] : type r = 0 :=
173177
(RelIso.relIsoOfIsEmpty r _).ordinal_type_eq
174178

0 commit comments

Comments
 (0)