# Documentation

Mathlib.Algebra.Ring.Basic

# Semirings and rings #

This file gives lemmas about semirings, rings and domains. This is analogous to Algebra.Group.Basic, the difference being that the former is about + and * separately, while the present file is about their interaction.

For the definitions of semirings and rings see Algebra.Ring.Defs.

@[simp]
theorem AddHom.mulLeft_apply {R : Type u_1} [inst : ] (r : R) :
↑() = (fun x x_1 => x * x_1) r
def AddHom.mulLeft {R : Type u_1} [inst : ] (r : R) :

Left multiplication by an element of a type with distributive multiplication is an AddHom.

Equations
• = { toFun := (fun x x_1 => x * x_1) r, map_add' := (_ : ∀ (b c : R), r * (b + c) = r * b + r * c) }
@[simp]
theorem AddHom.mulRight_apply {R : Type u_1} [inst : ] (r : R) :
↑() = fun a => a * r
def AddHom.mulRight {R : Type u_1} [inst : ] (r : R) :

Left multiplication by an element of a type with distributive multiplication is an AddHom.

Equations
• = { toFun := fun a => a * r, map_add' := (_ : ∀ (x x_1 : R), (x + x_1) * r = x * r + x_1 * r) }
@[simp]
theorem map_bit0 {α : Type u_2} {β : Type u_1} {F : Type u_3} [inst : ] [inst : ] [inst : AddHomClass F α β] (f : F) (a : α) :
f (bit0 a) = bit0 (f a)

Additive homomorphisms preserve bit0.

def AddMonoidHom.mulLeft {R : Type u_1} [inst : ] (r : R) :
R →+ R

Left multiplication by an element of a (semi)ring is an AddMonoidHom

Equations
• = { toZeroHom := { toFun := (fun x x_1 => x * x_1) r, map_zero' := (_ : r * 0 = 0) }, map_add' := (_ : ∀ (b c : R), r * (b + c) = r * b + r * c) }
@[simp]
theorem AddMonoidHom.coe_mul_left {R : Type u_1} [inst : ] (r : R) :
def AddMonoidHom.mulRight {R : Type u_1} [inst : ] (r : R) :
R →+ R

Right multiplication by an element of a (semi)ring is an AddMonoidHom

Equations
• = { toZeroHom := { toFun := fun a => a * r, map_zero' := (_ : 0 * r = 0) }, map_add' := (_ : ∀ (x x_1 : R), (x + x_1) * r = x * r + x_1 * r) }
@[simp]
theorem AddMonoidHom.coe_mul_right {R : Type u_1} [inst : ] (r : R) :
= fun x => x * r
theorem AddMonoidHom.mul_right_apply {R : Type u_1} [inst : ] (a : R) (r : R) :
↑() a = a * r
instance hasDistribNeg {α : Type u_1} [inst : Mul α] [inst : ] :
Equations
@[simp]
theorem inv_neg' {α : Type u_1} [inst : ] [inst : ] (a : α) :
theorem vieta_formula_quadratic {α : Type u_1} [inst : ] {b : α} {c : α} {x : α} (h : x * x - b * x + c = 0) :
y, y * y - b * y + c = 0 x + y = b x * y = c

Vieta's formula for a quadratic equation, relating the coefficients of the polynomial with its roots. This particular version states that if we have a root x of a monic quadratic polynomial, then there is another root y such that x + y is negative the a_1 coefficient and x * y is the a_0 coefficient.

theorem succ_ne_self {α : Type u_1} [inst : ] [inst : ] (a : α) :
a + 1 a
theorem pred_ne_self {α : Type u_1} [inst : ] [inst : ] (a : α) :
a - 1 a
theorem IsLeftCancelMulZero.to_noZeroDivisors (α : Type u_1) [inst : Ring α] [inst : ] :
theorem IsRightCancelMulZero.to_noZeroDivisors (α : Type u_1) [inst : Ring α] [inst : ] :
instance NoZeroDivisors.to_isCancelMulZero (α : Type u_1) [inst : Ring α] [inst : ] :
Equations
theorem NoZeroDivisors.to_isDomain (α : Type u_1) [inst : Ring α] [h : ] [inst : ] :
instance IsDomain.to_noZeroDivisors (α : Type u_1) [inst : Ring α] [inst : ] :
Equations