FormalConjecturesForMathlib/Data/Nat/Squarefree.lean
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
- def
Nat.squarefreePartn.squarefreePartis the uniquea₀ : ℕsuch thata₀is squarefree andn = a₀ * b ^ 2, for someb : ℕline 33 sourceSource documentation
n.squarefreePartis the uniquea₀ : ℕsuch thata₀is squarefree andn = a₀ * b ^ 2, for someb : ℕ. At0this property is not well defined becausebmust be0anda₀can be any squarefree number; we give the junk value1atn = 0following the convention that the squarefree part of any square is1.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
Finsupp.prod,Nat.factorization,HPow.hPow,HMod.hMod,OfNat.ofNat10 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)
- example
Nat.(example at line 35)line 35 source - example
Nat.(example at line 38)line 38 source - example
Nat.(example at line 41)line 41 source - example
Nat.(example at line 44)line 44 source - example
Nat.(example at line 47)line 47 source - example
Nat.(example at line 50)line 50 source - theorem
Nat.squarefreePart_ne_zeroline 53 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Ne, Nat.squarefreePart,OfNat.ofNatProof 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,funextand 16 more45 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- theorem
Nat.squarefreePart_zeroline 56 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,Nat, Nat.squarefreePart,OfNat.ofNatProof uses:
of_eq_true,Eq.trans,True,congrFun',congrArg,Finsupp.prod,Nat.factorization,Finsupp,Nat.factorization_zero,HPow.hPow,HMod.hMod,eq_self18 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- theorem
Nat.squarefreePart_of_squarefreeIfnis squarefree, then its squarefree part is itself line 60 sourceSource documentation
If
nis squarefree, then its squarefree part is itself.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Squarefree,Eq, Nat.squarefreePartProof 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.memand 10 more19 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
- theorem
Nat.squarefreePart_of_isSquareThe squarefree part of any square is1line 68 sourceSource 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.ofNatProof 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,Finsetand 21 more43 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
- theorem
Nat.squarefreePart_factorizationIf $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 sourceSource 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.ofNatProof 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_zeroand 2 more22 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 … - theorem
Nat.Prime.squarefreeline 85 sourcestandard axioms: propext what this means
Statement uses:
Nat,Nat.Prime,SquarefreeProof uses:
Irreducible.squarefree2 instances, coercions and auxiliary constants left out.
- theorem
Nat.squarefree_squarefreePartline 87 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Squarefree, Nat.squarefreePartProof 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_eqand 68 more92 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
- theorem
Nat.squarefreePart_dvdline 93 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Dvd.dvd, Nat.squarefreePartProof 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_factorization18 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
- def
Nat.squarePartThe square part is the value ofb ^ 2in the squarefree decomposition ofn = a₀ * b ^ 2line 99 sourceSource documentation
The square part is the value of
b ^ 2in the squarefree decomposition ofn = a₀ * b ^ 2.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
NatProof uses:
HDiv.hDiv, Nat.squarefreePart2 instances, coercions and auxiliary constants left out.
def squarePart (n : ℕ) : ℕ := n / n.squarefreePart
- theorem
Nat.squarePart_zeroline 101 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,Nat, Nat.squarePart,OfNat.ofNatProof uses:
of_eq_true,Eq.trans,True,congrFun',congrArg,Nat.zero_div, Nat.squarefreePart,eq_self2 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
- theorem
Nat.squarefreePart_mul_squarePartThe squarefree decomposition of a natural number line 104 sourceSource 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.squarePartProof uses:
Iff.mpr,HDiv.hDiv,Dvd.dvd,Nat.mul_div_eq_iff_dvd, Nat.squarefreePart_dvd7 instances, coercions and auxiliary constants left out.
theorem squarefreePart_mul_squarePart (n : ℕ) : n.squarefreePart * n.squarePart = n := …
- theorem
Nat.squarefree_infiniteline 107 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Set.Infinite,Nat,Set.ofPred,SquarefreeProof uses:
Set.Infinite.mono,Nat.Prime,Membership.mem,Set, Nat.Prime.squarefree,Nat.infinite_setOfPred_prime3 instances, coercions and auxiliary constants left out.