Definition and basic properties of extended natural numbers #
In this file we define ENat
(notation: ℕ∞
) to be WithTop ℕ
and prove some basic lemmas
about this type.
Implementation details #
There are two natural coercions from ℕ
to WithTop ℕ = ENat
: WithTop.some
and Nat.cast
. In
Lean 3, this difference was hidden in typeclass instances. Since these instances were definitionally
equal, we did not duplicate generic lemmas about WithTop α
and WithTop.some
coercion for ENat
and Nat.cast
coercion. If you need to apply a lemma about WithTop
, you may either rewrite back
and forth using ENat.some_eq_coe
, or restate the lemma for ENat
.
Extended natural numbers ℕ∞ = WithTop ℕ
.
Equations
- «termℕ∞» = Lean.ParserDescr.node `termℕ∞ 1024 (Lean.ParserDescr.symbol "ℕ∞")
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Lemmas about WithTop
expect (and can output) WithTop.some
but the normal form for coercion
ℕ → ℕ∞
is Nat.cast
.
Equations
- ENat.instWellFoundedRelationENat = { rel := fun x x_1 => x < x_1, wf := ENat.instWellFoundedRelationENat.proof_1 }
Conversion of ℕ∞
to ℕ
sending ∞
to 0
.
Equations
- ENat.toNat = { toZeroHom := { toFun := WithTop.untop' 0, map_zero' := ENat.toNat.proof_1 }, map_one' := ENat.toNat.proof_2, map_mul' := ENat.toNat.proof_3 }
Instances For
Alias of the reverse direction of ENat.coe_toNat_eq_self
.