Download data/lean/ComparatorChallenges/TotientCompanionZero.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.54 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/ComparatorChallenges/TotientCompanionZero.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/ComparatorChallenges/TotientCompanionZero.lean
-
curl -L -o TotientCompanionZero.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/ComparatorChallenges/TotientCompanionZero.lean
3.54 kB
| import Mathlib | |
| namespace OAI | |
| /-! The no-seed alternative of the weighted totient companion theorem. -/ | |
| noncomputable section | |
| open scoped BigOperators Topology | |
| open Filter | |
| namespace TotientAsymptotic | |
| def IsTotient (v : β) : Prop := β n : β, 0 < n β§ n.totient = v | |
| def ell (v : β) : β := by | |
| classical | |
| exact if h : IsTotient v then Nat.find h else 0 | |
| def a (j : β) : β := (j + 1 : β) * Real.log (j + 1) - j * Real.log j - 1 | |
| def RenewalRootSet : Set β := | |
| {z | 0 < z β§ z < 1 β§ (β' j : β, a (j+1) * z^(j+1)) = 1} | |
| def rho : β := sInf RenewalRootSet | |
| def lam : β := Real.log (1 / rho) | |
| def gamma : β := (β' j : β, (j+1 : β) * a (j+1) * rho^(j+1))β»ΒΉ | |
| def P (H : β) : β := βReal.log (Real.log (H : β))ββ | |
| def alpha (s : β) : β := lam * Real.exp (lam * s) | |
| def largestPrimeFactor (n : β) : β := max 1 (n.primeFactors.sup id) | |
| structure TailDatum (H : β) where | |
| Q : Fin H β β | |
| cofactor : β | |
| def tailPrime {H : β} (Ξ· : TailDatum H) (h : β) : β := | |
| if hH : h < H then Ξ·.Q β¨h, hHβ© else 1 | |
| def tailLog {H : β} (Ξ· : TailDatum H) (h : β) : β := | |
| Real.log (Real.log (tailPrime Ξ· h : β)) | |
| def IsWitness (H : β) (s : β) (Ξ· : TailDatum H) : Prop := | |
| (β h : Fin H, h.val < P H β Ξ·.Q h = 1) β§ | |
| 0 < Ξ·.cofactor β§ | |
| (β h β Finset.Ico (P H) H, (tailPrime Ξ· h).Prime β§ | |
| (9 / 10 : β) * alpha s * h * (rho^h)β»ΒΉ β€ tailLog Ξ· h β§ | |
| tailLog Ξ· h β€ (11 / 10 : β) * alpha s * h * (rho^h)β»ΒΉ β§ | |
| (β l β Finset.Ico (P H) h, a (h-l) * tailLog Ξ· l) β€ | |
| (1 + (1 / 10000 : β) * Real.exp (-(h : β) / 40)) * tailLog Ξ· h) β§ | |
| largestPrimeFactor Ξ·.cofactor β€ tailPrime Ξ· (P H) β§ | |
| Real.log (Ξ·.cofactor : β) β€ | |
| Real.exp (2 * alpha s * (P H : β) * (rho^(P H))β»ΒΉ) | |
| def w {H : β} (Ξ· : TailDatum H) : β := | |
| Ξ·.cofactor * β h β Finset.Ico (P H) H, tailPrime Ξ· h | |
| def witnesses (H : β) (s : β) (d : β) : Set (TailDatum H) := | |
| {Ξ· | IsWitness H s Ξ· β§ (w Ξ·).totient = d} | |
| def D {H : β} (h : β) (Ξ· : TailDatum H) : β := | |
| β l β Finset.Ico (P H) H, a (h-l) * tailLog Ξ· l | |
| def maxD {H : β} (h : β) (T : Finset (TailDatum H)) : β := by | |
| classical | |
| exact if ht : T.Nonempty then T.sup' ht (D h) else 0 | |
| def AH (H : β) (f : β β β) (s : β) : β := by | |
| classical | |
| exact rho^(H*(H-1)/2) * (gamma / alpha s)^H * | |
| βαΆ d : β, | |
| if IsTotient d then | |
| f ((ell d : β) / d) / d * | |
| βαΆ T : Finset (TailDatum H), | |
| if T.Nonempty β§ (βT : Set (TailDatum H)) β witnesses H s d then | |
| (-1 : β)^(T.card-1) * | |
| Real.exp (-(gamma / alpha s) * | |
| β' n : β, rho^(H+n) * maxD (H+n) T) | |
| else 0 | |
| else 0 | |
| def A (f : β β β) (s : β) : β := limUnder atTop (fun H : β => AH H f s) | |
| def N (k : β) (x : β) : β := by | |
| classical | |
| exact (((Finset.Icc 1 βxββ).filter fun v => | |
| IsTotient v β§ (k : β) * x < ell v β§ (ell v : β) β€ (k+1 : β) * x).card : β) | |
| def fk (k : β) (r : β) : β := min 1 ((k+1 : β) / r) - min 1 ((k : β) / r) | |
| /-- Without a totient value whose least preimage exceeds its prescribed multiple, | |
| both the weighted count and its limiting coefficient vanish. -/ | |
| theorem companion_zero_case (k : β) (_hk : 0 < k) | |
| (hno : Β¬ β d : β, IsTotient d β§ k*d < ell d) : | |
| (β x : β, 0 < x β N k x = 0) β§ | |
| (β s β Set.Ico (0 : β) 1, A (fk k) s = 0) := by | |
| sorry | |
| end TotientAsymptotic | |
| end | |
| end OAI | |