FormalConjecturesForMathlib/Data/Nat/Squarefree.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

19 declarations, 0 contain sorry, 0 declared as axioms

Imports (4)
Imported by 1 file
  1. def Nat.squarefreePart n.squarefreePart is the unique a₀ : ℕ such that a₀ is squarefree and n = a₀ * b ^ 2, for some b : ℕ line 33 source

    Source documentation

    n.squarefreePart is the unique a₀ : ℕ such that a₀ is squarefree and n = a₀ * b ^ 2, for some b : ℕ. At 0 this property is not well defined because b must be 0 and a₀ can be any squarefree number; we give the junk value 1 at n = 0 following the convention that the squarefree part of any square is 1.

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

    Statement uses: Nat

    Proof uses: Finsupp.prod, Nat.factorization, HPow.hPow, HMod.hMod, OfNat.ofNat

    10 instances, coercions and auxiliary constants left out.

    Tactic trace: 6 steps

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

    def squarefreePart (n : ℕ) : ℕ := n.factorization.prod fun (p e : ℕ) ↦ p ^ (e % 2)
  2. example Nat.(example at line 35) line 35 source
  3. example Nat.(example at line 38) line 38 source
  4. example Nat.(example at line 41) line 41 source
  5. example Nat.(example at line 44) line 44 source
  6. example Nat.(example at line 47) line 47 source
  7. example Nat.(example at line 50) line 50 source
  8. theorem Nat.squarefreePart_ne_zero line 53 source

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

    Statement uses: Nat, Ne, Nat.squarefreePart, OfNat.ofNat

    Proof uses: of_eq_true, Not, Eq, Finsupp.prod, Nat.factorization, HPow.hPow, HMod.hMod, Eq.trans, False, True, congrArg, Exists, And, Membership.mem, Finset, Finsupp.support, Finsupp, Nat.Prime, Dvd.dvd, funext and 16 more

    45 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

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

  9. theorem Nat.squarefreePart_zero line 56 source

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

    Statement uses: Eq, Nat, Nat.squarefreePart, OfNat.ofNat

    Proof uses: of_eq_true, Eq.trans, True, congrFun', congrArg, Finsupp.prod, Nat.factorization, Finsupp, Nat.factorization_zero, HPow.hPow, HMod.hMod, eq_self

    18 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

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

  10. theorem Nat.squarefreePart_of_squarefree If n is squarefree, then its squarefree part is itself line 60 source

    Source documentation

    If n is squarefree, then its squarefree part is itself.

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

    Statement uses: Nat, Squarefree, Eq, Nat.squarefreePart

    Proof uses: Eq.mpr, Finsupp.prod, Nat.factorization, HPow.hPow, id, congrArg, Eq.symm, Nat.prod_factorization_pow_eq_self, OfNat.ofNat, False.elim, False, Eq.mp, Eq.trans, Finset.prod_congr, Nat.primeFactors, HMod.hMod, Finsupp, rfl, Finset, Membership.mem and 10 more

    19 instances, coercions and auxiliary constants left out.

    Tactic trace: 5 steps

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

    theorem squarefreePart_of_squarefree {n : ℕ} (hn : Squarefree n) :
        squarefreePart n = n := by
    …

    Mentions: Nat.squarefreePart

  11. theorem Nat.squarefreePart_of_isSquare The squarefree part of any square is 1 line 68 source

    Source documentation

    The squarefree part of any square is 1.

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

    Statement uses: Nat, IsSquare, Eq, Nat.squarefreePart, OfNat.ofNat

    Proof uses: Ne, Or, eq_or_ne, Nat.squarefreePart_zero, Eq.symm, HMul.hMul, Eq.mpr, Finsupp.prod, Nat.factorization, HPow.hPow, HMod.hMod, id, congrArg, Nat.squarefreePart.eq_1, Finset.prod, Finsupp.support, Finsupp, Finsupp.prod.eq_1, Nat.primeFactors, Finset and 21 more

    43 instances, coercions and auxiliary constants left out.

    Tactic trace: 7 steps

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

    theorem squarefreePart_of_isSquare {n : ℕ} (hn : IsSquare n) :
        squarefreePart n = 1 := by
    …

    Mentions: Nat.squarefreePart

  12. theorem Nat.squarefreePart_factorization If $n = \prod_p p^{e_p}$ is the prime factorization of $n$, then $\prod_p p^{e_p \pmod{2}}$ is the prime factorization of the squarefree part of $n$ line 79 source

    Source documentation

    If $n = \prod_p p^{e_p}$ is the prime factorization of $n$, then $\prod_p p^{e_p \pmod{2}}$ is the prime factorization of the squarefree part of $n$.

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

    Statement uses: Nat, Nat.Prime, Eq, Finsupp, Nat.factorization, Nat.squarefreePart, HMod.hMod, OfNat.ofNat

    Proof uses: Eq.mpr, Finsupp.prod, HPow.hPow, id, congrArg, Nat.squarefreePart.eq_1, Finset.prod, Nat.primeFactors, Nat.prod_factorization_eq_prod_primeFactors, Nat.prod_primeFactors_factorization_apply, Not, Dvd.dvd, of_eq_true, Eq.trans, True, congrFun', Nat.factorization_eq_zero_of_not_dvd, eq_self, forall_congr, Nat.factorization_zero and 2 more

    22 instances, coercions and auxiliary constants left out.

    Tactic trace: 3 steps

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

    theorem squarefreePart_factorization (n : ℕ) {p : ℕ} (hp : p.Prime) :
        n.squarefreePart.factorization p = n.factorization p % 2 := by
    …
  13. theorem Nat.Prime.squarefree line 85 source

    standard axioms: propext what this means

    Statement uses: Nat, Nat.Prime, Squarefree

    Proof uses: Irreducible.squarefree

    2 instances, coercions and auxiliary constants left out.

  14. theorem Nat.squarefree_squarefreePart line 87 source

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

    Statement uses: Nat, Squarefree, Nat.squarefreePart

    Proof uses: Iff.mpr, LE.le, Finsupp, Nat.factorization, OfNat.ofNat, Nat.squarefree_iff_factorization_le_one, Nat.squarefreePart_ne_zero, dite, Nat.Prime, le_of_not_gt, LT.lt, Mathlib.Tactic.Linarith.lt_irrefl, Int, Eq.mp, HAdd.hAdd, Neg.neg, HSub.hSub, HMod.hMod, congrArg, Mathlib.Tactic.Ring.of_eq and 68 more

    92 instances, coercions and auxiliary constants left out.

    Tactic trace: 6 steps

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

  15. theorem Nat.squarefreePart_dvd line 93 source

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

    Statement uses: Nat, Dvd.dvd, Nat.squarefreePart

    Proof uses: Eq, OfNat.ofNat, Ne, Or, eq_or_ne, of_eq_true, Eq.symm, Iff.mp, Nat.Prime, LE.le, Finsupp, Nat.factorization, Nat.factorization_prime_le_iff_dvd, Nat.squarefreePart_ne_zero, Eq.rec, HMod.hMod, Nat.mod_le, Nat.squarefreePart_factorization

    18 instances, coercions and auxiliary constants left out.

    Tactic trace: 3 steps

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

  16. def Nat.squarePart The square part is the value of b ^ 2 in the squarefree decomposition of n = a₀ * b ^ 2 line 99 source

    Source documentation

    The square part is the value of b ^ 2 in the squarefree decomposition of n = a₀ * b ^ 2.

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

    Statement uses: Nat

    Proof uses: HDiv.hDiv, Nat.squarefreePart

    2 instances, coercions and auxiliary constants left out.

    def squarePart (n : ℕ) : ℕ := n / n.squarefreePart
  17. theorem Nat.squarePart_zero line 101 source

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

    Statement uses: Eq, Nat, Nat.squarePart, OfNat.ofNat

    Proof uses: of_eq_true, Eq.trans, True, congrFun', congrArg, Nat.zero_div, Nat.squarefreePart, eq_self

    2 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

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

  18. theorem Nat.squarefreePart_mul_squarePart The squarefree decomposition of a natural number line 104 source

    Source documentation

    The squarefree decomposition of a natural number.

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

    Statement uses: Nat, Eq, HMul.hMul, Nat.squarefreePart, Nat.squarePart

    Proof uses: Iff.mpr, HDiv.hDiv, Dvd.dvd, Nat.mul_div_eq_iff_dvd, Nat.squarefreePart_dvd

    7 instances, coercions and auxiliary constants left out.

    theorem squarefreePart_mul_squarePart (n : ℕ) : n.squarefreePart * n.squarePart = n :=
    …
  19. theorem Nat.squarefree_infinite line 107 source

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

    Statement uses: Set.Infinite, Nat, Set.ofPred, Squarefree

    Proof uses: Set.Infinite.mono, Nat.Prime, Membership.mem, Set, Nat.Prime.squarefree, Nat.infinite_setOfPred_prime

    3 instances, coercions and auxiliary constants left out.