Executable prime-power decomposition of a unary requested degree #
Enumerate all candidate prime indices in ascending order.
Equations
Instances For
The enumeration is the bounded canonical unary list from zero to the input.
A polynomial-time ascending unary enumeration.
Equations
Instances For
@[simp]
Prime indices paired with their maximal dividing prime power; neutral entries have power one.
Equations
- One or more equations did not get rendered due to their size.
Instances For
One globally polynomial-time prime-power decomposition program.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem
MIPRE.LowDegree.DegreeArithmetic.primePowerPairs_eq
(n : ℕ)
:
primePowerPairs (Cost.unary n) = List.ofFn fun (i : Fin (n + 1)) => (Cost.unary ↑i, Cost.unary (↑i ^ n.factorization ↑i))
The executing decomposition agrees exactly with the mathematical prime-power factors.
theorem
MIPRE.LowDegree.DegreeArithmetic.primePowerPairs_degrees
(n : ℕ)
:
List.map (fun (s : Cost.Unary × Cost.Unary) => List.length s.2) (primePowerPairs (Cost.unary n)) = BinaryDegreeFactors.degreeFactors n
Decoding the listed powers gives the factor list whose product is the requested degree.
theorem
MIPRE.LowDegree.DegreeArithmetic.primePowerPairs_prod
(n : ℕ)
(hn : 0 < n)
:
(List.map (fun (s : Cost.Unary × Cost.Unary) => List.length s.2) (primePowerPairs (Cost.unary n))).prod = n
Every positive degree is the product of the computed prime-power contributions.
theorem
MIPRE.LowDegree.DegreeArithmetic.primePowerPairs_pairwise
(n : ℕ)
:
List.Pairwise Nat.Coprime
(List.map (fun (s : Cost.Unary × Cost.Unary) => List.length s.2) (primePowerPairs (Cost.unary n)))
Computed prime-power contributions are pairwise coprime.