Skip to content

Commit ddc2e11

Browse files
vihdzpbryangingechen
authored andcommitted
feat: monotone function Cardinal → α is eventually constant (leanprover-community#37344)
1 parent 38482cd commit ddc2e11

4 files changed

Lines changed: 94 additions & 0 deletions

File tree

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7106,6 +7106,7 @@ public import Mathlib.SetTheory.Cardinal.Defs
71067106
public import Mathlib.SetTheory.Cardinal.Divisibility
71077107
public import Mathlib.SetTheory.Cardinal.ENat
71087108
public import Mathlib.SetTheory.Cardinal.Embedding
7109+
public import Mathlib.SetTheory.Cardinal.EventuallyConst
71097110
public import Mathlib.SetTheory.Cardinal.Finite
71107111
public import Mathlib.SetTheory.Cardinal.Finsupp
71117112
public import Mathlib.SetTheory.Cardinal.Free

Mathlib/Logic/Small/Basic.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,5 @@ instance small_quot {α : Type u} [Small.{v} α] (r : α → α → Prop) : Smal
7575

7676
instance small_quotient {α : Type u} [Small.{v} α] (s : Setoid α) : Small.{v} (Quotient s) :=
7777
small_of_surjective Quotient.mk_surjective
78+
79+
instance small_orderDual {α : Type*} [h : Small.{v} α] : Small.{v} αᵒᵈ := h

Mathlib/Order/Preorder/Chain.lean

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ theorem Monotone.isChain_range [LinearOrder α] [Preorder β] {f : α → β} (h
119119
rw [← image_univ]
120120
exact hf.isChain_image (isChain_of_trichotomous _)
121121

122+
lemma Antitone.isChain_image [Preorder α] [Preorder β] {s : Set α} {f : α → β}
123+
(hf : Antitone f) (hs : IsChain (· ≤ ·) s) : IsChain (· ≤ ·) (f '' s) :=
124+
hf.dual_left.isChain_image hs.symm
125+
126+
theorem Antitone.isChain_range [LinearOrder α] [Preorder β] {f : α → β} (hf : Antitone f) :
127+
IsChain (· ≤ ·) (range f) :=
128+
hf.dual_left.isChain_range
129+
122130
theorem IsChain.lt_of_le [PartialOrder α] {s : Set α} (h : IsChain (· ≤ ·) s) :
123131
IsChain (· < ·) s := fun _a ha _b hb hne ↦
124132
(h ha hb hne).imp hne.lt_of_le hne.lt_of_le'
@@ -222,6 +230,15 @@ theorem IsChain.exists3 (hchain : IsChain r s) [IsTrans α r] {a b c} (mem1 : a
222230

223231
end Total
224232

233+
/-- A chain in a partial order is a linear order. -/
234+
@[implicit_reducible]
235+
def IsChain.linearOrder [PartialOrder α] [DecidableLE α] {s : Set α} (hs : IsChain (· ≤ ·) s) :
236+
LinearOrder s where
237+
le_total := by
238+
rintro ⟨a, ha⟩ ⟨b, hb⟩
239+
exact hs.total ha hb
240+
toDecidableLE x y := inferInstanceAs (Decidable (x.1 ≤ y.1))
241+
225242
lemma IsChain.le_of_not_gt [Preorder α] (hs : IsChain (· ≤ ·) s)
226243
{x y : α} (hx : x ∈ s) (hy : y ∈ s) (h : ¬ x < y) : y ≤ x := by
227244
cases hs.total hx hy with
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/-
2+
Copyright (c) 2026 Violeta Hernández Palacios. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Violeta Hernández Palacios
5+
-/
6+
module
7+
8+
public import Mathlib.Order.Filter.EventuallyConst
9+
public import Mathlib.SetTheory.Cardinal.Aleph
10+
11+
/-!
12+
# Eventually constant monotone functions
13+
14+
This file proves variations of the following theorem: if `α` is a linear order and `β` is a partial
15+
order with `#β < cof α`, then any monotone function `f : α → β` must be eventually constant. In
16+
particular, this applies for functions from `Cardinal.{u}` or `Ordinal.{u}` into a `Small.{u}` type.
17+
-/
18+
19+
public section
20+
21+
universe u v
22+
23+
variable {α : Type u} {β : Type v} [LinearOrder α] [PartialOrder β]
24+
25+
open Cardinal Filter Order Set
26+
27+
namespace Filter.EventuallyConst
28+
variable {f : α → β}
29+
30+
theorem of_not_isCofinal_rangeSplitting [Nonempty α] (hf : Monotone f)
31+
(hf' : ¬ IsCofinal (range (rangeSplitting f))) : atTop.EventuallyConst f := by
32+
rw [eventuallyConst_atTop]
33+
obtain ⟨i, hi⟩ := not_isCofinal_iff.1 hf'
34+
refine ⟨i, fun j hij ↦ (hf hij).antisymm' <| (hf (hi _ ⟨⟨f j, j, rfl⟩, rfl⟩).le).trans' ?_⟩
35+
rw [apply_rangeSplitting f]
36+
37+
theorem of_monotone_of_lt_cof (hf : Monotone f) (hα : lift.{u} #β < lift.{v} (cof α)) :
38+
atTop.EventuallyConst f := by
39+
have : Nonempty α := by by_contra!; simp at hα
40+
refine .of_not_isCofinal_rangeSplitting hf ?_
41+
contrapose! hα
42+
classical let := hf.isChain_range.linearOrder
43+
rw [← lift_cof_congr_of_strictMono (rangeSplitting_strictMono hf) hα, lift_le]
44+
exact (cof_le_cardinalMk _).trans (mk_set_le _)
45+
46+
theorem of_antitone_of_lt_cof (hf : Antitone f) (hα : lift.{u} #β < lift.{v} (cof α)) :
47+
atTop.EventuallyConst f :=
48+
.of_monotone_of_lt_cof (β := βᵒᵈ) hf.dual_right hα
49+
50+
end Filter.EventuallyConst
51+
52+
namespace Cardinal
53+
variable {f : Cardinal.{v} → β} [Small.{v} β]
54+
55+
theorem eventuallyConst_of_monotone (hf : Monotone f) : atTop.EventuallyConst f := by
56+
refine .of_monotone_of_lt_cof hf ?_
57+
simpa [← small_iff_lift_mk_lt_univ]
58+
59+
theorem eventuallyConst_of_antitone (hf : Antitone f) : atTop.EventuallyConst f :=
60+
eventuallyConst_of_monotone (β := βᵒᵈ) hf
61+
62+
end Cardinal
63+
64+
namespace Ordinal
65+
variable {f : Ordinal.{v} → β} [Small.{v} β]
66+
67+
theorem eventuallyConst_of_monotone (hf : Monotone f) : atTop.EventuallyConst f := by
68+
refine .of_monotone_of_lt_cof hf ?_
69+
simpa [← small_iff_lift_mk_lt_univ]
70+
71+
theorem eventuallyConst_of_antitone (hf : Antitone f) : atTop.EventuallyConst f :=
72+
eventuallyConst_of_monotone (β := βᵒᵈ) hf
73+
74+
end Ordinal

0 commit comments

Comments
 (0)