Order-related type synonyms #
In this file we define WithBot
, WithTop
, ENat
, and PNat
.
The definitions were moved to this file without any theory
so that, e.g., Data/Countable/Basic
can prove Countable ENat
without exploding its imports.
Equations
- WithBot.instRepr = { reprPrec := fun (o : WithBot α) (x : ℕ) => match o with | none => Std.Format.text "⊥" | some a => Std.Format.text "↑" ++ repr a }
def
WithBot.recBotCoe
{α : Type u_1}
{C : WithBot α → Sort u_2}
(bot : C ⊥)
(coe : (a : α) → C ↑a)
(n : WithBot α)
:
C n
Recursor for WithBot
using the preferred forms ⊥
and ↑a
.
Equations
- WithBot.recBotCoe bot coe none = bot
- WithBot.recBotCoe bot coe (some a) = coe a
Instances For
@[simp]
theorem
WithBot.recBotCoe_bot
{α : Type u_1}
{C : WithBot α → Sort u_2}
(d : C ⊥)
(f : (a : α) → C ↑a)
:
WithBot.recBotCoe d f ⊥ = d
@[simp]
theorem
WithBot.recBotCoe_coe
{α : Type u_1}
{C : WithBot α → Sort u_2}
(d : C ⊥)
(f : (a : α) → C ↑a)
(x : α)
:
WithBot.recBotCoe d f ↑x = f x
Equations
- WithTop.instRepr = { reprPrec := fun (o : WithTop α) (x : ℕ) => match o with | none => Std.Format.text "⊤" | some a => Std.Format.text "↑" ++ repr a }
def
WithTop.recTopCoe
{α : Type u_1}
{C : WithTop α → Sort u_2}
(top : C ⊤)
(coe : (a : α) → C ↑a)
(n : WithTop α)
:
C n
Recursor for WithTop
using the preferred forms ⊤
and ↑a
.
Equations
- WithTop.recTopCoe top coe none = top
- WithTop.recTopCoe top coe (some a) = coe a
Instances For
@[simp]
theorem
WithTop.recTopCoe_top
{α : Type u_1}
{C : WithTop α → Sort u_2}
(d : C ⊤)
(f : (a : α) → C ↑a)
:
WithTop.recTopCoe d f ⊤ = d
@[simp]
theorem
WithTop.recTopCoe_coe
{α : Type u_1}
{C : WithTop α → Sort u_2}
(d : C ⊤)
(f : (a : α) → C ↑a)
(x : α)
:
WithTop.recTopCoe d f ↑x = f x
Extended natural numbers ℕ∞ = WithTop ℕ
.
Equations
- «termℕ∞» = Lean.ParserDescr.node `termℕ∞ 1024 (Lean.ParserDescr.symbol "ℕ∞")
Instances For
Recursor for ENat
using the preferred forms ⊤
and ↑a
.
Equations
- ENat.recTopCoe top coe none = top
- ENat.recTopCoe top coe (some a) = coe a
Instances For
@[simp]
theorem
ENat.recTopCoe_top
{C : ℕ∞ → Sort u_2}
(d : C ⊤)
(f : (a : ℕ) → C ↑a)
:
ENat.recTopCoe d f ⊤ = d
@[simp]
theorem
ENat.recTopCoe_coe
{C : ℕ∞ → Sort u_2}
(d : C ⊤)
(f : (a : ℕ) → C ↑a)
(x : ℕ)
:
ENat.recTopCoe d f ↑x = f x
ℕ+
is the type of positive natural numbers. It is defined as a subtype,
and the VM representation of ℕ+
is the same as ℕ
because the proof
is not stored.
Equations
- «termℕ+» = Lean.ParserDescr.node `termℕ+ 1024 (Lean.ParserDescr.symbol "ℕ+")
Instances For
Equations
- instReprPNat = { reprPrec := fun (n : ℕ+) (n' : ℕ) => reprPrec n.val n' }