Sums of squares #
We introduce a predicate for sums of squares in a ring.
Main declarations #
IsSumSq : R → Prop
: for a typeR
with addition, multiplication and a zero, an inductive predicate defining the property of being a sum of squares inR
.0 : R
is a sum of squares and ifS
is a sum of squares, then, for alla : R
,a * a + s
is a sum of squares.AddMonoid.sumSq R
andSubsemiring.sumSq R
: respectively the submonoid or subsemiring of sums of squares in an additive monoid or semiringR
with 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
Alias of IsSumSq
.
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
.
Instances For
Alternative induction scheme for IsSumSq
which uses IsSquare
.
Alias of IsSumSq.add
.
In an additive monoid with multiplication,
if s₁
and s₂
are sums of squares, then s₁ + s₂
is a sum of squares.
In an additive monoid with multiplication R
, AddSubmonoid.sumSq R
is the submonoid of sums of
squares in R
.
Equations
- AddSubmonoid.sumSq T = { carrier := {s : T | IsSumSq s}, add_mem' := ⋯, zero_mem' := ⋯ }
Instances For
Alias of AddSubmonoid.sumSq
.
In an additive monoid with multiplication R
, AddSubmonoid.sumSq R
is the submonoid of sums of
squares in R
.
Equations
Instances For
Alias of AddSubmonoid.sumSq
.
In an additive monoid with multiplication R
, AddSubmonoid.sumSq R
is the submonoid of sums of
squares in R
.
Equations
Instances For
Alias of AddSubmonoid.sumSq
.
In an additive monoid with multiplication R
, AddSubmonoid.sumSq R
is the submonoid of sums of
squares in R
.
Equations
Instances For
In an additive unital magma with multiplication, x * x
is a sum of squares for all x
.
In an additive unital magma with multiplication, squares are sums of squares (see Mathlib.Algebra.Group.Even).
Alias of AddSubmonoid.closure_isSquare
.
In an additive monoid with multiplication R
, the submonoid generated by the squares is the set of
sums of squares in R
.
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, x i
, where each x i
is a square, is a sum of squares.
In an additive commutative monoid with multiplication,
∑ i ∈ I, a i * a i
is a sum of squares.
Alias of IsSumSq.sum_mul_self
.
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
.
Equations
- NonUnitalSubsemiring.sumSq T = (Subsemigroup.square T).nonUnitalSubsemiringClosure
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.
Alias of IsSumSq.nonneg
.
In a linearly ordered semiring with the property a ≤ b → ∃ c, a + c = b
(e.g. ℕ
),
sums of squares are non-negative.