File: Mathlib/Algebra/Order/Ring/Unbundled/Nonneg.lean

full_name: Nonneg.orderBot
code: /-- This instance uses data fields from `Subtype.partialOrder` to help type-class inference.
The `Set.Ici` data fields are definitionally equal, but that requires unfolding semireducible
definitions, so type-class inference won't see this. -/
instance orderBot [Preorder α] {a : α} : OrderBot { x : α // a ≤ x } 
goal: OrderBot { x // a ≤ x }

full_name: Nonneg.bot_eq
code: theorem bot_eq [Preorder α] {a : α} : (⊥ : { x : α // a ≤ x }) = ⟨a, le_rfl⟩ 
goal: ⊥ = ⟨a, ⋯⟩

full_name: Nonneg.noMaxOrder
code: instance noMaxOrder [PartialOrder α] [NoMaxOrder α] {a : α} : NoMaxOrder { x : α // a ≤ x } 
goal: NoMaxOrder { x // a ≤ x }

full_name: Nonneg.semilatticeSup
code: instance semilatticeSup [SemilatticeSup α] {a : α} : SemilatticeSup { x : α // a ≤ x } 
goal: SemilatticeSup { x // a ≤ x }

full_name: Nonneg.semilatticeInf
code: instance semilatticeInf [SemilatticeInf α] {a : α} : SemilatticeInf { x : α // a ≤ x } 
goal: SemilatticeInf { x // a ≤ x }

full_name: Nonneg.distribLattice
code: instance distribLattice [DistribLattice α] {a : α} : DistribLattice { x : α // a ≤ x } 
goal: DistribLattice { x // a ≤ x }

full_name: Nonneg.instDenselyOrdered
code: instance instDenselyOrdered [Preorder α] [DenselyOrdered α] {a : α} :
    DenselyOrdered { x : α // a ≤ x } 
goal: DenselyOrdered { x // a ≤ x }

full_name: Nonneg.conditionallyCompleteLinearOrder
code: /-- If `sSup ∅ ≤ a` then `{x : α // a ≤ x}` is a `ConditionallyCompleteLinearOrder`. -/
protected noncomputable abbrev conditionallyCompleteLinearOrder [ConditionallyCompleteLinearOrder α]
    {a : α} : ConditionallyCompleteLinearOrder { x : α // a ≤ x } 
goal: ConditionallyCompleteLinearOrder { x // a ≤ x }

full_name: Nonneg.conditionallyCompleteLinearOrderBot
code: /-- If `sSup ∅ ≤ a` then `{x : α // a ≤ x}` is a `ConditionallyCompleteLinearOrderBot`.

This instance uses data fields from `Subtype.linearOrder` to help type-class inference.
The `Set.Ici` data fields are definitionally equal, but that requires unfolding semireducible
definitions, so type-class inference won't see this. -/
protected noncomputable abbrev conditionallyCompleteLinearOrderBot
    [ConditionallyCompleteLinearOrder α] (a : α) :
    ConditionallyCompleteLinearOrderBot { x : α // a ≤ x } 
goal: ConditionallyCompleteLinearOrderBot { x // a ≤ x }

full_name: Nonneg.inhabited
code: instance inhabited [Preorder α] {a : α} : Inhabited { x : α // a ≤ x } 
goal: Inhabited { x // a ≤ x }

full_name: Nonneg.zero
code: instance zero [Zero α] [Preorder α] : Zero { x : α // 0 ≤ x } 
goal: Zero { x // 0 ≤ x }

full_name: Nonneg.coe_zero
code: @[simp, norm_cast]
protected theorem coe_zero [Zero α] [Preorder α] : ((0 : { x : α // 0 ≤ x }) : α) = 0 
goal: ↑0 = 0

full_name: Nonneg.mk_eq_zero
code: @[simp]
theorem mk_eq_zero [Zero α] [Preorder α] {x : α} (hx : 0 ≤ x) :
    (⟨x, hx⟩ : { x : α // 0 ≤ x }) = 0 ↔ x = 0 
goal: ⟨x, hx⟩ = 0 ↔ x = 0

full_name: Nonneg.add
code: instance add [AddZeroClass α] [Preorder α] [CovariantClass α α (· + ·) (· ≤ ·)] :
    Add { x : α // 0 ≤ x } 
goal: Add { x // 0 ≤ x }

full_name: Nonneg.mk_add_mk
code: @[simp]
theorem mk_add_mk [AddZeroClass α] [Preorder α] [CovariantClass α α (· + ·) (· ≤ ·)] {x y : α}
    (hx : 0 ≤ x) (hy : 0 ≤ y) :
    (⟨x, hx⟩ : { x : α // 0 ≤ x }) + ⟨y, hy⟩ = ⟨x + y, add_nonneg hx hy⟩ 
goal: ⟨x, hx⟩ + ⟨y, hy⟩ = ⟨x + y, ⋯⟩

full_name: Nonneg.coe_add
code: @[simp, norm_cast]
protected theorem coe_add [AddZeroClass α] [Preorder α] [CovariantClass α α (· + ·) (· ≤ ·)]
    (a b : { x : α // 0 ≤ x }) : ((a + b : { x : α // 0 ≤ x }) : α) = a + b 
goal: ↑(a + b) = ↑a + ↑b

full_name: Nonneg.nsmul
code: instance nsmul [AddMonoid α] [Preorder α] [CovariantClass α α (· + ·) (· ≤ ·)] :
    SMul ℕ { x : α // 0 ≤ x } 
goal: SMul ℕ { x // 0 ≤ x }

full_name: Nonneg.nsmul_mk
code: @[simp]
theorem nsmul_mk [AddMonoid α] [Preorder α] [CovariantClass α α (· + ·) (· ≤ ·)] (n : ℕ) {x : α}
    (hx : 0 ≤ x) : (n • (⟨x, hx⟩ : { x : α // 0 ≤ x })) = ⟨n • x, nsmul_nonneg hx n⟩ 
goal: n • ⟨x, hx⟩ = ⟨n • x, ⋯⟩

full_name: Nonneg.coe_nsmul
code: @[simp, norm_cast]
protected theorem coe_nsmul [AddMonoid α] [Preorder α] [CovariantClass α α (· + ·) (· ≤ ·)]
    (n : ℕ) (a : { x : α // 0 ≤ x }) : ((n • a : { x : α // 0 ≤ x }) : α) = n • (a : α) 
goal: ↑(n • a) = n • ↑a

full_name: Nonneg.one
code: instance one : One { x : α // 0 ≤ x } 
goal: One { x // 0 ≤ x }

full_name: Nonneg.coe_one
code: @[simp, norm_cast]
protected theorem coe_one : ((1 : { x : α // 0 ≤ x }) : α) = 1 
goal: ↑1 = 1

full_name: Nonneg.mk_eq_one
code: @[simp]
theorem mk_eq_one {x : α} (hx : 0 ≤ x) :
    (⟨x, hx⟩ : { x : α // 0 ≤ x }) = 1 ↔ x = 1 
goal: ⟨x, hx⟩ = 1 ↔ x = 1

full_name: Nonneg.mul
code: instance mul : Mul { x : α // 0 ≤ x } 
goal: Mul { x // 0 ≤ x }

full_name: Nonneg.coe_mul
code: @[simp, norm_cast]
protected theorem coe_mul (a b : { x : α // 0 ≤ x }) :
    ((a * b : { x : α // 0 ≤ x }) : α) = a * b 
goal: ↑(a * b) = ↑a * ↑b

full_name: Nonneg.mk_mul_mk
code: @[simp]
theorem mk_mul_mk {x y : α} (hx : 0 ≤ x) (hy : 0 ≤ y) :
    (⟨x, hx⟩ : { x : α // 0 ≤ x }) * ⟨y, hy⟩ = ⟨x * y, mul_nonneg hx hy⟩ 
goal: ⟨x, hx⟩ * ⟨y, hy⟩ = ⟨x * y, ⋯⟩

full_name: Nonneg.addMonoid
code: instance addMonoid : AddMonoid { x : α // 0 ≤ x } 
goal: AddMonoid { x // 0 ≤ x }

full_name: Nonneg.coeAddMonoidHom
code: /-- Coercion `{x : α // 0 ≤ x} → α` as an `AddMonoidHom`. -/
def coeAddMonoidHom : { x : α // 0 ≤ x } →+ α 
goal: { x // 0 ≤ x } →+ α

full_name: Nonneg.nsmul_coe
code: @[norm_cast]
theorem nsmul_coe (n : ℕ) (r : { x : α // 0 ≤ x }) :
    ↑(n • r) = n • (r : α) 
goal: ↑(n • r) = n • ↑r

full_name: Nonneg.addCommMonoid
code: instance addCommMonoid : AddCommMonoid { x : α // 0 ≤ x } 
goal: AddCommMonoid { x // 0 ≤ x }

full_name: Nonneg.natCast
code: instance natCast : NatCast { x : α // 0 ≤ x } 
goal: NatCast { x // 0 ≤ x }

full_name: Nonneg.coe_natCast
code: @[simp, norm_cast]
protected theorem coe_natCast (n : ℕ) : ((↑n : { x : α // 0 ≤ x }) : α) = n 
goal: ↑↑n = ↑n

full_name: Nonneg.mk_natCast
code: @[simp]
theorem mk_natCast (n : ℕ) : (⟨n, n.cast_nonneg'⟩ : { x : α // 0 ≤ x }) = n 
goal: ⟨↑n, ⋯⟩ = ↑n

full_name: Nonneg.addMonoidWithOne
code: instance addMonoidWithOne : AddMonoidWithOne { x : α // 0 ≤ x } 
goal: AddMonoidWithOne { x // 0 ≤ x }

full_name: Nonneg.pow_nonneg
code: @[simp]
theorem pow_nonneg {a : α} (H : 0 ≤ a) : ∀ n : ℕ, 0 ≤ a ^ n
  
goal: 0 ≤ a ^ n

full_name: Nonneg.pow
code: instance pow : Pow { x : α // 0 ≤ x } ℕ 
goal: Pow { x // 0 ≤ x } ℕ

full_name: Nonneg.coe_pow
code: @[simp, norm_cast]
protected theorem coe_pow (a : { x : α // 0 ≤ x }) (n : ℕ) :
    (↑(a ^ n) : α) = (a : α) ^ n 
goal: ↑(a ^ n) = ↑a ^ n

full_name: Nonneg.mk_pow
code: @[simp]
theorem mk_pow {x : α} (hx : 0 ≤ x) (n : ℕ) :
    (⟨x, hx⟩ : { x : α // 0 ≤ x }) ^ n = ⟨x ^ n, pow_nonneg hx n⟩ 
goal: ⟨x, hx⟩ ^ n = ⟨x ^ n, ⋯⟩

full_name: Nonneg.semiring
code: instance semiring : Semiring { x : α // 0 ≤ x } 
goal: Semiring { x // 0 ≤ x }

full_name: Nonneg.monoidWithZero
code: instance monoidWithZero : MonoidWithZero { x : α // 0 ≤ x } 
goal: MonoidWithZero { x // 0 ≤ x }

full_name: Nonneg.coeRingHom
code: /-- Coercion `{x : α // 0 ≤ x} → α` as a `RingHom`. -/
def coeRingHom : { x : α // 0 ≤ x } →+* α 
goal: { x // 0 ≤ x } →+* α

full_name: Nonneg.commSemiring
code: instance commSemiring : CommSemiring { x : α // 0 ≤ x } 
goal: CommSemiring { x // 0 ≤ x }

full_name: Nonneg.commMonoidWithZero
code: instance commMonoidWithZero : CommMonoidWithZero { x : α // 0 ≤ x } 
goal: CommMonoidWithZero { x // 0 ≤ x }

full_name: Nonneg.toNonneg
code: /-- The function `a ↦ max a 0` of type `α → {x : α // 0 ≤ x}`. -/
def toNonneg (a : α) : { x : α // 0 ≤ x } 
goal: { x // 0 ≤ x }

full_name: Nonneg.coe_toNonneg
code: @[simp]
theorem coe_toNonneg {a : α} : (toNonneg a : α) = max a 0 
goal: ↑(Nonneg.toNonneg a) = max a 0

full_name: Nonneg.toNonneg_of_nonneg
code: @[simp]
theorem toNonneg_of_nonneg {a : α} (h : 0 ≤ a) : toNonneg a = ⟨a, h⟩ 
goal: Nonneg.toNonneg a = ⟨a, h⟩

full_name: Nonneg.toNonneg_coe
code: @[simp]
theorem toNonneg_coe {a : { x : α // 0 ≤ x }} : toNonneg (a : α) = a 
goal: Nonneg.toNonneg ↑a = a

full_name: Nonneg.toNonneg_le
code: @[simp]
theorem toNonneg_le {a : α} {b : { x : α // 0 ≤ x }} : toNonneg a ≤ b ↔ a ≤ b 
goal: Nonneg.toNonneg a ≤ b ↔ a ≤ ↑b

full_name: Nonneg.toNonneg_lt
code: @[simp]
theorem toNonneg_lt {a : { x : α // 0 ≤ x }} {b : α} : a < toNonneg b ↔ ↑a < b 
goal: a < Nonneg.toNonneg b ↔ ↑a < b

full_name: Nonneg.sub
code: instance sub [Sub α] : Sub { x : α // 0 ≤ x } 
goal: Sub { x // 0 ≤ x }

full_name: Nonneg.mk_sub_mk
code: @[simp]
theorem mk_sub_mk [Sub α] {x y : α} (hx : 0 ≤ x) (hy : 0 ≤ y) :
    (⟨x, hx⟩ : { x : α // 0 ≤ x }) - ⟨y, hy⟩ = toNonneg (x - y) 
goal: ⟨x, hx⟩ - ⟨y, hy⟩ = Nonneg.toNonneg (x - y)