fact stringlengths 6 3.84k | type stringclasses 11
values | library stringclasses 32
values | imports listlengths 1 14 | filename stringlengths 20 95 | symbolic_name stringlengths 1 90 | docstring stringlengths 7 20k ⌀ |
|---|---|---|---|---|---|---|
mk_pi_congr_prop {ι ι' : Prop} {f : ι → Type v} {g : ι' → Type v} (e : ι ↔ ι')
(h : ∀ i, #(f i) = #(g (e.mp i))) : #(Π i, f i) = #(Π i, g i) :=
mk_congr <| Equiv.piCongr (.ofIff e) fun i ↦ Classical.choice <| Cardinal.eq.mp (h i) | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | mk_pi_congr_prop | null |
mk_pi_congr' {ι : Type u} {ι' : Type v} {f : ι → Type max w (max u v)}
{g : ι' → Type max w (max u v)} (e : ι ≃ ι')
(h : ∀ i, #(f i) = #(g (e i))) : #(Π i, f i) = #(Π i, g i) :=
mk_congr <| Equiv.piCongr e fun i ↦ Classical.choice <| Cardinal.eq.mp (h i) | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | mk_pi_congr' | Similar to `mk_pi_congr` with indexing types in different universes. This is not a strict
generalization. |
mk_pi_congrRight {ι : Type u} {f g : ι → Type v} (h : ∀ i, #(f i) = #(g i)) :
#(Π i, f i) = #(Π i, g i) :=
mk_pi_congr (Equiv.refl ι) h | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | mk_pi_congrRight | null |
mk_pi_congrRight_prop {ι : Prop} {f g : ι → Type v} (h : ∀ i, #(f i) = #(g i)) :
#(Π i, f i) = #(Π i, g i) :=
mk_pi_congr_prop Iff.rfl h
@[simp] | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | mk_pi_congrRight_prop | null |
prod_const (ι : Type u) (a : Cardinal.{v}) :
(prod fun _ : ι => a) = lift.{u} a ^ lift.{v} #ι :=
inductionOn a fun _ =>
mk_congr <| Equiv.piCongr Equiv.ulift.symm fun _ => outMkEquiv.trans Equiv.ulift.symm | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | prod_const | null |
prod_const' (ι : Type u) (a : Cardinal.{u}) : (prod fun _ : ι => a) = a ^ #ι :=
inductionOn a fun _ => (mk_pi _).symm
@[simp] | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | prod_const' | null |
prod_eq_zero {ι} (f : ι → Cardinal.{u}) : prod f = 0 ↔ ∃ i, f i = 0 := by
lift f to ι → Type u using fun _ => trivial
simp only [mk_eq_zero_iff, ← mk_pi, isEmpty_pi] | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | prod_eq_zero | null |
prod_ne_zero {ι} (f : ι → Cardinal) : prod f ≠ 0 ↔ ∀ i, f i ≠ 0 := by simp [prod_eq_zero] | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | prod_ne_zero | null |
power_sum {ι} (a : Cardinal) (f : ι → Cardinal) :
a ^ sum f = prod fun i ↦ a ^ f i := by
induction a using Cardinal.inductionOn with | _ α =>
induction f using induction_on_pi with | _ f =>
simp_rw [prod, sum, power_def]
apply mk_congr
refine (Equiv.piCurry fun _ _ => α).trans ?_
refine Equiv.piCongrRight fun b => ?_
refine (Equiv.arrowCongr outMkEquiv (Equiv.refl α)).trans ?_
exact outMkEquiv.symm
@[simp] | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | power_sum | null |
lift_prod {ι : Type u} (c : ι → Cardinal.{v}) :
lift.{w} (prod c) = prod fun i => lift.{w} (c i) := by
lift c to ι → Type v using fun _ => trivial
simp only [← mk_pi, ← mk_uLift]
exact mk_congr (Equiv.ulift.trans <| Equiv.piCongrRight fun i => Equiv.ulift.symm)
/-! ### The first infinite cardinal `aleph0` -/ | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | lift_prod | null |
aleph0 : Cardinal.{u} :=
lift #ℕ
@[inherit_doc]
scoped notation "ℵ₀" => Cardinal.aleph0 | def | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | aleph0 | `ℵ₀` is the smallest infinite cardinal. |
mk_nat : #ℕ = ℵ₀ :=
(lift_id _).symm | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | mk_nat | null |
aleph0_ne_zero : ℵ₀ ≠ 0 :=
mk_ne_zero _
@[simp] | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | aleph0_ne_zero | null |
lift_aleph0 : lift ℵ₀ = ℵ₀ :=
lift_lift _ | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | lift_aleph0 | null |
lift_mk_fin (n : ℕ) : lift #(Fin n) = n := rfl
/-! ### Cardinalities of basic sets and types -/ | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | lift_mk_fin | null |
mk_empty : #Empty = 0 :=
mk_eq_zero _ | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | mk_empty | null |
mk_pempty : #PEmpty = 0 :=
mk_eq_zero _ | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | mk_pempty | null |
mk_punit : #PUnit = 1 :=
mk_eq_one PUnit | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | mk_punit | null |
mk_unit : #Unit = 1 :=
mk_punit | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | mk_unit | null |
mk_plift_true : #(PLift True) = 1 :=
mk_eq_one _ | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | mk_plift_true | null |
mk_plift_false : #(PLift False) = 0 :=
mk_eq_zero _ | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | mk_plift_false | null |
mk_subtype_of_equiv {α β : Type u} (p : β → Prop) (e : α ≃ β) :
#{ a : α // p (e a) } = #{ b : β // p b } :=
mk_congr (Equiv.subtypeEquivOfSubtype e) | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Util.Delaborators",
"Mathlib.Util.AssertExists"
] | Mathlib/SetTheory/Cardinal/Defs.lean | mk_subtype_of_equiv | null |
isUnit_iff : IsUnit a ↔ a = 1 := by
refine
⟨fun h => ?_, by
rintro rfl
exact isUnit_one⟩
rcases eq_or_ne a 0 with (rfl | ha)
· exact (not_isUnit_zero h).elim
rw [isUnit_iff_forall_dvd] at h
obtain ⟨t, ht⟩ := h 1
rw [eq_comm, mul_eq_one_iff_of_one_le] at ht
· exact ht.1
· exact one_le_iff_ne_zero.mpr ha
· apply one_le_iff_ne_zero.mpr
intro h
rw [h, mul_zero] at ht
exact zero_ne_one ht | theorem | SetTheory | [
"Mathlib.Algebra.IsPrimePow",
"Mathlib.SetTheory.Cardinal.Arithmetic",
"Mathlib.Tactic.WLOG"
] | Mathlib/SetTheory/Cardinal/Divisibility.lean | isUnit_iff | Alias of `isUnit_iff_eq_one` for discoverability. |
le_of_dvd : ∀ {a b : Cardinal}, b ≠ 0 → a ∣ b → a ≤ b
| a, x, b0, ⟨b, hab⟩ => by
simpa only [hab, mul_one] using
mul_le_mul_left' (one_le_iff_ne_zero.2 fun h : b = 0 => b0 (by rwa [h, mul_zero] at hab)) a | theorem | SetTheory | [
"Mathlib.Algebra.IsPrimePow",
"Mathlib.SetTheory.Cardinal.Arithmetic",
"Mathlib.Tactic.WLOG"
] | Mathlib/SetTheory/Cardinal/Divisibility.lean | le_of_dvd | null |
dvd_of_le_of_aleph0_le (ha : a ≠ 0) (h : a ≤ b) (hb : ℵ₀ ≤ b) : a ∣ b :=
⟨b, (mul_eq_right hb h ha).symm⟩
@[simp] | theorem | SetTheory | [
"Mathlib.Algebra.IsPrimePow",
"Mathlib.SetTheory.Cardinal.Arithmetic",
"Mathlib.Tactic.WLOG"
] | Mathlib/SetTheory/Cardinal/Divisibility.lean | dvd_of_le_of_aleph0_le | null |
prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a := by
refine ⟨(aleph0_pos.trans_le ha).ne', ?_, fun b c hbc => ?_⟩
· rw [isUnit_iff]
exact (one_lt_aleph0.trans_le ha).ne'
rcases eq_or_ne (b * c) 0 with hz | hz
· rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp
wlog h : c ≤ b
· cases le_total c b <;> [solve_by_elim; rw [or_comm]]
apply_assumption
assumption'
all_goals rwa [mul_comm]
left
have habc := le_of_dvd hz hbc
rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc | theorem | SetTheory | [
"Mathlib.Algebra.IsPrimePow",
"Mathlib.SetTheory.Cardinal.Arithmetic",
"Mathlib.Tactic.WLOG"
] | Mathlib/SetTheory/Cardinal/Divisibility.lean | prime_of_aleph0_le | null |
not_irreducible_of_aleph0_le (ha : ℵ₀ ≤ a) : ¬Irreducible a := by
rw [irreducible_iff, not_and_or]
refine Or.inr fun h => ?_
simpa [mul_aleph0_eq ha, isUnit_iff, (one_lt_aleph0.trans_le ha).ne', one_lt_aleph0.ne'] using
@h a ℵ₀
@[simp, norm_cast] | theorem | SetTheory | [
"Mathlib.Algebra.IsPrimePow",
"Mathlib.SetTheory.Cardinal.Arithmetic",
"Mathlib.Tactic.WLOG"
] | Mathlib/SetTheory/Cardinal/Divisibility.lean | not_irreducible_of_aleph0_le | null |
nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m := by
refine ⟨?_, fun ⟨h, ht⟩ => ⟨h, mod_cast ht⟩⟩
rintro ⟨k, hk⟩
have : ↑m < ℵ₀ := nat_lt_aleph0 m
rw [hk, mul_lt_aleph0_iff] at this
rcases this with (h | h | ⟨-, hk'⟩)
iterate 2 simp only [h, mul_zero, zero_mul, Nat.cast_eq_zero] at hk; simp [hk]
lift k to ℕ using hk'
exact ⟨k, mod_cast hk⟩
@[simp] | theorem | SetTheory | [
"Mathlib.Algebra.IsPrimePow",
"Mathlib.SetTheory.Cardinal.Arithmetic",
"Mathlib.Tactic.WLOG"
] | Mathlib/SetTheory/Cardinal/Divisibility.lean | nat_coe_dvd_iff | null |
nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime := by
simp only [Prime, Nat.prime_iff]
refine and_congr (by simp) (and_congr ?_ ⟨fun h b c hbc => ?_, fun h b c hbc => ?_⟩)
· simp only [isUnit_iff, Nat.isUnit_iff]
exact mod_cast Iff.rfl
· exact mod_cast h b c (mod_cast hbc)
rcases lt_or_ge (b * c) ℵ₀ with h' | h'
· rcases mul_lt_aleph0_iff.mp h' with (rfl | rfl | ⟨hb, hc⟩)
· simp
· simp
lift b to ℕ using hb
lift c to ℕ using hc
exact mod_cast h b c (mod_cast hbc)
rcases aleph0_le_mul_iff.mp h' with ⟨hb, hc, hℵ₀⟩
have hn : (n : Cardinal) ≠ 0 := by
intro h
rw [h, zero_dvd_iff, mul_eq_zero] at hbc
cases hbc <;> contradiction
wlog hℵ₀b : ℵ₀ ≤ b
apply (this h c b _ _ hc hb hℵ₀.symm hn (hℵ₀.resolve_left hℵ₀b)).symm <;> try assumption
· rwa [mul_comm] at hbc
· rwa [mul_comm] at h'
· exact Or.inl (dvd_of_le_of_aleph0_le hn ((nat_lt_aleph0 n).le.trans hℵ₀b) hℵ₀b) | theorem | SetTheory | [
"Mathlib.Algebra.IsPrimePow",
"Mathlib.SetTheory.Cardinal.Arithmetic",
"Mathlib.Tactic.WLOG"
] | Mathlib/SetTheory/Cardinal/Divisibility.lean | nat_is_prime_iff | null |
is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ, a = p ∧ p.Prime := by
rcases le_or_gt ℵ₀ a with h | h
· simp [h]
lift a to ℕ using id h
simp [not_le.mpr h] | theorem | SetTheory | [
"Mathlib.Algebra.IsPrimePow",
"Mathlib.SetTheory.Cardinal.Arithmetic",
"Mathlib.Tactic.WLOG"
] | Mathlib/SetTheory/Cardinal/Divisibility.lean | is_prime_iff | null |
isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n := by
by_cases h : ℵ₀ ≤ a
· simp [h, (prime_of_aleph0_le h).isPrimePow]
simp only [h, false_or, isPrimePow_nat_iff]
lift a to ℕ using not_le.mp h
rw [isPrimePow_def]
refine
⟨?_, fun ⟨n, han, p, k, hp, hk, h⟩ =>
⟨p, k, nat_is_prime_iff.2 hp, hk, by rw [han]; exact mod_cast h⟩⟩
rintro ⟨p, k, hp, hk, hpk⟩
have key : p ^ (1 : Cardinal) ≤ ↑a := by
rw [← hpk]; apply power_le_power_left hp.ne_zero; exact mod_cast hk
rw [power_one] at key
lift p to ℕ using key.trans_lt (nat_lt_aleph0 a)
exact ⟨a, rfl, p, k, nat_is_prime_iff.mp hp, hk, mod_cast hpk⟩ | theorem | SetTheory | [
"Mathlib.Algebra.IsPrimePow",
"Mathlib.SetTheory.Cardinal.Arithmetic",
"Mathlib.Tactic.WLOG"
] | Mathlib/SetTheory/Cardinal/Divisibility.lean | isPrimePow_iff | null |
exists_embedding_disjoint_range_of_add_le_ENat_card
[Finite s] (hs : s.ncard + n ≤ ENat.card α) :
∃ y : Fin n ↪ α, Disjoint s (range y) := by
rsuffices ⟨y⟩ : Nonempty (Fin n ↪ (sᶜ : Set α))
· use y.trans (subtype _)
rw [Set.disjoint_right]
rintro _ ⟨i, rfl⟩
simpa only [← mem_compl_iff] using Subtype.coe_prop (y i)
rcases finite_or_infinite α with hα | hα
· let _ : Fintype α := Fintype.ofFinite α
classical
apply nonempty_of_card_le
rwa [Fintype.card_fin, ← add_le_add_iff_left s.ncard,
← Nat.card_eq_fintype_card, Nat.card_coe_set_eq,
ncard_add_ncard_compl, ← ENat.coe_le_coe,
← ENat.card_eq_coe_natCard, ENat.coe_add]
· exact ⟨valEmbedding.trans s.toFinite.infinite_compl.to_subtype.natEmbedding⟩ | theorem | SetTheory | [
"Mathlib.Data.ENat.Lattice",
"Mathlib.Data.Fin.Tuple.Embedding",
"Mathlib.Data.Finite.Card",
"Mathlib.Data.Set.Card"
] | Mathlib/SetTheory/Cardinal/Embedding.lean | exists_embedding_disjoint_range_of_add_le_ENat_card | null |
exists_embedding_disjoint_range_of_add_le_Nat_card
[Finite α] (hs : s.ncard + n ≤ Nat.card α) :
∃ y : Fin n ↪ α, Disjoint s (range y) := by
apply exists_embedding_disjoint_range_of_add_le_ENat_card
rwa [← ENat.coe_add, ENat.card_eq_coe_natCard, ENat.coe_le_coe] | theorem | SetTheory | [
"Mathlib.Data.ENat.Lattice",
"Mathlib.Data.Fin.Tuple.Embedding",
"Mathlib.Data.Finite.Card",
"Mathlib.Data.Set.Card"
] | Mathlib/SetTheory/Cardinal/Embedding.lean | exists_embedding_disjoint_range_of_add_le_Nat_card | null |
restrictSurjective_of_add_le_ENatCard (hn : m + n ≤ ENat.card α) :
Surjective (fun (x : Fin (m + n) ↪ α) ↦ (Fin.castAddEmb n).trans x) := by
intro x
obtain ⟨y, hxy⟩ :=
exists_embedding_disjoint_range_of_add_le_ENat_card (s := range x)
(by simpa [← Nat.card_coe_set_eq, Nat.card_range_of_injective x.injective])
use append hxy
ext i
simp [trans_apply, coe_castAddEmb, append] | theorem | SetTheory | [
"Mathlib.Data.ENat.Lattice",
"Mathlib.Data.Fin.Tuple.Embedding",
"Mathlib.Data.Finite.Card",
"Mathlib.Data.Set.Card"
] | Mathlib/SetTheory/Cardinal/Embedding.lean | restrictSurjective_of_add_le_ENatCard | null |
restrictSurjective_of_le_ENatCard (hmn : m ≤ n) (hn : n ≤ ENat.card α) :
Function.Surjective (fun x : Fin n ↪ α ↦ (castLEEmb hmn).trans x) := by
obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_le hmn
exact Fin.Embedding.restrictSurjective_of_add_le_ENatCard hn | theorem | SetTheory | [
"Mathlib.Data.ENat.Lattice",
"Mathlib.Data.Fin.Tuple.Embedding",
"Mathlib.Data.Finite.Card",
"Mathlib.Data.Set.Card"
] | Mathlib/SetTheory/Cardinal/Embedding.lean | restrictSurjective_of_le_ENatCard | null |
restrictSurjective_of_add_le_natCard [Finite α] (hn : m + n ≤ Nat.card α) :
Surjective (fun x : Fin (m + n) ↪ α ↦ (castAddEmb n).trans x) := by
apply restrictSurjective_of_add_le_ENatCard
rwa [← ENat.coe_add, ENat.card_eq_coe_natCard, ENat.coe_le_coe] | theorem | SetTheory | [
"Mathlib.Data.ENat.Lattice",
"Mathlib.Data.Fin.Tuple.Embedding",
"Mathlib.Data.Finite.Card",
"Mathlib.Data.Set.Card"
] | Mathlib/SetTheory/Cardinal/Embedding.lean | restrictSurjective_of_add_le_natCard | null |
restrictSurjective_of_le_natCard [Finite α] (hmn : m ≤ n) (hn : n ≤ Nat.card α) :
Function.Surjective (fun x : Fin n ↪ α ↦ (castLEEmb hmn).trans x) := by
obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_le hmn
exact Fin.Embedding.restrictSurjective_of_add_le_natCard hn | theorem | SetTheory | [
"Mathlib.Data.ENat.Lattice",
"Mathlib.Data.Fin.Tuple.Embedding",
"Mathlib.Data.Finite.Card",
"Mathlib.Data.Set.Card"
] | Mathlib/SetTheory/Cardinal/Embedding.lean | restrictSurjective_of_le_natCard | null |
@[coe] ofENat : ℕ∞ → Cardinal
| (n : ℕ) => n
| ⊤ => ℵ₀ | def | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | ofENat | Coercion `ℕ∞ → Cardinal`. It sends natural numbers to natural numbers and `⊤` to `ℵ₀`.
See also `Cardinal.ofENatHom` for a bundled homomorphism version. |
@[simp, norm_cast] ofENat_top : ofENat ⊤ = ℵ₀ := rfl
@[simp, norm_cast] lemma ofENat_nat (n : ℕ) : ofENat n = n := rfl
@[simp, norm_cast] lemma ofENat_zero : ofENat 0 = 0 := rfl
@[simp, norm_cast] lemma ofENat_one : ofENat 1 = 1 := rfl
@[simp, norm_cast] lemma ofENat_ofNat (n : ℕ) [n.AtLeastTwo] :
((ofNat(n) : ℕ∞) : Cardinal) = OfNat.ofNat n :=
rfl | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | ofENat_top | null |
ofENat_strictMono : StrictMono ofENat :=
WithTop.strictMono_iff.2 ⟨Nat.strictMono_cast, nat_lt_aleph0⟩
@[simp, norm_cast] | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | ofENat_strictMono | null |
ofENat_lt_ofENat {m n : ℕ∞} : (m : Cardinal) < n ↔ m < n :=
ofENat_strictMono.lt_iff_lt
@[gcongr, mono] alias ⟨_, ofENat_lt_ofENat_of_lt⟩ := ofENat_lt_ofENat
@[simp, norm_cast] | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | ofENat_lt_ofENat | null |
ofENat_lt_aleph0 {m : ℕ∞} : (m : Cardinal) < ℵ₀ ↔ m < ⊤ :=
ofENat_lt_ofENat (n := ⊤)
@[simp] lemma ofENat_lt_nat {m : ℕ∞} {n : ℕ} : ofENat m < n ↔ m < n := by norm_cast
@[simp] lemma ofENat_lt_ofNat {m : ℕ∞} {n : ℕ} [n.AtLeastTwo] :
ofENat m < ofNat(n) ↔ m < OfNat.ofNat n := ofENat_lt_nat
@[simp] lemma nat_lt_ofENat {m : ℕ} {n : ℕ∞} : (m : Cardinal) < n ↔ m < n := by norm_cast
@[simp] lemma ofENat_pos {m : ℕ∞} : 0 < (m : Cardinal) ↔ 0 < m := by norm_cast
@[simp] lemma one_lt_ofENat {m : ℕ∞} : 1 < (m : Cardinal) ↔ 1 < m := by norm_cast
@[simp, norm_cast] lemma ofNat_lt_ofENat {m : ℕ} [m.AtLeastTwo] {n : ℕ∞} :
(ofNat(m) : Cardinal) < n ↔ OfNat.ofNat m < n := nat_lt_ofENat | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | ofENat_lt_aleph0 | null |
ofENat_mono : Monotone ofENat := ofENat_strictMono.monotone
@[simp, norm_cast] | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | ofENat_mono | null |
ofENat_le_ofENat {m n : ℕ∞} : (m : Cardinal) ≤ n ↔ m ≤ n := ofENat_strictMono.le_iff_le
@[gcongr, mono] alias ⟨_, ofENat_le_ofENat_of_le⟩ := ofENat_le_ofENat
@[simp] lemma ofENat_le_aleph0 (n : ℕ∞) : ↑n ≤ ℵ₀ := ofENat_le_ofENat.2 le_top
@[simp] lemma ofENat_le_nat {m : ℕ∞} {n : ℕ} : ofENat m ≤ n ↔ m ≤ n := by norm_cast
@[simp] lemma ofENat_le_one {m : ℕ∞} : ofENat m ≤ 1 ↔ m ≤ 1 := by norm_cast
@[simp] lemma ofENat_le_ofNat {m : ℕ∞} {n : ℕ} [n.AtLeastTwo] :
ofENat m ≤ ofNat(n) ↔ m ≤ OfNat.ofNat n := ofENat_le_nat
@[simp] lemma nat_le_ofENat {m : ℕ} {n : ℕ∞} : (m : Cardinal) ≤ n ↔ m ≤ n := by norm_cast
@[simp] lemma one_le_ofENat {n : ℕ∞} : 1 ≤ (n : Cardinal) ↔ 1 ≤ n := by norm_cast
@[simp] | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | ofENat_le_ofENat | null |
ofNat_le_ofENat {m : ℕ} [m.AtLeastTwo] {n : ℕ∞} :
(ofNat(m) : Cardinal) ≤ n ↔ OfNat.ofNat m ≤ n := nat_le_ofENat | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | ofNat_le_ofENat | null |
ofENat_injective : Injective ofENat := ofENat_strictMono.injective
@[simp, norm_cast] | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | ofENat_injective | null |
ofENat_inj {m n : ℕ∞} : (m : Cardinal) = n ↔ m = n := ofENat_injective.eq_iff
@[simp] lemma ofENat_eq_nat {m : ℕ∞} {n : ℕ} : (m : Cardinal) = n ↔ m = n := by norm_cast
@[simp] lemma nat_eq_ofENat {m : ℕ} {n : ℕ∞} : (m : Cardinal) = n ↔ m = n := by norm_cast
@[simp] lemma ofENat_eq_zero {m : ℕ∞} : (m : Cardinal) = 0 ↔ m = 0 := by norm_cast
@[simp] lemma zero_eq_ofENat {m : ℕ∞} : 0 = (m : Cardinal) ↔ m = 0 := by norm_cast; apply eq_comm
@[simp] lemma ofENat_eq_one {m : ℕ∞} : (m : Cardinal) = 1 ↔ m = 1 := by norm_cast
@[simp] lemma one_eq_ofENat {m : ℕ∞} : 1 = (m : Cardinal) ↔ m = 1 := by norm_cast; apply eq_comm
@[simp] lemma ofENat_eq_ofNat {m : ℕ∞} {n : ℕ} [n.AtLeastTwo] :
(m : Cardinal) = ofNat(n) ↔ m = OfNat.ofNat n := ofENat_eq_nat
@[simp] lemma ofNat_eq_ofENat {m : ℕ} {n : ℕ∞} [m.AtLeastTwo] :
ofNat(m) = (n : Cardinal) ↔ OfNat.ofNat m = n := nat_eq_ofENat
@[simp, norm_cast] lemma lift_ofENat : ∀ m : ℕ∞, lift.{u, v} m = m
| (m : ℕ) => lift_natCast m
| ⊤ => lift_aleph0
@[simp] lemma lift_lt_ofENat {x : Cardinal.{v}} {m : ℕ∞} : lift.{u} x < m ↔ x < m := by
rw [← lift_ofENat.{u, v}, lift_lt]
@[simp] lemma lift_le_ofENat {x : Cardinal.{v}} {m : ℕ∞} : lift.{u} x ≤ m ↔ x ≤ m := by
rw [← lift_ofENat.{u, v}, lift_le]
@[simp] lemma lift_eq_ofENat {x : Cardinal.{v}} {m : ℕ∞} : lift.{u} x = m ↔ x = m := by
rw [← lift_ofENat.{u, v}, lift_inj]
@[simp] lemma ofENat_lt_lift {x : Cardinal.{v}} {m : ℕ∞} : m < lift.{u} x ↔ m < x := by
rw [← lift_ofENat.{u, v}, lift_lt]
@[simp] lemma ofENat_le_lift {x : Cardinal.{v}} {m : ℕ∞} : m ≤ lift.{u} x ↔ m ≤ x := by
rw [← lift_ofENat.{u, v}, lift_le]
@[simp] lemma ofENat_eq_lift {x : Cardinal.{v}} {m : ℕ∞} : m = lift.{u} x ↔ m = x := by
rw [← lift_ofENat.{u, v}, lift_inj]
@[simp] | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | ofENat_inj | null |
range_ofENat : range ofENat = Iic ℵ₀ := by
refine (range_subset_iff.2 ofENat_le_aleph0).antisymm fun x (hx : x ≤ ℵ₀) ↦ ?_
rcases hx.lt_or_eq with hlt | rfl
· lift x to ℕ using hlt
exact mem_range_self (x : ℕ∞)
· exact mem_range_self (⊤ : ℕ∞) | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | range_ofENat | null |
noncomputable toENatAux : Cardinal.{u} → ℕ∞ := extend Nat.cast Nat.cast fun _ ↦ ⊤ | def | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENatAux | Unbundled version of `Cardinal.toENat`. |
toENatAux_nat (n : ℕ) : toENatAux n = n := Nat.cast_injective.extend_apply .. | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENatAux_nat | null |
toENatAux_zero : toENatAux 0 = 0 := toENatAux_nat 0 | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENatAux_zero | null |
toENatAux_eq_top {a : Cardinal} (ha : ℵ₀ ≤ a) : toENatAux a = ⊤ :=
extend_apply' _ _ _ fun ⟨n, hn⟩ ↦ ha.not_gt <| hn ▸ nat_lt_aleph0 n | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENatAux_eq_top | null |
toENatAux_ofENat : ∀ n : ℕ∞, toENatAux n = n
| (n : ℕ) => toENatAux_nat n
| ⊤ => toENatAux_eq_top le_rfl
attribute [local simp] toENatAux_nat toENatAux_zero toENatAux_ofENat | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENatAux_ofENat | null |
toENatAux_gc : GaloisConnection (↑) toENatAux := fun n x ↦ by
cases lt_or_ge x ℵ₀ with
| inl hx => lift x to ℕ using hx; simp
| inr hx => simp [toENatAux_eq_top hx, (ofENat_le_aleph0 n).trans hx] | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENatAux_gc | null |
toENatAux_le_nat {x : Cardinal} {n : ℕ} : toENatAux x ≤ n ↔ x ≤ n := by
cases lt_or_ge x ℵ₀ with
| inl hx => lift x to ℕ using hx; simp
| inr hx => simp [toENatAux_eq_top hx, (nat_lt_aleph0 n).trans_le hx] | theorem | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENatAux_le_nat | null |
toENatAux_eq_nat {x : Cardinal} {n : ℕ} : toENatAux x = n ↔ x = n := by
simp only [le_antisymm_iff, toENatAux_le_nat, ← toENatAux_gc _, ofENat_nat] | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENatAux_eq_nat | null |
toENatAux_eq_zero {x : Cardinal} : toENatAux x = 0 ↔ x = 0 := toENatAux_eq_nat | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENatAux_eq_zero | null |
noncomputable toENat : Cardinal.{u} →+*o ℕ∞ where
toFun := toENatAux
map_one' := toENatAux_nat 1
map_mul' x y := by
wlog hle : x ≤ y; · rw [mul_comm, this y x (le_of_not_ge hle), mul_comm]
cases lt_or_ge y ℵ₀ with
| inl hy =>
lift x to ℕ using hle.trans_lt hy; lift y to ℕ using hy
simp only [← Nat.cast_mul, toENatAux_nat]
| inr hy =>
rcases eq_or_ne x 0 with rfl | hx
· simp
· simp only [toENatAux_eq_top hy]
rw [toENatAux_eq_top, ENat.mul_top]
· rwa [Ne, toENatAux_eq_zero]
· exact le_mul_of_one_le_of_le (one_le_iff_ne_zero.2 hx) hy
map_add' x y := by
wlog hle : x ≤ y; · rw [add_comm, this y x (le_of_not_ge hle), add_comm]
cases lt_or_ge y ℵ₀ with
| inl hy =>
lift x to ℕ using hle.trans_lt hy; lift y to ℕ using hy
simp only [← Nat.cast_add, toENatAux_nat]
| inr hy =>
simp only [toENatAux_eq_top hy, add_top]
exact toENatAux_eq_top <| le_add_left hy
map_zero' := toENatAux_zero
monotone' := toENatAux_gc.monotone_u | def | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENat | Projection from cardinals to `ℕ∞`. Sends all infinite cardinals to `⊤`.
We define this function as a bundled monotone ring homomorphism. |
enat_gc : GaloisConnection (↑) toENat := toENatAux_gc
@[simp] lemma toENat_ofENat (n : ℕ∞) : toENat n = n := toENatAux_ofENat n
@[simp] lemma toENat_comp_ofENat : toENat ∘ (↑) = id := funext toENat_ofENat | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | enat_gc | The coercion `Cardinal.ofENat` and the projection `Cardinal.toENat` form a Galois connection.
See also `Cardinal.gciENat`. |
noncomputable gciENat : GaloisCoinsertion (↑) toENat :=
enat_gc.toGaloisCoinsertion fun n ↦ (toENat_ofENat n).le | def | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | gciENat | The coercion `Cardinal.ofENat` and the projection `Cardinal.toENat`
form a Galois coinsertion. |
toENat_strictMonoOn : StrictMonoOn toENat (Iic ℵ₀) := by
simp only [← range_ofENat, StrictMonoOn, forall_mem_range, toENat_ofENat, ofENat_lt_ofENat]
exact fun _ _ ↦ id | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENat_strictMonoOn | null |
toENat_injOn : InjOn toENat (Iic ℵ₀) := toENat_strictMonoOn.injOn | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENat_injOn | null |
ofENat_toENat_le (a : Cardinal) : ↑(toENat a) ≤ a := enat_gc.l_u_le _
@[simp] | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | ofENat_toENat_le | null |
ofENat_toENat_eq_self {a : Cardinal} : toENat a = a ↔ a ≤ ℵ₀ := by
rw [eq_comm, ← enat_gc.exists_eq_l]
simpa only [mem_range, eq_comm] using Set.ext_iff.1 range_ofENat a
@[simp] alias ⟨_, ofENat_toENat⟩ := ofENat_toENat_eq_self | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | ofENat_toENat_eq_self | null |
toENat_nat (n : ℕ) : toENat n = n := map_natCast _ n
@[simp] lemma toENat_le_nat {a : Cardinal} {n : ℕ} : toENat a ≤ n ↔ a ≤ n := toENatAux_le_nat
@[simp] lemma toENat_eq_nat {a : Cardinal} {n : ℕ} : toENat a = n ↔ a = n := toENatAux_eq_nat
@[simp] lemma toENat_eq_zero {a : Cardinal} : toENat a = 0 ↔ a = 0 := toENatAux_eq_zero
@[simp] lemma toENat_le_one {a : Cardinal} : toENat a ≤ 1 ↔ a ≤ 1 := toENat_le_nat
@[simp] lemma toENat_eq_one {a : Cardinal} : toENat a = 1 ↔ a = 1 := toENat_eq_nat
@[simp] lemma toENat_le_ofNat {a : Cardinal} {n : ℕ} [n.AtLeastTwo] :
toENat a ≤ ofNat(n) ↔ a ≤ OfNat.ofNat n := toENat_le_nat
@[simp] lemma toENat_eq_ofNat {a : Cardinal} {n : ℕ} [n.AtLeastTwo] :
toENat a = ofNat(n) ↔ a = OfNat.ofNat n := toENat_eq_nat
@[simp] lemma toENat_eq_top {a : Cardinal} : toENat a = ⊤ ↔ ℵ₀ ≤ a := enat_gc.u_eq_top | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENat_nat | null |
toENat_ne_top {a : Cardinal} : toENat a ≠ ⊤ ↔ a < ℵ₀ := by simp
@[simp] lemma toENat_lt_top {a : Cardinal} : toENat a < ⊤ ↔ a < ℵ₀ := by simp [lt_top_iff_ne_top]
@[simp] | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENat_ne_top | null |
toENat_lift {a : Cardinal.{v}} : toENat (lift.{u} a) = toENat a := by
cases le_total a ℵ₀ with
| inl ha => lift a to ℕ∞ using ha; simp
| inr ha => simp [toENat_eq_top.2, ha] | theorem | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENat_lift | null |
toENat_congr {α : Type u} {β : Type v} (e : α ≃ β) : toENat #α = toENat #β := by
rw [← toENat_lift, lift_mk_eq.{_, _,v}.mpr ⟨e⟩, toENat_lift] | theorem | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENat_congr | null |
toENat_le_iff_of_le_aleph0 {c c' : Cardinal} (h : c ≤ ℵ₀) :
toENat c ≤ toENat c' ↔ c ≤ c' := by
lift c to ℕ∞ using h
simp_rw [toENat_ofENat, enat_gc _] | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENat_le_iff_of_le_aleph0 | null |
toENat_le_iff_of_lt_aleph0 {c c' : Cardinal} (hc' : c' < ℵ₀) :
toENat c ≤ toENat c' ↔ c ≤ c' := by
lift c' to ℕ using hc'
simp_rw [toENat_nat, ← toENat_le_nat] | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENat_le_iff_of_lt_aleph0 | null |
toENat_eq_iff_of_le_aleph0 {c c' : Cardinal} (hc : c ≤ ℵ₀) (hc' : c' ≤ ℵ₀) :
toENat c = toENat c' ↔ c = c' :=
toENat_strictMonoOn.injOn.eq_iff hc hc'
@[simp, norm_cast] | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | toENat_eq_iff_of_le_aleph0 | null |
ofENat_add (m n : ℕ∞) : ofENat (m + n) = m + n := by apply toENat_injOn <;> simp
@[simp] lemma aleph0_add_ofENat (m : ℕ∞) : ℵ₀ + m = ℵ₀ := (ofENat_add ⊤ m).symm
@[simp] lemma ofENat_add_aleph0 (m : ℕ∞) : m + ℵ₀ = ℵ₀ := by rw [add_comm, aleph0_add_ofENat]
@[simp] lemma ofENat_mul_aleph0 {m : ℕ∞} (hm : m ≠ 0) : ↑m * ℵ₀ = ℵ₀ := by
induction m with
| top => exact aleph0_mul_aleph0
| coe m => rw [ofENat_nat, nat_mul_aleph0 (mod_cast hm)]
@[simp] lemma aleph0_mul_ofENat {m : ℕ∞} (hm : m ≠ 0) : ℵ₀ * m = ℵ₀ := by
rw [mul_comm, ofENat_mul_aleph0 hm]
@[simp] lemma ofENat_mul (m n : ℕ∞) : ofENat (m * n) = m * n :=
toENat_injOn (by simp)
(aleph0_mul_aleph0 ▸ mul_le_mul' (ofENat_le_aleph0 _) (ofENat_le_aleph0 _)) (by simp) | lemma | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | ofENat_add | null |
ofENatHom : ℕ∞ →+*o Cardinal where
toFun := (↑)
map_one' := ofENat_one
map_mul' := ofENat_mul
map_zero' := ofENat_zero
map_add' := ofENat_add
monotone' := ofENat_mono | def | SetTheory | [
"Mathlib.Algebra.Order.Hom.Ring",
"Mathlib.Data.ENat.Basic",
"Mathlib.SetTheory.Cardinal.Basic"
] | Mathlib/SetTheory/Cardinal/ENat.lean | ofENatHom | The coercion `Cardinal.ofENat` as a bundled homomorphism. |
protected card (α : Type*) : ℕ :=
toNat (mk α)
@[simp] | def | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card | `Nat.card α` is the cardinality of `α` as a natural number.
If `α` is infinite, `Nat.card α = 0`. |
card_eq_fintype_card [Fintype α] : Nat.card α = Fintype.card α :=
mk_toNat_eq_card | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_eq_fintype_card | null |
_root_.Fintype.card_eq_nat_card {_ : Fintype α} : Fintype.card α = Nat.card α :=
mk_toNat_eq_card.symm | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | _root_.Fintype.card_eq_nat_card | Because this theorem takes `Fintype α` as a non-instance argument, it can be used in particular
when `Fintype.card` ends up with different instance than the one found by inference |
card_eq_finsetCard (s : Finset α) : Nat.card s = s.card := by
simp only [Nat.card_eq_fintype_card, Fintype.card_coe] | lemma | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_eq_finsetCard | null |
card_eq_card_toFinset (s : Set α) [Fintype s] : Nat.card s = s.toFinset.card := by
simp only [← Nat.card_eq_finsetCard, s.mem_toFinset] | lemma | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_eq_card_toFinset | null |
card_eq_card_finite_toFinset {s : Set α} (hs : s.Finite) : Nat.card s = hs.toFinset.card := by
simp only [← Nat.card_eq_finsetCard, hs.mem_toFinset] | lemma | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_eq_card_finite_toFinset | null |
subtype_card {p : α → Prop} (s : Finset α) (H : ∀ x : α, x ∈ s ↔ p x) :
Nat.card { x // p x } = Finset.card s := by
rw [← Fintype.subtype_card s H, Fintype.card_eq_nat_card]
@[simp] theorem card_of_isEmpty [IsEmpty α] : Nat.card α = 0 := by simp [Nat.card]
@[simp] lemma card_eq_zero_of_infinite [Infinite α] : Nat.card α = 0 := mk_toNat_of_infinite | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | subtype_card | null |
cast_card [Finite α] : (Nat.card α : Cardinal) = Cardinal.mk α := by
rw [Nat.card, Cardinal.cast_toNat_of_lt_aleph0]
exact Cardinal.lt_aleph0_of_finite _ | lemma | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | cast_card | null |
_root_.Set.Infinite.card_eq_zero {s : Set α} (hs : s.Infinite) : Nat.card s = 0 :=
@card_eq_zero_of_infinite _ hs.to_subtype | lemma | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | _root_.Set.Infinite.card_eq_zero | null |
card_eq_zero : Nat.card α = 0 ↔ IsEmpty α ∨ Infinite α := by
simp [Nat.card, mk_eq_zero_iff, aleph0_le_mk_iff] | lemma | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_eq_zero | null |
card_ne_zero : Nat.card α ≠ 0 ↔ Nonempty α ∧ Finite α := by simp [card_eq_zero, not_or] | lemma | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_ne_zero | null |
card_pos_iff : 0 < Nat.card α ↔ Nonempty α ∧ Finite α := by
simp [Nat.card, mk_eq_zero_iff, mk_lt_aleph0_iff]
@[simp] lemma card_pos [Nonempty α] [Finite α] : 0 < Nat.card α := card_pos_iff.2 ⟨‹_›, ‹_›⟩ | lemma | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_pos_iff | null |
finite_of_card_ne_zero (h : Nat.card α ≠ 0) : Finite α := (card_ne_zero.1 h).2 | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | finite_of_card_ne_zero | null |
card_congr (f : α ≃ β) : Nat.card α = Nat.card β :=
Cardinal.toNat_congr f | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_congr | null |
card_le_card_of_injective {α : Type u} {β : Type v} [Finite β] (f : α → β)
(hf : Injective f) : Nat.card α ≤ Nat.card β := by
simpa using toNat_le_toNat (lift_mk_le_lift_mk_of_injective hf) (by simp) | lemma | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_le_card_of_injective | null |
card_le_card_of_surjective {α : Type u} {β : Type v} [Finite α] (f : α → β)
(hf : Surjective f) : Nat.card β ≤ Nat.card α := by
have : lift.{u} #β ≤ lift.{v} #α := mk_le_of_surjective (ULift.map_surjective.2 hf)
simpa using toNat_le_toNat this (by simp) | lemma | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_le_card_of_surjective | null |
card_eq_of_bijective (f : α → β) (hf : Function.Bijective f) : Nat.card α = Nat.card β :=
card_congr (Equiv.ofBijective f hf) | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_eq_of_bijective | null |
protected bijective_iff_injective_and_card [Finite β] (f : α → β) :
Bijective f ↔ Injective f ∧ Nat.card α = Nat.card β := by
rw [Bijective, and_congr_right_iff]
intro h
have := Fintype.ofFinite β
have := Fintype.ofInjective f h
revert h
rw [← and_congr_right_iff, ← Bijective,
card_eq_fintype_card, card_eq_fintype_card, Fintype.bijective_iff_injective_and_card] | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | bijective_iff_injective_and_card | null |
protected bijective_iff_surjective_and_card [Finite α] (f : α → β) :
Bijective f ↔ Surjective f ∧ Nat.card α = Nat.card β := by
classical
rw [_root_.and_comm, Bijective, and_congr_left_iff]
intro h
have := Fintype.ofFinite α
have := Fintype.ofSurjective f h
revert h
rw [← and_congr_left_iff, ← Bijective, ← and_comm,
card_eq_fintype_card, card_eq_fintype_card, Fintype.bijective_iff_surjective_and_card] | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | bijective_iff_surjective_and_card | null |
_root_.Function.Injective.bijective_of_nat_card_le [Finite β] {f : α → β}
(inj : Injective f) (hc : Nat.card β ≤ Nat.card α) : Bijective f :=
(Nat.bijective_iff_injective_and_card f).mpr
⟨inj, hc.antisymm (card_le_card_of_injective f inj) |>.symm⟩ | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | _root_.Function.Injective.bijective_of_nat_card_le | null |
_root_.Function.Surjective.bijective_of_nat_card_le [Finite α] {f : α → β}
(surj : Surjective f) (hc : Nat.card α ≤ Nat.card β) : Bijective f :=
(Nat.bijective_iff_surjective_and_card f).mpr
⟨surj, hc.antisymm (card_le_card_of_surjective f surj)⟩ | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | _root_.Function.Surjective.bijective_of_nat_card_le | null |
card_eq_of_equiv_fin {α : Type*} {n : ℕ} (f : α ≃ Fin n) : Nat.card α = n := by
simpa only [card_eq_fintype_card, Fintype.card_fin] using card_congr f | theorem | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_eq_of_equiv_fin | null |
card_fin (n : ℕ) : Nat.card (Fin n) = n := by
rw [Nat.card_eq_fintype_card, Fintype.card_fin] | lemma | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_fin | null |
card_mono (ht : t.Finite) (h : s ⊆ t) : Nat.card s ≤ Nat.card t :=
toNat_le_toNat (mk_le_mk_of_subset h) ht.lt_aleph0 | lemma | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_mono | null |
card_image_le {f : α → β} (hs : s.Finite) : Nat.card (f '' s) ≤ Nat.card s :=
have := hs.to_subtype
card_le_card_of_surjective (imageFactorization f s) imageFactorization_surjective | lemma | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_image_le | null |
card_image_of_injOn {f : α → β} (hf : s.InjOn f) : Nat.card (f '' s) = Nat.card s := by
classical
obtain hs | hs := s.finite_or_infinite
· have := hs.fintype
have := fintypeImage s f
simp_rw [Nat.card_eq_fintype_card, Set.card_image_of_inj_on hf]
· have := hs.to_subtype
have := (hs.image hf).to_subtype
simp [Nat.card_eq_zero_of_infinite] | lemma | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_image_of_injOn | null |
card_image_of_injective {f : α → β} (hf : Injective f) (s : Set α) :
Nat.card (f '' s) = Nat.card s := card_image_of_injOn hf.injOn | lemma | SetTheory | [
"Mathlib.Data.ULift",
"Mathlib.Data.ZMod.Defs",
"Mathlib.SetTheory.Cardinal.ToNat",
"Mathlib.SetTheory.Cardinal.ENat"
] | Mathlib/SetTheory/Cardinal/Finite.lean | card_image_of_injective | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.