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 : Nat) => match o with | none => Std.Format.text "⊥" | some a => Std.Format.text "↑" ++ repr a }
Equations
- WithBot.coe = { coe := WithBot.some }
Equations
- WithBot.inhabited = { default := ⊥ }
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 : Nat) => match o with | none => Std.Format.text "⊤" | some a => Std.Format.text "↑" ++ repr a }
Equations
- WithTop.coeTC = { coe := WithTop.some }
Equations
- WithTop.inhabited = { default := ⊤ }
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