FormalConjecturesForMathlib/Algebra/Ring/PythagorasNumber.lean

GitHub source file

Explanation legend Lean4 Domain Explanation Language (L4DEL)

L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.

L4DEL
Lean4 Domain Explanation Language

Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.

Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1

7 declarations, 0 contain sorry, 0 declared as axioms

Pythagoras numbers

The Pythagoras number $p(R)$ of $R$ is the least $p$ such that every sum of squares in $R$ is a sum of $p$ squares; see [Pfister1995] for fields and [CDLR1982] for rings. This file defines:

The Pythagoras number of R is p exactly when IsLeast (pythagorasBounds R) p. The set pythagorasBounds R can be empty, in which case the Pythagoras number is infinite; by [CDLR1982] this happens for $\mathbb{R}[X, Y]$. No numeric invariant is defined here, so that no convention for the infinite case is needed.

The definitions and the correspondence with IsSumSq need only [AddCommMonoid R] [Mul R]; the AddCommMonoid is what the sum ∑ i : Fin n requires, since IsSumSq itself assumes only [Mul R] [Add R] [Zero R]. Padding a sum of squares with zeros needs 0 * 0 = 0, so IsSumSqOfLength.of_le and mem_pythagorasBounds_of_le are stated for a NonUnitalNonAssocSemiring.

References

Imports (2)
Imported by 1 file
  1. def IsSumSqOfLength IsSumSqOfLength n a means that a is a sum of n squares line 59 source

    Source documentation

    IsSumSqOfLength n a means that a is a sum of n squares.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: AddCommMonoid, Mul, Nat

    Proof uses: Exists, Fin, Eq, Finset.sum, Finset.univ, HMul.hMul

    2 instances, coercions and auxiliary constants left out.

    def IsSumSqOfLength (n : ℕ) (a : R) : Prop :=
    …
  2. def pythagorasBounds The set of p such that every sum of squares in R is a sum of p squares line 65 source

    Source documentation

    The set of p such that every sum of squares in R is a sum of p squares. Its least element, when it exists, is the Pythagoras number of R.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: AddCommMonoid, Mul, Set, Nat

    Proof uses: Set.ofPred, IsSumSq, IsSumSqOfLength

    7 instances, coercions and auxiliary constants left out.

    def pythagorasBounds : Set ℕ :=
    …
  3. theorem IsSumSqOfLength.isSumSq line 68 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: AddCommMonoid, Mul, Nat, IsSumSqOfLength, IsSumSq

    Proof uses: Fin, Eq, Finset.sum, Finset.univ, HMul.hMul, Nat.recAux, OfNat.ofNat, of_eq_true, HAdd.hAdd, Eq.mpr, Fin.succ, id, congrArg, Fin.sum_univ_succ, IsSumSq.sq_add, Eq.symm

    26 instances, coercions and auxiliary constants left out.

    Tactic trace: 5 steps

    Open to load the checked before-and-after goal states.

  4. theorem IsSumSq.exists_isSumSqOfLength line 76 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: AddCommMonoid, Mul, IsSumSq, Exists, Nat, IsSumSqOfLength

    Proof uses: IsSumSq.rec, Exists.intro, OfNat.ofNat, Fin, Eq, Finset.sum, Finset.univ, HMul.hMul, of_eq_true, Eq.trans, True, congrArg, HSMul.hSMul, Finset.card, EmptyCollection.emptyCollection, Finset, Finset.sum_congr, Finset.univ_eq_empty, Membership.mem, Eq.refl and 12 more

    32 instances, coercions and auxiliary constants left out.

    Tactic trace: 7 steps

    Open to load the checked before-and-after goal states.

  5. theorem isSumSq_iff_exists_isSumSqOfLength line 85 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: AddCommMonoid, Mul, Iff, IsSumSq, Exists, Nat, IsSumSqOfLength

    Proof uses: Iff.intro, IsSumSq.exists_isSumSqOfLength, IsSumSqOfLength.isSumSq

    15 instances, coercions and auxiliary constants left out.

  6. theorem IsSumSqOfLength.of_le Padding with zeros: a sum of p squares is a sum of q squares for every q ≥ p line 95 source

    Source documentation

    Padding with zeros: a sum of p squares is a sum of q squares for every q ≥ p.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: NonUnitalNonAssocSemiring, Nat, LE.le, IsSumSqOfLength

    Proof uses: Fin, Eq, Finset.sum, Finset.univ, HMul.hMul, HAdd.hAdd, Exists, Nat.exists_eq_add_of_le, Exists.intro, Fin.append, OfNat.ofNat, of_eq_true, Eq.trans, True, congrArg, Fin.castAdd, Fin.natAdd, Fin.sum_univ_add, congr, Finset.sum_congr and 10 more

    25 instances, coercions and auxiliary constants left out.

    Tactic trace: 4 steps

    Open to load the checked before-and-after goal states.

    theorem IsSumSqOfLength.of_le {p q : ℕ} (hpq : p ≤ q) {a : R} (h : IsSumSqOfLength p a) :
        IsSumSqOfLength q a := by
    …

    Mentions: IsSumSqOfLength

  7. theorem mem_pythagorasBounds_of_le line 101 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: NonUnitalNonAssocSemiring, Nat, LE.le, Membership.mem, Set, pythagorasBounds

    Proof uses: IsSumSq, IsSumSqOfLength.of_le

    17 instances, coercions and auxiliary constants left out.