Skip to content

Commit f04df22

Browse files
committed
feat(SetTheory/Ordinal/Basic): the #s-th element of α is an upper-bound for the set's mex (#36539)
This is a translation of `card_typein_min_le_mk` to be in terms of `α`.
1 parent ce78b47 commit f04df22

File tree

3 files changed

+42
-5
lines changed

3 files changed

+42
-5
lines changed

Mathlib/AlgebraicGeometry/Properties.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ instance Scheme.component_nontrivial (X : Scheme.{u}) (U : X.Opens) [Nonempty U]
249249
set_option backward.isDefEq.respectTransparency false in
250250
instance irreducibleSpace_of_isIntegral [IsIntegral X] : IrreducibleSpace X := by
251251
by_contra H
252-
replace H : ¬IsPreirreducible (⊤ : Set X) := fun h =>
252+
replace H : ¬IsPreirreducible .univ := fun h =>
253253
H { toPreirreducibleSpace := ⟨h⟩
254254
toNonempty := inferInstance }
255255
simp_rw [isPreirreducible_iff_isClosed_union_isClosed, not_forall, not_or] at H
256256
rcases H with ⟨S, T, hS, hT, h₁, h₂, h₃⟩
257-
rw [Set.not_top_subset] at h₂ h₃
257+
rw [Set.not_univ_subset] at h₂ h₃
258258
haveI : Nonempty (⟨Sᶜ, hS.1⟩ : X.Opens) := ⟨⟨_, h₂.choose_spec⟩⟩
259259
haveI : Nonempty (⟨Tᶜ, hT.1⟩ : X.Opens) := ⟨⟨_, h₃.choose_spec⟩⟩
260260
haveI : Nonempty (⟨Sᶜ, hS.1⟩ ⊔ ⟨Tᶜ, hT.1⟩ : X.Opens) := ⟨⟨_, Or.inl h₂.choose_spec⟩⟩

Mathlib/Data/Set/Basic.lean

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,13 @@ theorem subset_iff_notMem : s ⊆ t ↔ ∀ ⦃a⦄, a ∉ t → a ∉ s := by
296296
theorem not_subset : ¬s ⊆ t ↔ ∃ a ∈ s, a ∉ t := by
297297
simp only [subset_def, not_forall, exists_prop]
298298

299-
theorem not_top_subset : ¬ ⊆ s ↔ ∃ a, a ∉ s := by
299+
theorem not_univ_subset : ¬univ ⊆ s ↔ ∃ a, a ∉ s := by
300300
simp [not_subset]
301301

302+
@[deprecated not_univ_subset (since := "2026-03-12")]
303+
theorem not_top_subset : ¬⊤ ⊆ s ↔ ∃ a, a ∉ s :=
304+
not_univ_subset
305+
302306
lemma eq_of_forall_subset_iff (h : ∀ u, s ⊆ u ↔ t ⊆ u) : s = t := eq_of_forall_ge_iff h
303307

304308
/-! ### Definition of strict subsets `s ⊂ t` and basic properties. -/
@@ -569,6 +573,18 @@ theorem univ_unique [Unique α] : @Set.univ α = {default} :=
569573
theorem ssubset_univ_iff : s ⊂ univ ↔ s ≠ univ :=
570574
lt_top_iff_ne_top
571575

576+
theorem ssubset_univ_iff_nonempty_compl : s ⊂ univ ↔ sᶜ.Nonempty := by
577+
rw [ssubset_def, Set.not_univ_subset, Set.nonempty_def]
578+
simp
579+
580+
alias ⟨_, Nonempty.ssubset_univ⟩ := ssubset_univ_iff_nonempty_compl
581+
582+
theorem compl_ssubset_univ : sᶜ ⊂ univ ↔ s.Nonempty := by
583+
rw [ssubset_def, Set.not_univ_subset, Set.nonempty_def]
584+
simp
585+
586+
alias ⟨_, Nonempty.compl_ssubset_univ⟩ := compl_ssubset_univ
587+
572588
instance nontrivial_of_nonempty [Nonempty α] : Nontrivial (Set α) :=
573589
⟨⟨∅, univ, empty_ne_univ⟩⟩
574590

Mathlib/SetTheory/Ordinal/Basic.lean

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ theorem card_one : card 1 = 1 := mk_eq_one _
612612

613613
variable (r) in
614614
/-- The cardinality of a set is an upper-bound for the cardinality of the order type of the set's
615-
mex (minimum excluded value) -/
615+
mex (minimum excluded value). See `not_lt_enum_ord_mk_min_compl` for the `α` version. -/
616616
theorem card_typein_min_le_mk [IsWellOrder α r] {s : Set α} (hs : sᶜ.Nonempty) :
617617
(typein r <| IsWellFounded.wf.min (r := r) sᶜ hs).card ≤ #s :=
618618
IsWellFounded.wf.cardinalMk_subtype_lt_min_compl_le hs
@@ -1438,12 +1438,33 @@ theorem card_eq_ofNat {o} {n : ℕ} [n.AtLeastTwo] :
14381438
card o = ofNat(n) ↔ o = OfNat.ofNat n :=
14391439
card_eq_nat
14401440

1441+
variable (r) in
14411442
@[simp]
1442-
theorem type_fintype (r : α → α → Prop) [IsWellOrder α r] [Fintype α] :
1443+
theorem type_fintype [IsWellOrder α r] [Fintype α] :
14431444
type r = Fintype.card α := by rw [← card_eq_nat, card_type, mk_fintype]
14441445

14451446
theorem type_fin (n : ℕ) : typeLT (Fin n) = n := by simp
14461447

1448+
variable (r) in
1449+
theorem ord_mk_le_type [IsWellOrder α r] (s : Set α) : (#s).ord ≤ type r := by
1450+
grw [← ord_le_type, ord_le_ord, le_mk_iff_exists_set]
1451+
use s
1452+
1453+
variable (r) in
1454+
theorem ord_mk_lt_type [IsWellOrder α r] {s : Set α} (hfin : s.Finite) (h : sᶜ.Nonempty) :
1455+
(#s).ord < type r := by
1456+
grw [← ord_le_type, ord_lt_ord, ← mk_univ (α := α)]
1457+
exact card_lt_card_of_left_finite hfin h.ssubset_univ
1458+
1459+
variable (r) in
1460+
/-- The `#s`-th element of `α` is an upper-bound for the set's mex (minimum excluded value),
1461+
ordered by `r`, when `s` is finite. See `card_typein_min_le_mk` for the `Ordinal` version. -/
1462+
theorem not_lt_enum_ord_mk_min_compl [IsWellOrder α r] {s : Set α} (hfin : s.Finite)
1463+
(h : sᶜ.Nonempty) :
1464+
¬r (enum r ⟨#s |>.ord, ord_mk_lt_type r hfin h⟩) (IsWellFounded.wf.min (r := r) sᶜ h) := by
1465+
grw [← typein_le_typein, typein_enum, Cardinal.le_ord_iff_card_le_of_lt_aleph0 _ hfin.lt_aleph0,
1466+
card_typein_min_le_mk]
1467+
14471468
end Ordinal
14481469

14491470
/-! ### Sorted lists -/

0 commit comments

Comments
 (0)