Natural numbers with infinity #
The natural numbers and an extra top
element ⊤
. This implementation uses Part ℕ
as an
implementation. Use ℕ∞
instead unless you care about computability.
Main definitions #
The following instances are defined:
There is no additive analogue of MonoidWithZero
; if there were then PartENat
could
be an AddMonoidWithTop
.
toWithTop
: the map fromPartENat
toℕ∞
, with theorems that it plays well with+
and≤
.withTopAddEquiv : PartENat ≃+ ℕ∞
withTopOrderIso : PartENat ≃o ℕ∞
Implementation details #
PartENat
is defined to be Part ℕ
.
+
and ≤
are defined on PartENat
, but there is an issue with *
because it's not
clear what 0 * ⊤
should be. mul
is hence left undefined. Similarly ⊤ - ⊤
is ambiguous
so there is no -
defined on PartENat
.
Before the open scoped Classical
line, various proofs are made with decidability assumptions.
This can cause issues -- see for example the non-simp lemma toWithTopZero
proved by rfl
,
followed by @[simp] lemma toWithTopZero'
whose proof uses convert
.
Tags #
PartENat, ℕ∞
The computable embedding ℕ → PartENat
.
This coincides with the coercion coe : ℕ → PartENat
, see PartENat.some_eq_natCast
.
Equations
Instances For
Equations
- PartENat.instInhabited = { default := 0 }
Equations
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.
Alias of Nat.cast_inj
specialized to PartENat
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
- PartENat.orderBot = { toBot := PartENat.instBot, bot_le := PartENat.orderBot._proof_26 }
Equations
- PartENat.orderTop = { toTop := PartENat.instTop, le_top := PartENat.orderTop._proof_27 }
Alias of Nat.cast_le
specialized to PartENat
Alias of Nat.cast_lt
specialized to PartENat
Equations
- One or more equations did not get rendered due to their size.
Equations
- PartENat.boundedOrder = { toOrderTop := PartENat.orderTop, toOrderBot := PartENat.orderBot }
Equations
- PartENat.lattice = { toSemilatticeSup := PartENat.semilatticeSup, inf := min, inf_le_left := ⋯, inf_le_right := ⋯, le_inf := ⋯ }
Equations
- PartENat.instCoeENat = { coe := PartENat.ofENat }
Equiv
between PartENat
and ℕ∞
(for the order isomorphism see
withTopOrderIso
).
Equations
- PartENat.withTopEquiv = { toFun := fun (x : PartENat) => x.toWithTop, invFun := fun (x : ℕ∞) => ↑x, left_inv := PartENat.withTopEquiv._proof_48, right_inv := PartENat.withTopEquiv._proof_49 }
Instances For
toWithTop
induces an order isomorphism between PartENat
and ℕ∞
.
Equations
- PartENat.withTopOrderIso = { toEquiv := PartENat.withTopEquiv, map_rel_iff' := ⋯ }
Instances For
toWithTop
induces an additive monoid isomorphism between PartENat
and ℕ∞
.
Equations
- PartENat.withTopAddEquiv = { toEquiv := PartENat.withTopEquiv, map_add' := PartENat.withTopAddEquiv._proof_50 }
Instances For
Equations
- PartENat.wellFoundedRelation = { rel := fun (x1 x2 : PartENat) => x1 < x2, wf := PartENat.lt_wf }
The smallest PartENat
satisfying a (decidable) predicate P : ℕ → Prop
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.