Mathlib.Algebra.Group.WithOne.Defs
85 declarations. Mathlib docs · Source
theorem WithZero.instRepr.match_1.congr_eq_2 E1 #
∀ {α : Type u_1} (motive : WithZero α → Sort u_2) (o : WithZero α) (h_1 : Unit → motive none)
(h_2 : (a : α) → motive (some a)) (a : α),
o = some a →
(match o with
| none => h_1 ()
| some a => h_2 a) ≍
h_2 a
theorem WithOne.unone.congr_simp E1 #
∀ {α : Type u} {x x_1 : WithOne α} (e_x : x = x_1) (a : x ≠ 1), WithOne.unone a = WithOne.unone ⋯
theorem WithZero.unzero.match_1.congr_eq_1 E1 #
∀ {α : Type u_1} (motive : (x : WithZero α) → x ≠ 0 → Sort u_2) (x : WithZero α) (x_1 : x ≠ 0)
(h_1 : (x : α) → (x_2 : ↑x ≠ 0) → motive (some x) x_2) (x_2 : α) (x_3 : ↑x_2 ≠ 0),
x = some x_2 →
x_1 ≍ x_3 →
(match x, x_1 with
| some x, x_4 => h_1 x x_4) ≍
h_1 x_2 x_3
theorem WithOne.instRepr.match_1.congr_eq_2 E1 #
∀ {α : Type u_1} (motive : WithOne α → Sort u_2) (o : WithOne α) (h_1 : Unit → motive none)
(h_2 : (a : α) → motive (some a)) (a : α),
o = some a →
(match o with
| none => h_1 ()
| some a => h_2 a) ≍
h_2 a
theorem WithOne.instRepr.match_1.congr_eq_1 E1 #
∀ {α : Type u_1} (motive : WithOne α → Sort u_2) (o : WithOne α) (h_1 : Unit → motive none)
(h_2 : (a : α) → motive (some a)),
o = none →
(match o with
| none => h_1 ()
| some a => h_2 a) ≍
h_1 ()
theorem WithOne.unone.match_1.congr_eq_1 E1 #
∀ {α : Type u_1} (motive : (x : WithOne α) → x ≠ 1 → Sort u_2) (x : WithOne α) (x_1 : x ≠ 1)
(h_1 : (x : α) → (x_2 : ↑x ≠ 1) → motive (some x) x_2) (x_2 : α) (x_3 : ↑x_2 ≠ 1),
x = some x_2 →
x_1 ≍ x_3 →
(match x, x_1 with
| some x, x_4 => h_1 x x_4) ≍
h_1 x_2 x_3
theorem WithZero.instRepr.match_1.congr_eq_1 E1 #
∀ {α : Type u_1} (motive : WithZero α → Sort u_2) (o : WithZero α) (h_1 : Unit → motive none)
(h_2 : (a : α) → motive (some a)),
o = none →
(match o with
| none => h_1 ()
| some a => h_2 a) ≍
h_1 ()
def WithOne E1 #
Type u_1 → Type u_1
Add an extra element 1 to a type
def WithZero E1 #
Type u_1 → Type u_1
Add an extra element 0 to a type
instance WithZero.instRepr E0 #
{α : Type u} → [Repr α] → Repr (WithZero α)
instance WithOne.instRepr E0 #
{α : Type u} → [Repr α] → Repr (WithOne α)
instance WithOne.instMonad E0 #
Monad WithOne
instance WithZero.instMonad E0 #
Monad WithZero
instance WithZero.instZero E0 #
{α : Type u} → Zero (WithZero α)
instance WithOne.instOne E0 #
{α : Type u} → One (WithOne α)
instance WithZero.instAdd E0 #
{α : Type u} → [Add α] → Add (WithZero α)
instance WithOne.instMul E0 #
{α : Type u} → [Mul α] → Mul (WithOne α)
instance WithOne.instInv E0 #
{α : Type u} → [Inv α] → Inv (WithOne α)
instance WithZero.instNeg E0 #
{α : Type u} → [Neg α] → Neg (WithZero α)
instance WithZero.instNegZeroClass E0 #
{α : Type u} → [Neg α] → NegZeroClass (WithZero α)
instance WithOne.instInvOneClass E0 #
{α : Type u} → [Inv α] → InvOneClass (WithOne α)
instance WithOne.inhabited E0 #
{α : Type u} → Inhabited (WithOne α)
instance WithZero.inhabited E0 #
{α : Type u} → Inhabited (WithZero α)
instance WithZero.instNontrivial E0 #
∀ {α : Type u} [Nonempty α], Nontrivial (WithZero α)
instance WithOne.instNontrivial E0 #
∀ {α : Type u} [Nonempty α], Nontrivial (WithOne α)
instance WithOne.instSubsingletonOfIsEmpty E0 #
∀ {α : Type u} [IsEmpty α], Subsingleton (WithOne α)
instance WithZero.instSubsingletonOfIsEmpty E0 #
∀ {α : Type u} [IsEmpty α], Subsingleton (WithZero α)
def WithOne.coe E1 #
{α : Type u} → α → WithOne α
The canonical map from α into WithOne α
def WithZero.coe E1 #
{α : Type u} → α → WithZero α
The canonical map from α into WithZero α
instance WithOne.instCoeTC E0 #
{α : Type u} → CoeTC α (WithOne α)
instance WithZero.instCoeTC E0 #
{α : Type u} → CoeTC α (WithZero α)
theorem WithZero.forall E1 #
∀ {α : Type u} {p : WithZero α → Prop}, (∀ (x : WithZero α), p x) ↔ p 0 ∧ ∀ (a : α), p ↑a
theorem WithOne.forall E1 #
∀ {α : Type u} {p : WithOne α → Prop}, (∀ (x : WithOne α), p x) ↔ p 1 ∧ ∀ (a : α), p ↑a
theorem WithOne.exists E1 #
∀ {α : Type u} {p : WithOne α → Prop}, (∃ x, p x) ↔ p 1 ∨ ∃ a, p ↑a
theorem WithZero.exists E1 #
∀ {α : Type u} {p : WithZero α → Prop}, (∃ x, p x) ↔ p 0 ∨ ∃ a, p ↑a
def WithOne.recOneCoe E1 #
{α : Type u} → {motive : WithOne α → Sort u_1} → motive 1 → ((a : α) → motive ↑a) → (n : WithOne α) → motive n
Recursor for WithOne using the preferred forms 1 and ↑a.
def WithZero.recZeroCoe E1 #
{α : Type u} → {motive : WithZero α → Sort u_1} → motive 0 → ((a : α) → motive ↑a) → (n : WithZero α) → motive n
Recursor for WithZero using the preferred forms 0 and ↑a.
theorem WithZero.recZeroCoe_zero E0 #
∀ {α : Type u} {motive : WithZero α → Sort u_1} (h₁ : motive 0) (h₂ : (a : α) → motive ↑a),
WithZero.recZeroCoe h₁ h₂ 0 = h₁
theorem WithOne.recOneCoe_one E0 #
∀ {α : Type u} {motive : WithOne α → Sort u_1} (h₁ : motive 1) (h₂ : (a : α) → motive ↑a),
WithOne.recOneCoe h₁ h₂ 1 = h₁
theorem WithOne.recOneCoe_coe E0 #
∀ {α : Type u} {motive : WithOne α → Sort u_1} (h₁ : motive 1) (h₂ : (a : α) → motive ↑a) (a : α),
WithOne.recOneCoe h₁ h₂ ↑a = h₂ a
theorem WithZero.recZeroCoe_coe E0 #
∀ {α : Type u} {motive : WithZero α → Sort u_1} (h₁ : motive 0) (h₂ : (a : α) → motive ↑a) (a : α),
WithZero.recZeroCoe h₁ h₂ ↑a = h₂ a
def WithOne.unone E1 #
{α : Type u} → {x : WithOne α} → x ≠ 1 → α
Deconstruct an x : WithOne α to the underlying value in α, given a proof that x ≠ 1.
def WithZero.unzero E1 #
{α : Type u} → {x : WithZero α} → x ≠ 0 → α
Deconstruct an x : WithZero α to the underlying value in α, given a proof that x ≠ 0.
theorem WithZero.unzero_coe E0 #
∀ {α : Type u} {x : α} (hx : ↑x ≠ 0), WithZero.unzero hx = x
theorem WithOne.unone_coe E0 #
∀ {α : Type u} {x : α} (hx : ↑x ≠ 1), WithOne.unone hx = x
theorem WithZero.coe_unzero E0 #
∀ {α : Type u} {x : WithZero α} (hx : x ≠ 0), ↑(WithZero.unzero hx) = x
theorem WithOne.coe_unone E0 #
∀ {α : Type u} {x : WithOne α} (hx : x ≠ 1), ↑(WithOne.unone hx) = x
theorem WithZero.coe_ne_zero E0 #
∀ {α : Type u} {a : α}, ↑a ≠ 0
theorem WithOne.coe_ne_one E0 #
∀ {α : Type u} {a : α}, ↑a ≠ 1
theorem WithZero.zero_ne_coe E0 #
∀ {α : Type u} {a : α}, 0 ≠ ↑a
theorem WithOne.one_ne_coe E0 #
∀ {α : Type u} {a : α}, 1 ≠ ↑a
theorem WithZero.ne_zero_iff_exists E1 #
∀ {α : Type u} {x : WithZero α}, x ≠ 0 ↔ ∃ a, ↑a = x
theorem WithOne.ne_one_iff_exists E1 #
∀ {α : Type u} {x : WithOne α}, x ≠ 1 ↔ ∃ a, ↑a = x
instance WithOne.instCanLift E0 #
∀ {α : Type u}, CanLift (WithOne α) α WithOne.coe fun a ↦ a ≠ 1
instance WithZero.instCanLift E0 #
∀ {α : Type u}, CanLift (WithZero α) α WithZero.coe fun a ↦ a ≠ 0
theorem WithZero.coe_inj E0 #
∀ {α : Type u} {a b : α}, ↑a = ↑b ↔ a = b
theorem WithOne.coe_inj E0 #
∀ {α : Type u} {a b : α}, ↑a = ↑b ↔ a = b
theorem WithZero.coe_injective E0 #
∀ {α : Type u}, Function.Injective WithZero.coe
theorem WithOne.coe_injective E0 #
∀ {α : Type u}, Function.Injective WithOne.coe
theorem WithZero.cases_on E1 #
∀ {α : Type u} {motive : WithZero α → Prop} (x : WithZero α), motive 0 → (∀ (a : α), motive ↑a) → motive x
theorem WithOne.cases_on E1 #
∀ {α : Type u} {motive : WithOne α → Prop} (x : WithOne α), motive 1 → (∀ (a : α), motive ↑a) → motive x
instance WithOne.instMulOneClass E0 #
{α : Type u} → [Mul α] → MulOneClass (WithOne α)
instance WithZero.instAddZeroClass E0 #
{α : Type u} → [Add α] → AddZeroClass (WithZero α)
theorem WithOne.coe_mul E0 #
∀ {α : Type u} [inst : Mul α] (a b : α), ↑(a * b) = ↑a * ↑b
theorem WithZero.coe_add E0 #
∀ {α : Type u} [inst : Add α] (a b : α), ↑(a + b) = ↑a + ↑b
instance WithZero.instAddMonoid E0 #
{α : Type u} → [AddSemigroup α] → AddMonoid (WithZero α)
instance WithOne.instMonoid E0 #
{α : Type u} → [Semigroup α] → Monoid (WithOne α)
instance WithZero.instAddCommMonoid E0 #
{α : Type u} → [AddCommSemigroup α] → AddCommMonoid (WithZero α)
instance WithOne.instCommMonoid E0 #
{α : Type u} → [CommSemigroup α] → CommMonoid (WithOne α)
theorem WithZero.coe_neg E0 #
∀ {α : Type u} [inst : Neg α] (a : α), ↑(-a) = -↑a
theorem WithOne.coe_inv E0 #
∀ {α : Type u} [inst : Inv α] (a : α), ↑a⁻¹ = (↑a)⁻¹
def WithOne.unoneD E1 #
{α : Type u} → α → WithOne α → α
Specialization of Option.getD to values in WithOne α that respects API boundaries.
def WithZero.unzeroD E1 #
{α : Type u} → α → WithZero α → α
Specialization of Option.getD to values in WithZero α that respects API boundaries.
theorem WithZero.unzeroD_zero E0 #
∀ {α : Type u} (d : α), WithZero.unzeroD d 0 = d
theorem WithOne.unoneD_one E0 #
∀ {α : Type u} (d : α), WithOne.unoneD d 1 = d
theorem WithOne.unoneD_coe E0 #
∀ {α : Type u} (d x : α), WithOne.unoneD d ↑x = x
theorem WithZero.unzeroD_coe E0 #
∀ {α : Type u} (d x : α), WithZero.unzeroD d ↑x = x
theorem WithZero.unzeroD_eq_iff E0 #
∀ {α : Type u} {d y : α} {x : WithZero α}, WithZero.unzeroD d x = y ↔ x = ↑y ∨ x = 0 ∧ y = d
theorem WithOne.unoneD_eq_iff E0 #
∀ {α : Type u} {d y : α} {x : WithOne α}, WithOne.unoneD d x = y ↔ x = ↑y ∨ x = 1 ∧ y = d
theorem WithZero.unzeroD_eq_self_iff E0 #
∀ {α : Type u} {d : α} {x : WithZero α}, WithZero.unzeroD d x = d ↔ x = ↑d ∨ x = 0
theorem WithOne.unoneD_eq_self_iff E0 #
∀ {α : Type u} {d : α} {x : WithOne α}, WithOne.unoneD d x = d ↔ x = ↑d ∨ x = 1
theorem WithOne.unoneD_eq_unoneD_iff E0 #
∀ {α : Type u} {d : α} {x y : WithOne α},
WithOne.unoneD d x = WithOne.unoneD d y ↔ x = y ∨ x = ↑d ∧ y = 1 ∨ x = 1 ∧ y = ↑d
theorem WithZero.unzeroD_eq_unzeroD_iff E0 #
∀ {α : Type u} {d : α} {x y : WithZero α},
WithZero.unzeroD d x = WithZero.unzeroD d y ↔ x = y ∨ x = ↑d ∧ y = 0 ∨ x = 0 ∧ y = ↑d
theorem WithZero.unzeroD_eq_unzero E1 #
∀ {α : Type u} {d : α} {x : WithZero α} (hx : x ≠ 0), WithZero.unzeroD d x = WithZero.unzero hx
theorem WithOne.unoneD_eq_unone E1 #
∀ {α : Type u} {d : α} {x : WithOne α} (hx : x ≠ 1), WithOne.unoneD d x = WithOne.unone hx