Mathlib.Data.ENat.Basic
109 declarations and 23 deprecated aliases. Mathlib docs · Source
instance instOneENat E0 #
One ℕ∞
instance instLinearOrderENat E0 #
LinearOrder ℕ∞
instance instSubENat E0 #
Sub ℕ∞
instance instOrderBotENat E0 #
OrderBot ℕ∞
instance instAddENat E0 #
Add ℕ∞
instance instPreorderENat E0 #
Preorder ℕ∞
instance instLEENat E0 #
LE ℕ∞
instance instWellFoundedLTENat E0 #
WellFoundedLT ℕ∞
instance instZeroENat E0 #
Zero ℕ∞
instance instNontrivialENat E0 #
Nontrivial ℕ∞
instance instOrderTopENat E0 #
OrderTop ℕ∞
instance instLTENat E0 #
LT ℕ∞
instance instZeroLEOneClassENat E0 #
ZeroLEOneClass ℕ∞
instance instBotENat E0 #
Bot ℕ∞
theorem ENat.some_eq_natCast E0 #
WithTop.some = Nat.cast
Lemmas about WithTop expect (and can output) WithTop.some but the normal form for coercion
ℕ → ℕ∞ is Nat.cast.
theorem ENat.natCast_inj E1 #
∀ {a b : ℕ}, ↑a = ↑b ↔ a = b
theorem ENat.natCast_zero E1 #
↑0 = 0
theorem ENat.natCast_one E1 #
↑1 = 1
theorem ENat.natCast_add E1 #
∀ (m n : ℕ), ↑(m + n) = ↑m + ↑n
theorem ENat.natCast_sub E0 #
∀ (m n : ℕ), ↑(m - n) = ↑m - ↑n
theorem ENat.ofNat_eq_natCast_ofNat E1 #
∀ (n : ℕ) [inst : n.AtLeastTwo], OfNat.ofNat n = ↑(OfNat.ofNat n)
Nat.cast_ofNat specialised to ℕ∞, so that basify can register the numeral as an
operation; the generic lemma is stated over a variable type and carries no usable head symbol.
theorem ENat.natCast_lt_top E0 #
∀ (n : ℕ), ↑n < ⊤
def ENat.lift E1 #
(x : ℕ∞) → x < ⊤ → ℕ
Convert a ℕ∞ to a ℕ using a proof that it is not infinite.
theorem ENat.natCast_lift E0 #
∀ (x : ℕ∞) (h : x < ⊤), ↑(x.lift h) = x
theorem ENat.lift_natCast E0 #
∀ (n : ℕ), (↑n).lift ⋯ = n
theorem ENat.lift_lt_iff E0 #
∀ {x : ℕ∞} {h : x < ⊤} {n : ℕ}, x.lift h < n ↔ x < ↑n
theorem ENat.lift_le_iff E0 #
∀ {x : ℕ∞} {h : x < ⊤} {n : ℕ}, x.lift h ≤ n ↔ x ≤ ↑n
theorem ENat.lt_lift_iff E0 #
∀ {x : ℕ} {n : ℕ∞} {h : n < ⊤}, x < n.lift h ↔ ↑x < n
theorem ENat.le_lift_iff E0 #
∀ {x : ℕ} {n : ℕ∞} {h : n < ⊤}, x ≤ n.lift h ↔ ↑x ≤ n
theorem ENat.lift_zero E0 #
ENat.lift 0 ⋯ = 0
theorem ENat.lift_one E0 #
ENat.lift 1 ⋯ = 1
theorem ENat.lift_ofNat E0 #
∀ (n : ℕ) [inst : n.AtLeastTwo], (OfNat.ofNat n).lift ⋯ = OfNat.ofNat n
theorem ENat.add_lt_top E0 #
∀ {a b : ℕ∞}, a + b < ⊤ ↔ a < ⊤ ∧ b < ⊤
theorem ENat.add_eq_top E0 #
∀ {a b : ℕ∞}, a + b = ⊤ ↔ a = ⊤ ∨ b = ⊤
instance ENat.canLift E0 #
CanLift ℕ∞ ℕ Nat.cast fun x ↦ x ≠ ⊤
instance ENat.instWellFoundedRelation E0 #
WellFoundedRelation ℕ∞
def ENat.toNat E1 #
ℕ∞ → ℕ
Conversion of ℕ∞ to ℕ sending ∞ to 0.
theorem ENat.toNat_natCast E0 #
∀ (n : ℕ), (↑n).toNat = n
theorem ENat.toNat_zero E0 #
ENat.toNat 0 = 0
theorem ENat.toNat_one E0 #
ENat.toNat 1 = 1
theorem ENat.toNat_ofNat E0 #
∀ (n : ℕ) [inst : n.AtLeastTwo], (OfNat.ofNat n).toNat = n
theorem ENat.toNat_top E0 #
⊤.toNat = 0
theorem ENat.toNat_eq_zero E0 #
∀ {n : ℕ∞}, n.toNat = 0 ↔ n = 0 ∨ n = ⊤
theorem ENat.toNat_pos E1 #
∀ {n : ℕ∞}, n ≠ 0 → n ≠ ⊤ → 0 < n.toNat
theorem ENat.lift_eq_toNat_of_lt_top E1 #
∀ {x : ℕ∞} (hx : x < ⊤), x.lift hx = x.toNat
theorem ENat.recTopCoe_zero E0 #
∀ {C : ℕ∞ → Sort u_1} (d : C ⊤) (f : (a : ℕ) → C ↑a), ENat.recTopCoe d f 0 = f 0
theorem ENat.recTopCoe_one E0 #
∀ {C : ℕ∞ → Sort u_1} (d : C ⊤) (f : (a : ℕ) → C ↑a), ENat.recTopCoe d f 1 = f 1
theorem ENat.recTopCoe_ofNat E0 #
∀ {C : ℕ∞ → Sort u_1} (d : C ⊤) (f : (a : ℕ) → C ↑a) (x : ℕ) [inst : x.AtLeastTwo],
ENat.recTopCoe d f (OfNat.ofNat x) = f (OfNat.ofNat x)
theorem ENat.top_ne_natCast E0 #
∀ (a : ℕ), ⊤ ≠ ↑a
theorem ENat.top_ne_ofNat E0 #
∀ (a : ℕ) [inst : a.AtLeastTwo], ⊤ ≠ OfNat.ofNat a
theorem ENat.top_ne_zero E0 #
⊤ ≠ 0
theorem ENat.top_ne_one E0 #
⊤ ≠ 1
theorem ENat.natCast_ne_top E0 #
∀ (a : ℕ), ↑a ≠ ⊤
theorem ENat.ofNat_ne_top E0 #
∀ (a : ℕ) [inst : a.AtLeastTwo], OfNat.ofNat a ≠ ⊤
theorem ENat.zero_ne_top E0 #
0 ≠ ⊤
theorem ENat.one_ne_top E0 #
1 ≠ ⊤
theorem ENat.top_sub_natCast E0 #
∀ (a : ℕ), ⊤ - ↑a = ⊤
theorem ENat.top_sub_one E0 #
⊤ - 1 = ⊤
theorem ENat.top_sub_ofNat E0 #
∀ (a : ℕ) [inst : a.AtLeastTwo], ⊤ - OfNat.ofNat a = ⊤
theorem ENat.top_pos E0 #
0 < ⊤
theorem ENat.one_lt_top E0 #
1 < ⊤
theorem ENat.sub_top E0 #
∀ (a : ℕ∞), a - ⊤ = 0
theorem ENat.natCast_toNat_eq_self E0 #
∀ {n : ℕ∞}, ↑n.toNat = n ↔ n ≠ ⊤
theorem ENat.natCast_toNat E1 #
∀ {n : ℕ∞}, n ≠ ⊤ → ↑n.toNat = n
Alias of the reverse direction of ENat.natCast_toNat_eq_self.
theorem ENat.le_natCast_toNat_self_iff E0 #
∀ {n : ℕ∞}, n ≤ ↑n.toNat ↔ n ≠ ⊤
theorem ENat.toNat_eq_iff_eq_natCast E0 #
∀ (n : ℕ∞) (m : ℕ) [NeZero m], n.toNat = m ↔ n = ↑m
theorem ENat.toNat_eq_iff E0 #
∀ {m : ℕ∞} {n : ℕ}, n ≠ 0 → (m.toNat = n ↔ m = ↑n)
theorem ENat.natCast_toNat_le_self E1 #
∀ (n : ℕ∞), ↑n.toNat ≤ n
theorem ENat.toNat_add E1 #
∀ {m n : ℕ∞}, m ≠ ⊤ → n ≠ ⊤ → (m + n).toNat = m.toNat + n.toNat
theorem ENat.toNat_sub E1 #
∀ {n : ℕ∞}, n ≠ ⊤ → ∀ (m : ℕ∞), (m - n).toNat = m.toNat - n.toNat
theorem ENat.add_le_add_iff_left E1 #
∀ {m n k : ℕ∞}, k ≠ ⊤ → (k + n ≤ k + m ↔ n ≤ m)
theorem ENat.add_le_add_iff_right E1 #
∀ {m n k : ℕ∞}, k ≠ ⊤ → (n + k ≤ m + k ↔ n ≤ m)
theorem ENat.le_natCast_iff E0 #
∀ {n : ℕ∞} {k : ℕ}, n ≤ ↑k ↔ ∃ n₀, n = ↑n₀ ∧ n₀ ≤ k
theorem ENat.add_lt_add_iff_right E1 #
∀ {m n k : ℕ∞}, k ≠ ⊤ → (n + k < m + k ↔ n < m)
theorem ENat.add_lt_add_iff_left E1 #
∀ {m n k : ℕ∞}, k ≠ ⊤ → (k + n < k + m ↔ n < m)
theorem ENat.add_lt_add E1 #
∀ {a b c d : ℕ∞}, a < c → b < d → a + b < c + d
theorem ENat.add_lt_add_of_le_of_lt E1 #
∀ {a b c d : ℕ∞}, a ≠ ⊤ → a ≤ b → c < d → a + c < b + d
theorem ENat.add_lt_add_of_lt_of_le E1 #
∀ {a b c d : ℕ∞}, c ≠ ⊤ → a < b → c ≤ d → a + c < b + d
theorem ENat.natCast_lt_natCast E1 #
∀ {n m : ℕ}, ↑n < ↑m ↔ n < m
theorem ENat.natCast_le_natCast E1 #
∀ {n m : ℕ}, ↑n ≤ ↑m ↔ n ≤ m
theorem ENat.toNat_le_of_le_natCast E1 #
∀ {m : ℕ∞} {n : ℕ}, m ≤ ↑n → m.toNat ≤ n
theorem ENat.toNat_le_toNat E1 #
∀ {m n : ℕ∞}, m ≤ n → n ≠ ⊤ → m.toNat ≤ n.toNat
theorem ENat.nat_induction E1 #
∀ {motive : ℕ∞ → Prop} (a : ℕ∞),
motive 0 → (∀ (n : ℕ), motive ↑n → motive ↑n.succ) → ((∀ (n : ℕ), motive ↑n) → motive ⊤) → motive a
theorem ENat.ne_top_iff_exists E1 #
∀ {n : ℕ∞}, n ≠ ⊤ ↔ ∃ m, ↑m = n
theorem ENat.forall_ne_top E1 #
∀ {p : ℕ∞ → Prop}, (∀ (x : ℕ∞), x ≠ ⊤ → p x) ↔ ∀ (x : ℕ), p ↑x
theorem ENat.exists_ne_top E1 #
∀ {p : ℕ∞ → Prop}, (∃ x, x ≠ ⊤ ∧ p x) ↔ ∃ x, p ↑x
theorem ENat.forall_natCast_le_iff_le E1 #
∀ {m n : ℕ∞}, (∀ (a : ℕ), ↑a ≤ m → ↑a ≤ n) ↔ m ≤ n
Version of WithTop.forall_natCast_le_iff_le using Nat.cast rather than WithTop.some.
theorem ENat.exists_nat_gt E1 #
∀ {n : ℕ∞}, n ≠ ⊤ → ∃ m, n < ↑m
theorem ENat.sub_eq_top_iff E0 #
∀ {a b : ℕ∞}, a - b = ⊤ ↔ a = ⊤ ∧ b ≠ ⊤
theorem ENat.sub_ne_top_iff E0 #
∀ {a b : ℕ∞}, a - b ≠ ⊤ ↔ a ≠ ⊤ ∨ b = ⊤
theorem ENat.addLECancellable_iff_ne_top E0 #
∀ {a : ℕ∞}, AddLECancellable a ↔ a ≠ ⊤
theorem ENat.addLECancellable_of_ne_top E1 #
∀ {a : ℕ∞}, a ≠ ⊤ → AddLECancellable a
theorem ENat.addLECancellable_of_lt_top E1 #
∀ {a : ℕ∞}, a < ⊤ → AddLECancellable a
theorem ENat.addLECancellable_natCast E1 #
∀ (a : ℕ), AddLECancellable ↑a
def ENat.map E1 #
{α : Type u_1} → (ℕ → α) → ℕ∞ → WithTop α
Specialization of WithTop.map to ENat.
theorem ENat.map_top E0 #
∀ {α : Type u_1} (f : ℕ → α), ENat.map f ⊤ = ⊤
theorem ENat.map_natCast E0 #
∀ {α : Type u_1} (f : ℕ → α) (a : ℕ), ENat.map f ↑a = ↑(f a)
theorem ENat.map_zero E0 #
∀ {α : Type u_1} (f : ℕ → α), ENat.map f 0 = ↑(f 0)
theorem ENat.map_one E0 #
∀ {α : Type u_1} (f : ℕ → α), ENat.map f 1 = ↑(f 1)
theorem ENat.map_ofNat E0 #
∀ {α : Type u_1} (f : ℕ → α) (n : ℕ) [inst : n.AtLeastTwo], ENat.map f (OfNat.ofNat n) = ↑(f n)
theorem ENat.map_eq_top_iff E0 #
∀ {n : ℕ∞} {α : Type u_1} {f : ℕ → α}, ENat.map f n = ⊤ ↔ n = ⊤
theorem ENat.strictMono_map_iff E0 #
∀ {α : Type u_1} {f : ℕ → α} [inst : Preorder α], StrictMono (ENat.map f) ↔ StrictMono f
theorem ENat.monotone_map_iff E0 #
∀ {α : Type u_1} {f : ℕ → α} [inst : Preorder α], Monotone (ENat.map f) ↔ Monotone f
theorem ENat.map_add E0 #
∀ {β : Type u_2} {F : Type u_3} [inst : Add β] [inst_1 : FunLike F ℕ β] [AddHomClass F ℕ β] (f : F) (a b : ℕ∞),
ENat.map (⇑f) (a + b) = ENat.map (⇑f) a + ENat.map (⇑f) b
def OneHom.ENatMap E1 #
{N : Type u_2} → [inst : One N] → OneHom ℕ N → OneHom ℕ∞ (WithTop N)
A version of ENat.map for OneHoms.
def ZeroHom.ENatMap E1 #
{N : Type u_2} → [inst : Zero N] → ZeroHom ℕ N → ZeroHom ℕ∞ (WithTop N)
A version of ENat.map for ZeroHoms.
def AddHom.ENatMap E1 #
{N : Type u_2} → [inst : Add N] → (ℕ →ₙ+ N) → ℕ∞ →ₙ+ WithTop N
A version of WithTop.map for AddHoms.
theorem AddHom.ENatMap_apply E0 #
∀ {N : Type u_2} [inst : Add N] (f : ℕ →ₙ+ N), ⇑f.ENatMap = ENat.map ⇑f
theorem ENat.WithBot.coe_eq_natCast E0 #
∀ (n : ℕ), ↑↑n = ↑n
Deprecated aliases
| Name | New name | Since |
|---|---|---|
ENat.addLECancellable_coe | ENat.addLECancellable_natCast | 2026-07-17 |
ENat.coe_add | ENat.natCast_add | 2026-07-17 |
ENat.coe_inj | ENat.natCast_inj | 2026-07-17 |
ENat.coe_le_coe | ENat.natCast_le_natCast | 2026-07-17 |
ENat.coe_lift | ENat.natCast_lift | 2026-07-17 |
ENat.coe_lt_coe | ENat.natCast_lt_natCast | 2026-07-17 |
ENat.coe_lt_top | ENat.natCast_lt_top | 2026-07-17 |
ENat.coe_ne_top | ENat.natCast_ne_top | 2026-07-17 |
ENat.coe_one | ENat.natCast_one | 2026-07-17 |
ENat.coe_sub | ENat.natCast_sub | 2026-07-17 |
ENat.coe_toNat | ENat.natCast_toNat | 2026-07-17 |
ENat.coe_toNat_eq_self | ENat.natCast_toNat_eq_self | 2026-07-17 |
ENat.coe_toNat_le_self | ENat.natCast_toNat_le_self | 2026-07-17 |
ENat.coe_zero | ENat.natCast_zero | 2026-07-17 |
ENat.le_coe_iff | ENat.le_natCast_iff | 2026-07-17 |
ENat.lift_coe | ENat.lift_natCast | 2026-07-17 |
ENat.map_coe | ENat.map_natCast | 2026-07-17 |
ENat.some_eq_coe | ENat.some_eq_natCast | 2026-07-17 |
ENat.toNat_coe | ENat.toNat_natCast | 2026-07-17 |
ENat.toNat_eq_iff_eq_coe | ENat.toNat_eq_iff_eq_natCast | 2026-07-17 |
ENat.toNat_le_of_le_coe | ENat.toNat_le_of_le_natCast | 2026-07-17 |
ENat.top_ne_coe | ENat.top_ne_natCast | 2026-07-17 |
ENat.top_sub_coe | ENat.top_sub_natCast | 2026-07-17 |