Sums of squares #
We introduce a predicate for sums of squares in a ring.
Main declarations #
IsSumSq : R → Prop: for a typeRwith addition, multiplication and a zero, an inductive predicate defining the property of being a sum of squares inR.0 : Ris a sum of squares and ifSis a sum of squares, then, for alla : R,a * a + sis a sum of squares.AddMonoid.sumSq RandSubsemiring.sumSq R: respectively the submonoid or subsemiring of sums of squares in an additive monoid or semiringRwith multiplication.
The property of being a sum of squares is defined inductively by:
0 : R is a sum of squares and if s : R is a sum of squares,
then for all a : R, a * a + s is a sum of squares in R.
- zero {R : Type u_1} [Mul R] [Add R] [Zero R] : IsSumSq 0
- sq_add {R : Type u_1} [Mul R] [Add R] [Zero R] (a : R) {s : R} (hs : IsSumSq s) : IsSumSq (a * a + s)
Instances For
Alternative induction scheme for IsSumSq which uses IsSquare.
In an additive monoid with multiplication R, AddSubmonoid.sumSq R is the submonoid of sums of
squares in R.
Instances For
In an additive unital magma with multiplication, squares are sums of squares (see Mathlib.Algebra.Group.Even).
In an additive commutative monoid with multiplication, a finite sum of sums of squares is a sum of squares.
In an additive commutative monoid with multiplication,
∑ i ∈ I, a i * a i is a sum of squares.
In a commutative (possibly non-unital) semiring R, NonUnitalSubsemiring.sumSq R is
the (possibly non-unital) subsemiring of sums of squares in R.
Instances For
In a commutative (possibly non-unital) semiring,
if s₁ and s₂ are sums of squares, then s₁ * s₂ is a sum of squares.
In a commutative semiring R, Subsemiring.sumSq R is the subsemiring of sums of squares in R.
Equations
- Subsemiring.sumSq T = { carrier := (NonUnitalSubsemiring.sumSq T).carrier, mul_mem' := ⋯, one_mem' := ⋯, add_mem' := ⋯, zero_mem' := ⋯ }
Instances For
In a commutative semiring, a finite product of sums of squares is a sum of squares.
In a linearly ordered semiring with the property a ≤ b → ∃ c, a + c = b (e.g. ℕ),
sums of squares are non-negative.