@ceccec/millennium-solutions 9.3.2 → 9.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/README.md +54 -40
  2. package/dist/mod.core.d.ts +9 -0
  3. package/dist/mod.core.js +9 -0
  4. package/dist/src/0/index.d.ts +47 -0
  5. package/dist/src/0/index.js +189 -0
  6. package/dist/src/0/ledger.d.ts +1 -0
  7. package/dist/src/0/ledger.js +25 -0
  8. package/dist/src/0/trinity-matrix.d.ts +1 -0
  9. package/dist/src/0/trinity-matrix.js +16 -0
  10. package/dist/src/5/aspects.d.ts +1 -0
  11. package/dist/src/5/aspects.js +22 -0
  12. package/dist/src/5/reflection.d.ts +1 -0
  13. package/dist/src/5/reflection.js +25 -0
  14. package/dist/src/7/rosetta.d.ts +1 -0
  15. package/dist/src/7/rosetta.js +24 -0
  16. package/dist/src/9/enumeration.d.ts +1 -0
  17. package/dist/src/9/enumeration.js +14 -0
  18. package/dist/src/honesty/index.d.ts +16 -0
  19. package/dist/src/honesty/index.js +69 -0
  20. package/package.json +27 -10
  21. package/.zenodo.json +0 -51
  22. package/ABSTRACT.md +0 -155
  23. package/ACCOUNTING.md +0 -27
  24. package/AXIOMS.md +0 -574
  25. package/CHALLENGES.md +0 -2434
  26. package/DEPLOY.md +0 -39
  27. package/DEVELOP.md +0 -34
  28. package/HEART.md +0 -112
  29. package/PHYSICS-SCALES.md +0 -80
  30. package/PRIOR-ART.md +0 -151
  31. package/PROOF-OF-CONCEPT.md +0 -81
  32. package/REALISATIONS.md +0 -87
  33. package/RESEARCH.md +0 -188
  34. package/RULES.md +0 -57
  35. package/SEQUENCE-DECODE.md +0 -196
  36. package/SIGNATURE.md +0 -34
  37. package/THEOREMS.md +0 -97
  38. package/WHITEPAPER.md +0 -40
  39. package/WORKFLOWS.md +0 -47
  40. package/boundaries.md +0 -23
  41. package/captain.md +0 -85
  42. package/compare.md +0 -42
  43. package/compute.md +0 -543
  44. package/cryptography.md +0 -55
  45. package/dashboard.md +0 -50
  46. package/examples.md +0 -47
  47. package/folds.md +0 -65
  48. package/forensic.md +0 -67
  49. package/guide.md +0 -126
  50. package/harness.md +0 -20
  51. package/index.md +0 -217
  52. package/mod.core.ts +0 -10
  53. package/nature.md +0 -58
  54. package/organism.md +0 -30
  55. package/paper.md +0 -8100
  56. package/proofs.md +0 -26
  57. package/quantum.md +0 -40
  58. package/rights.md +0 -39
  59. package/solutions.md +0 -28
  60. package/speedup.md +0 -41
  61. package/src/0/chacha.ts +0 -3
  62. package/src/0/crypt.ts +0 -4
  63. package/src/0/csp.ts +0 -10
  64. package/src/0/entanglement.ts +0 -31
  65. package/src/0/fusion.ts +0 -28
  66. package/src/0/holographic.ts +0 -57
  67. package/src/0/impossible.ts +0 -30
  68. package/src/0/imprint.ts +0 -160
  69. package/src/0/index.ts +0 -263
  70. package/src/0/ledger.ts +0 -25
  71. package/src/0/legible.ts +0 -29
  72. package/src/0/limit.ts +0 -29
  73. package/src/0/merkle-proof.ts +0 -3
  74. package/src/0/null-token.ts +0 -24
  75. package/src/0/sha256.ts +0 -3
  76. package/src/0/singularity.ts +0 -20
  77. package/src/0/stream.ts +0 -47
  78. package/src/0/trinities.ts +0 -37
  79. package/src/0/trinity-matrix.ts +0 -20
  80. package/src/0/version-matrix.ts +0 -70
  81. package/src/1/acceptance.ts +0 -26
  82. package/src/1/index.ts +0 -80
  83. package/src/1/paradox.ts +0 -28
  84. package/src/1/vortex.lean +0 -6
  85. package/src/2/frequency-scales.ts +0 -28
  86. package/src/2/iching.ts +0 -34
  87. package/src/2/index.ts +0 -78
  88. package/src/2/primes-vortex.ts +0 -12
  89. package/src/2/quantum.ts +0 -48
  90. package/src/2/string-scale.ts +0 -14
  91. package/src/2/vortex.lean +0 -10
  92. package/src/3/index.ts +0 -63
  93. package/src/3/pi-bbp.ts +0 -13
  94. package/src/3/trinity.ts +0 -39
  95. package/src/3/vortex.lean +0 -7
  96. package/src/4/git.ts +0 -30
  97. package/src/4/index.ts +0 -63
  98. package/src/4/vortex.lean +0 -6
  99. package/src/5/aspects.ts +0 -27
  100. package/src/5/center.ts +0 -35
  101. package/src/5/development.ts +0 -45
  102. package/src/5/diamond.ts +0 -35
  103. package/src/5/folds.ts +0 -12
  104. package/src/5/index.ts +0 -63
  105. package/src/5/reflection.lean +0 -14
  106. package/src/5/reflection.ts +0 -14
  107. package/src/5/vortex.lean +0 -10
  108. package/src/6/dna.ts +0 -27
  109. package/src/6/index.ts +0 -63
  110. package/src/6/vortex.lean +0 -7
  111. package/src/7/cross.ts +0 -31
  112. package/src/7/glagolitic.ts +0 -51
  113. package/src/7/index.ts +0 -67
  114. package/src/7/language-lens.ts +0 -41
  115. package/src/7/lens.ts +0 -41
  116. package/src/7/locale.ts +0 -105
  117. package/src/7/rbac.ts +0 -31
  118. package/src/7/rosetta-clay.ts +0 -15
  119. package/src/7/rosetta.lean +0 -11
  120. package/src/7/rosetta.ts +0 -11
  121. package/src/7/string-dimensions.ts +0 -14
  122. package/src/7/vortex.lean +0 -6
  123. package/src/8/infinite.ts +0 -26
  124. package/src/8/merkaba/field.ts +0 -27
  125. package/src/8/merkaba/geometry.ts +0 -16
  126. package/src/8/merkaba/touch.ts +0 -26
  127. package/src/8/nucleus/magic.lean +0 -15
  128. package/src/8/nucleus/proton-mass-fit.ts +0 -9
  129. package/src/8/nucleus/proton-mass.lean +0 -10
  130. package/src/8/nucleus/shell-model-magic.ts +0 -10
  131. package/src/8/vortex.lean +0 -7
  132. package/src/9/access.ts +0 -34
  133. package/src/9/aura-funding.ts +0 -25
  134. package/src/9/coins.ts +0 -25
  135. package/src/9/enumeration.ts +0 -13
  136. package/src/9/funding.ts +0 -85
  137. package/src/9/security.ts +0 -36
  138. package/src/9/society.ts +0 -32
  139. package/src/9/vortex.lean +0 -11
  140. package/src/api/gates.ts +0 -122
  141. package/src/api/index.ts +0 -447
  142. package/src/api/lanes.ts +0 -81
  143. package/src/claims/index.ts +0 -81
  144. package/src/demand/queries.json +0 -1764
  145. package/src/face/index.ts +0 -100
  146. package/src/from/the/heart/index.ts +0 -11
  147. package/src/honesty/boundaries.ts +0 -29
  148. package/src/honesty/index.ts +0 -63
  149. package/src/html/index.ts +0 -10
  150. package/src/latex/index.ts +0 -474
  151. package/src/millennium/index.ts +0 -53
  152. package/src/play/the/game/index.ts +0 -12
  153. package/src/proof/README.md +0 -118
  154. package/src/proof/address.lean +0 -147
  155. package/src/proof/coin.lean +0 -152
  156. package/src/proof/covered.json +0 -9
  157. package/src/proof/demand.lean +0 -134
  158. package/src/proof/demand2.lean +0 -207
  159. package/src/proof/demand3.lean +0 -183
  160. package/src/proof/discovered.json +0 -19125
  161. package/src/proof/elementary.lean +0 -446
  162. package/src/proof/energy.lean +0 -291
  163. package/src/proof/families.lean +0 -648
  164. package/src/proof/fixtures/axiom-control.lean +0 -39
  165. package/src/proof/flow.lean +0 -54
  166. package/src/proof/fnv.lean +0 -116
  167. package/src/proof/generated-theorems.json +0 -207
  168. package/src/proof/generated.lean +0 -101
  169. package/src/proof/imagined.lean +0 -492
  170. package/src/proof/index.lean +0 -156
  171. package/src/proof/index.ts +0 -916
  172. package/src/proof/involution.lean +0 -90
  173. package/src/proof/ledgerclaims.lean +0 -84
  174. package/src/proof/light.lean +0 -158
  175. package/src/proof/mechanical.lean +0 -524
  176. package/src/proof/merkaba.lean +0 -89
  177. package/src/proof/merkle.lean +0 -132
  178. package/src/proof/nim.lean +0 -311
  179. package/src/proof/novelty.json +0 -751
  180. package/src/proof/phenomena.lean +0 -90
  181. package/src/proof/priorart.lean +0 -190
  182. package/src/proof/quantum.lean +0 -159
  183. package/src/proof/reach.lean +0 -105
  184. package/src/proof/recovered.lean +0 -56
  185. package/src/proof/reversal.lean +0 -148
  186. package/src/proof/revoked.json +0 -317
  187. package/src/proof/rights.lean +0 -155
  188. package/src/proof/sequences.lean +0 -219
  189. package/src/proof/speed.lean +0 -152
  190. package/src/proof/split.lean +0 -199
  191. package/src/proof/theorems.lean +0 -67
  192. package/src/proof/trial-all.json +0 -16046
  193. package/src/proof/z9.lean +0 -99
  194. package/src/proof/z9plus.lean +0 -300
  195. package/src/proofs.lisp +0 -170
  196. package/src/prove/emit.ts +0 -115
  197. package/src/prove/index.ts +0 -143
  198. package/src/prove/translate.ts +0 -638
  199. package/src/publication/index.ts +0 -362
  200. package/src/quantum/field.ts +0 -73
  201. package/src/quantum/tree.ts +0 -79
  202. package/src/receipts/1431b4c4-7950-8d7b-88d1-b633219692f8.json +0 -7
  203. package/src/receipts/171e09c0-4cfd-8ce0-a6ed-cd33d5553da3.json +0 -7
  204. package/src/receipts/1a1f16c9-3491-8050-b221-e2a362439be4.json +0 -12
  205. package/src/receipts/1da15f83-83a6-8d04-b1ac-334c2dd6abb3.json +0 -7
  206. package/src/receipts/375a57ed-ef99-855e-8f34-b77d08010f3c.json +0 -6
  207. package/src/receipts/3dcbbf9e-0e49-8ba7-921e-17e478dbafaf.json +0 -6
  208. package/src/receipts/43a24136-5ad9-81ef-97c9-17be1c05bb5f.json +0 -11
  209. package/src/receipts/4991be51-74ba-8f66-9534-e6dba52fb569.json +0 -10
  210. package/src/receipts/52375d8f-232b-8c01-9d82-a824ffa7b2b7.json +0 -6
  211. package/src/receipts/593b546a-36b4-8553-941a-0e03b7053a64.json +0 -7
  212. package/src/receipts/7f75c989-96c9-8a24-8d0d-7e690861ccb4.json +0 -6
  213. package/src/receipts/80f80b59-81d8-866d-9a14-f469729d3dc8.json +0 -6
  214. package/src/receipts/85ac8585-9dc1-8964-9848-ae0f49cc82fb.json +0 -7
  215. package/src/receipts/85db092e-f2c0-88e5-bf75-61c4a65d84e7.json +0 -7
  216. package/src/receipts/95bacad3-9e56-8741-b0f8-def2c6ecb050.json +0 -7
  217. package/src/receipts/a1d33966-7bbd-84ca-902b-49e315af60e0.json +0 -6
  218. package/src/receipts/b20ced61-24ad-8123-adee-56031ab734dd.json +0 -11
  219. package/src/receipts/ba0447cd-f489-841a-a70f-a39b18ec2946.json +0 -11
  220. package/src/receipts/bcddbe66-06cf-8f31-a261-98b836938947.json +0 -7
  221. package/src/receipts/c1bac0d8-d906-8196-a4f0-3d8270b2e944.json +0 -6
  222. package/src/receipts/ce851ea3-3cf8-8646-a5d6-c0c6281210fe.json +0 -10
  223. package/src/receipts/cf43a122-c880-8d86-9e25-6f22f92d6b0a.json +0 -7
  224. package/src/receipts/daad8cd4-d4db-8dca-9c97-9a838cbce528.json +0 -7
  225. package/src/receipts/dc8bdb82-599f-8020-9eb2-cb016b408ec1.json +0 -6
  226. package/src/receipts/df77c265-d1a8-8354-8a9e-769fa5c676e2.json +0 -6
  227. package/src/receipts/e96686da-a411-8838-a5c8-ee7472bce048.json +0 -10
  228. package/src/receipts/f073c46f-7b67-83d0-aca5-db11fac4b5ec.json +0 -7
  229. package/src/receipts/f946d99d-a1c2-89f7-9426-a367c5b04191.json +0 -6
  230. package/src/receipts/fc069e45-115d-8983-ad25-fb9f735da84b.json +0 -6
  231. package/src/the/abstract/index.ts +0 -21
  232. package/src/the/abundance/index.ts +0 -20
  233. package/src/the/apple/earth/index.ts +0 -23
  234. package/src/the/apple/earth/navigation/index.ts +0 -28
  235. package/src/the/apple/earth/truth/index.ts +0 -19
  236. package/src/the/apple/index.ts +0 -27
  237. package/src/the/cancer/index.ts +0 -26
  238. package/src/the/clown/index.ts +0 -25
  239. package/src/the/creation/index.ts +0 -16
  240. package/src/the/crystal/index.ts +0 -23
  241. package/src/the/domain/index.ts +0 -16
  242. package/src/the/game/index.ts +0 -11
  243. package/src/the/gold/compass/index.ts +0 -26
  244. package/src/the/gold/index.ts +0 -35
  245. package/src/the/heart/index.ts +0 -15
  246. package/src/the/index.ts +0 -23
  247. package/src/the/law/index.ts +0 -20
  248. package/src/the/path/index.ts +0 -19
  249. package/src/the/rosetta/index.ts +0 -33
  250. package/src/the/sequence/index.ts +0 -12
  251. package/src/the/solids/index.ts +0 -25
  252. package/src/the/state/index.ts +0 -20
  253. package/src/the/superposition/state/index.ts +0 -22
  254. package/src/the/surface/index.ts +0 -26
  255. package/src/the/theorem/index.ts +0 -14
  256. package/src/the/torus/index.ts +0 -23
  257. package/src/the/waves/index.ts +0 -23
  258. package/the.md +0 -20
  259. package/verify.md +0 -67
@@ -1,207 +0,0 @@
1
- import Families
2
- set_option maxRecDepth 8000000
3
- set_option maxHeartbeats 4000000
4
- -- title: The next tier of what is asked for
5
- -- wing: the floor
6
- -- prior_art: named
7
- -- prior_art_domain: elementary number theory, second tier
8
- -- prior_art_note: Wilson’s theorem — John Wilson; first proved by Joseph-Louis Lagrange, 1771; the Catalan conjecture on consecutive perfect powers — Eugène Catalan, 1844; proved by Preda Mihăilescu, 2002
9
- --
10
- -- THE SECOND COURSE OF THE SAME FLOOR. `demand.lean` closed the top eight topics in src/demand/queries.json;
11
- -- this file takes the next eight, chosen the same way — by impressions, not by taste. The demand map is three
12
- -- months of the deposit's own Google Search Console data with the retrieval scaffolding stripped, so what is
13
- -- ranked is the TOPIC people wanted a citable source for, not the phrasing they reached for.
14
- --
15
- -- Three of the loudest remaining topics are not here, and the reason is the same in each case: they are not
16
- -- decidable finite arithmetic, and a rational stand-in would be a forgery rather than a proof. The quadratic
17
- -- exponential sum bounded by n^{3/8} (74 impressions across twelve phrasings) is a Weyl-sum estimate over the
18
- -- reals. Archimedes' bracket 223/71 < π < 22/7 (8) quantifies over π, which has no finite decidable content —
19
- -- the rational lemma 265/153 < √3 < 1351/780 that Archimedes actually computed with is decidable, but it is a
20
- -- DIFFERENT statement and would be passed off as this one. ζ(−1) = −1/12 (6) is an analytic continuation, and
21
- -- the divergent sum it is written to look like is not equal to it. Those three are named here rather than
22
- -- quietly dropped, because an omission nobody can see is indistinguishable from an omission nobody made.
23
- --
24
- -- Author: Tsvetan Rouschev · License: CC BY-NC-ND 4.0 · No axioms, no Mathlib, no sorry.
25
-
26
- namespace Demand2
27
-
28
- open Families
29
-
30
- -- ── 1 · Nicomachus's theorem — 9 impressions across four phrasings ("nicomachus's theorem", "sum of
31
- -- consecutive cubes", "sum of consecutive cubes formula"). The sum of the first n cubes is the SQUARE
32
- -- of the nth triangular number, checked to n = 40 in both of the forms it is asked in: against T_n²
33
- -- and against (1+2+⋯+n)². The third clause is what keeps this from being a coincidence about sums —
34
- -- the sum of the first n FOURTH powers is not a perfect square for any n from 2 to 20, so squareness
35
- -- is a property of the cubes and not of power sums generally. n = 1 is carried as the boundary case
36
- -- where it does hold, so the negative is a real dividing line rather than a blanket denial. ──
37
- def sumPow (p n : Nat) : Nat := (List.range' 1 n).foldl (fun a k => a + k ^ p) 0
38
- def tri (n : Nat) : Nat := n * (n + 1) / 2
39
- -- squareness by trial root rather than by an integer square root: `bound` must exceed √m, and 900² far
40
- -- exceeds the largest fourth-power sum tested here (Σ_{k≤20} k⁴ = 722666, whose root is under 851).
41
- def isSquareBelow (bound m : Nat) : Bool := (List.range bound).any (fun r => r * r == m)
42
-
43
- theorem nicomachus_sum_of_cubes_is_the_square_of_the_triangular_number :
44
- (List.range' 1 40).all (fun n => sumPow 3 n == tri n * tri n) ∧
45
- (List.range' 1 40).all (fun n => sumPow 3 n == sumPow 1 n * sumPow 1 n) ∧
46
- (List.range' 2 19).all (fun n => ¬ isSquareBelow 900 (sumPow 4 n)) ∧
47
- isSquareBelow 900 (sumPow 4 1) = true := by decide
48
-
49
- -- ── 2 · Pick's theorem — 7 impressions across five phrasings. Area = I + B/2 − 1 for a lattice polygon;
50
- -- halves do not live in ℤ, so it is stated in its doubled form 2·Area = 2I + B − 2, with 2·Area read
51
- -- off the shoelace cross product exactly. Quantified over EVERY positively oriented lattice triangle
52
- -- with vertices in the 4×4 grid. The second clause is the discriminator: dropping the −2 gives a
53
- -- formula that holds for NOT ONE of those triangles, so the constant is pinned rather than assumed.
54
- -- The last two clauses are the census, decided rather than asserted in this comment — there are 1548
55
- -- such triangles, and 516 of them contain an interior lattice point, so the range is neither empty nor
56
- -- degenerate and the interior term of the formula is carrying weight. ──
57
- def pts : List (Int × Int) :=
58
- (List.range 4).flatMap (fun x => (List.range 4).map (fun y => (Int.ofNat x, Int.ofNat y)))
59
- def triples : List ((Int × Int) × (Int × Int) × (Int × Int)) :=
60
- pts.flatMap (fun a => pts.flatMap (fun b => pts.map (fun c => (a, b, c))))
61
- def cross (a b c : Int × Int) : Int := (b.1 - a.1) * (c.2 - a.2) - (c.1 - a.1) * (b.2 - a.2)
62
- def interiorCount (a b c : Int × Int) : Int :=
63
- Int.ofNat (pts.filter (fun q => cross a b q > 0 && cross b c q > 0 && cross c a q > 0)).length
64
- def boundaryCount (a b c : Int × Int) : Int :=
65
- Int.ofNat (pts.filter (fun q =>
66
- cross a b q ≥ 0 && cross b c q ≥ 0 && cross c a q ≥ 0 &&
67
- (cross a b q == 0 || cross b c q == 0 || cross c a q == 0))).length
68
-
69
- theorem picks_theorem_holds_for_every_lattice_triangle_in_the_four_grid :
70
- pts.all (fun a => pts.all (fun b => pts.all (fun c =>
71
- cross a b c ≤ 0 || cross a b c == 2 * interiorCount a b c + boundaryCount a b c - 2))) ∧
72
- ¬ pts.any (fun a => pts.any (fun b => pts.any (fun c =>
73
- cross a b c > 0 && cross a b c == 2 * interiorCount a b c + boundaryCount a b c))) ∧
74
- (triples.filter (fun t => cross t.1 t.2.1 t.2.2 > 0)).length = 1548 ∧
75
- (triples.filter (fun t => cross t.1 t.2.1 t.2.2 > 0 && interiorCount t.1 t.2.1 t.2.2 > 0)).length = 516
76
- := by decide
77
-
78
- -- ── 3 · Bézout's identity — 6 impressions across three phrasings. Both halves of the statement are decided,
79
- -- because only together do they say that gcd is the LEAST positive combination rather than merely
80
- -- SOME combination. Attainment: for every pair of a, b up to 30 there are coefficients under 31 with
81
- -- a·x = b·y + gcd(a,b). Minimality: for every a, b, x, y up to 20, whenever a·x ≥ b·y the difference
82
- -- is a multiple of gcd(a,b) — so nothing smaller and positive is ever reachable. The subtraction is
83
- -- guarded by the inequality rather than performed, since ℕ subtraction truncates and a truncated 0
84
- -- would satisfy the divisibility test for the wrong reason. The named instance is the textbook one:
85
- -- gcd(240, 46) = 2 attained as 46·47 − 240·9. ──
86
- theorem bezouts_identity_is_attained_and_no_smaller_combination_exists :
87
- (List.range' 1 30).all (fun a => (List.range' 1 30).all (fun b =>
88
- (List.range 31).any (fun x => (List.range 31).any (fun y =>
89
- a * x == b * y + Families.gcd' a b)))) ∧
90
- (List.range' 1 20).all (fun a => (List.range' 1 20).all (fun b =>
91
- (List.range 21).all (fun x => (List.range 21).all (fun y =>
92
- a * x < b * y || (a * x - b * y) % Families.gcd' a b == 0)))) ∧
93
- Families.gcd' 240 46 = 2 ∧ 46 * 47 = 240 * 9 + 2 := by decide
94
-
95
- -- ── 4 · There are 576 Latin squares of order 4 — 6 impressions across four phrasings. Counted, not quoted:
96
- -- every permutation of {0,1,2,3} is generated, and rows are added one at a time subject to the column
97
- -- constraint, so the 576 is the size of an enumerated set. The orders 1, 2 and 3 are counted by the
98
- -- same function in the same theorem, which is what rules out a counter that happens to return 576 —
99
- -- it must also return 1, 2 and 12. The last clause separates the true count from the naive guess that
100
- -- the rows are independent, which would give (4!)³ = 13824 for the last three rows. ──
101
- def tuples : Nat → Nat → List (List Nat)
102
- | 0, _ => [[]]
103
- | Nat.succ k, n => (tuples k n).flatMap (fun t => (List.range n).map (fun v => v :: t))
104
- def permsOf (n : Nat) : List (List Nat) := (tuples n n).filter (fun r => r.eraseDups.length == n)
105
- def discord (n : Nat) (r s : List Nat) : Bool := (List.range n).all (fun j => ¬ (r.getD j 0 == s.getD j 0))
106
- -- fuel is the number of rows still to place, so the recursion is structural: no well-founded measure, and
107
- -- the permutation list is threaded through rather than rebuilt at every node.
108
- def countRows : Nat → Nat → List (List Nat) → List (List Nat) → Nat
109
- | 0, _, _, _ => 1
110
- | Nat.succ k, n, ps, sofar =>
111
- ((ps.filter (fun r => sofar.all (fun p => discord n r p))).map
112
- (fun r => countRows k n ps (r :: sofar))).foldl (· + ·) 0
113
- def latinSquares (n : Nat) : Nat := countRows n n (permsOf n) []
114
-
115
- theorem the_latin_squares_of_order_four_number_five_hundred_and_seventy_six :
116
- latinSquares 4 = 576 ∧ latinSquares 3 = 12 ∧ latinSquares 2 = 2 ∧ latinSquares 1 = 1 ∧
117
- ¬ (latinSquares 4 = 24 * 24 * 24) := by decide
118
-
119
- -- ── 5 · The closed form for the sum of fifth powers — 5 impressions across two phrasings, both of which
120
- -- quote it as n²(n+1)²(2n²+2n−1)/12. The division is cleared rather than performed, so the statement
121
- -- is 12·Σk⁵ = n²(n+1)²(2n²+2n−1) and no rounding can hide inside it; that the twelfth is exact is
122
- -- exactly what the equation then says. The negative clause rules out the natural wrong guess by
123
- -- analogy with Nicomachus — Σk⁵ is NOT T_n³ for any n from 2 to 20, though it is at n = 1. ──
124
- theorem the_sum_of_fifth_powers_has_the_closed_form_asked_for :
125
- (List.range' 1 20).all (fun n => 12 * sumPow 5 n == n * n * (n + 1) * (n + 1) * (2 * n * n + 2 * n - 1)) ∧
126
- (List.range' 2 19).all (fun n => ¬ (sumPow 5 n == tri n * tri n * tri n)) ∧
127
- sumPow 5 1 = 1 ∧ sumPow 5 2 = 33 ∧ sumPow 5 4 = 1300 := by decide
128
-
129
- -- ── 6 · The Chinese remainder theorem — 5 impressions across five phrasings, including Sunzi's by name.
130
- -- Stated as an IFF over every pair of moduli from 1 to 9, which is what makes the coprimality
131
- -- hypothesis load-bearing instead of decorative: the pair map x ↦ (x mod m, x mod n) covers every
132
- -- residue pair below m·n EXACTLY when gcd(m,n) = 1, and demonstrably fails to cover when it does not.
133
- -- The second clause is Sunzi's own problem, and it is stated as a uniqueness claim — the residue
134
- -- conditions 2 mod 3, 3 mod 5, 2 mod 7 have exactly one solution below 105, and it is 23. ──
135
- def crtCoversAllPairs (m n : Nat) : Bool :=
136
- (List.range m).all (fun a => (List.range n).all (fun b =>
137
- (List.range (m * n)).any (fun x => x % m == a && x % n == b)))
138
-
139
- theorem the_chinese_remainder_theorem_holds_exactly_when_the_moduli_are_coprime :
140
- (List.range' 1 9).all (fun m => (List.range' 1 9).all (fun n =>
141
- crtCoversAllPairs m n == (Families.gcd' m n == 1))) ∧
142
- (List.range 105).filter (fun x => x % 3 == 2 && x % 5 == 3 && x % 7 == 2) = [23] := by decide
143
-
144
- -- ── 7 · Catalan's conjecture, Mihăilescu's theorem — 4 impressions across three phrasings. 8 and 9 are the
145
- -- only consecutive perfect powers. The general statement is Mihăilescu's and is not decidable; what is
146
- -- decided here is the exhaustive range: below 2000 there are 55 distinct perfect powers, and exactly
147
- -- one of them is followed immediately by another. Both numbers matter — the 55 is stated so that the
148
- -- uniqueness cannot be explained away as a range too sparse to contain a second pair. ──
149
- def perfectPowersUpTo (bound : Nat) : List Nat :=
150
- ((List.range' 2 43).flatMap (fun b => (List.range' 2 10).map (fun e => b ^ e))).filter
151
- (fun v => v ≤ bound) |>.eraseDups
152
- def pp2000 : List Nat := perfectPowersUpTo 2000
153
-
154
- theorem eight_and_nine_are_the_only_consecutive_perfect_powers_below_two_thousand :
155
- (List.range' 1 1999).filter (fun n => pp2000.contains n && pp2000.contains (n + 1)) = [8] ∧
156
- pp2000.length = 55 ∧ pp2000.contains 8 = true ∧ pp2000.contains 9 = true := by decide
157
-
158
- -- ── 8 · 220 and 284 are amicable, and they are the smallest such pair — 4 impressions across four phrasings
159
- -- ("220 and 284", "220 284", "divisors of 284", "smallest amicable numbers"). The aliquot sum is
160
- -- computed from the proper divisors directly. The minimality clause is the exhaustive half: for every
161
- -- a from 2 to 219 it is NOT the case that s(s(a)) = a with s(a) ≠ a, so no amicable pair has a member
162
- -- below 220. The s(a) ≠ a guard is what separates amicable pairs from perfect numbers, and the last
163
- -- clause names the two perfect numbers in that range so the guard is visibly doing something. ──
164
- def aliquot (n : Nat) : Nat := ((List.range' 1 (n - 1)).filter (fun d => n % d == 0)).foldl (· + ·) 0
165
-
166
- theorem two_twenty_and_two_eighty_four_are_the_smallest_amicable_pair :
167
- aliquot 220 = 284 ∧ aliquot 284 = 220 ∧
168
- (List.range' 2 218).all (fun a => ¬ (aliquot (aliquot a) == a && ¬ (aliquot a == a))) ∧
169
- (List.range' 2 218).filter (fun a => aliquot a == a) = [6, 28] := by decide
170
-
171
-
172
- -- ── the capped rows above, proved for every value — no bound ─────────────────────────────────────────────────
173
- -- sumPow is Families.powSum written as a single fold, so the Faulhaber laws proved there carry
174
- -- nicomachus_sum_of_cubes_is_the_square_of_the_triangular_number (n ≤ 40) and
175
- -- the_sum_of_fifth_powers_has_the_closed_form_asked_for (n ≤ 20) to every n.
176
- theorem the_two_power_sums_are_one_sum : ∀ p n : Nat, sumPow p n = powSum p n := by
177
- intro p n
178
- unfold sumPow powSum
179
- rw [List.foldl_map]
180
-
181
- theorem nicomachus_sum_of_cubes_is_the_square_of_the_triangular_number_for_every_n :
182
- ∀ n : Nat, sumPow 3 n = tri n * tri n := by
183
- intro n
184
- have c := the_cubes_sum_to_their_closed_form_for_every_n n
185
- rw [← the_two_power_sums_are_one_sum] at c
186
- have ev : n * (n + 1) % 2 = 0 := by
187
- rcases Nat.mod_two_eq_zero_or_one n with e | e <;> simp [Nat.mul_mod, Nat.add_mod, e]
188
- have hd : n * (n + 1) / 2 * 2 = n * (n + 1) := Nat.div_mul_cancel (Nat.dvd_of_mod_eq_zero ev)
189
- unfold tri
190
- generalize n * (n + 1) / 2 = t at hd ⊢
191
- generalize sumPow 3 n = s at c ⊢
192
- have q : 4 * s = 4 * (t * t) := by
193
- have hsq : (t * 2) * (t * 2) = (n * (n + 1)) * (n * (n + 1)) := by rw [hd]
194
- clear hd ev
195
- try simp only [Nat.mul_add, Nat.add_mul, Nat.pow_succ, Nat.pow_zero, Nat.one_mul, Nat.mul_one, Nat.reduceMul, Nat.reduceAdd] at *
196
- try simp only [Nat.mul_assoc, Nat.mul_comm, Nat.mul_left_comm, Nat.reduceMul] at *
197
- try simp only [Nat.mul_comm _ (OfNat.ofNat _), Nat.mul_left_comm _ (OfNat.ofNat _), Nat.reduceMul] at *
198
- all_goals omega
199
- exact Nat.eq_of_mul_eq_mul_left (by decide) q
200
-
201
- theorem the_sum_of_fifth_powers_has_the_closed_form_for_every_n :
202
- ∀ n : Nat, 12 * sumPow 5 n = n * n * (n + 1) * (n + 1) * (2 * n * n + 2 * n - 1) := by
203
- intro n
204
- rw [the_two_power_sums_are_one_sum]
205
- exact the_fifth_powers_sum_to_their_closed_form_for_every_n n
206
-
207
- end Demand2
@@ -1,183 +0,0 @@
1
- import Demand
2
- import Sequences
3
- set_option maxRecDepth 8000000
4
- set_option maxHeartbeats 4000000
5
- -- title: The named theorems people ask for
6
- -- wing: the floor
7
- -- prior_art: named
8
- -- prior_art_domain: elementary number theory, named results
9
- -- prior_art_note: Legendre’s three-square theorem — Adrien-Marie Legendre, 1797; Carmichael numbers — Robert Carmichael, 1910; amicable pairs — known to antiquity
10
- --
11
- -- The third and last tier the search data supports. What remains uncovered after this is not a backlog:
12
- -- ranked by impressions, the leftovers are brand queries ("ceccec"), a Glagolitic string, bare fragments
13
- -- ("4³", "6/720", "8 mod 9" — the last already decided in z9.lean), and the real-analysis cluster that was
14
- -- refused in demand2.lean and stays refused. The demand map is close to exhausted of things a kernel can
15
- -- settle, which is a better place to stop than an arbitrary count would have been.
16
- --
17
- -- Two of these were named by the previous pass as the reasonable next candidates and are here: Havel–Hakimi
18
- -- and Lagrange's four-square theorem. Each theorem below carries a proved NEGATIVE or a converse, because a
19
- -- statement true of everything in its range establishes nothing about the range.
20
- --
21
- -- Author: Tsvetan Rouschev · License: CC BY-NC-ND 4.0 · No axioms, no Mathlib, no sorry.
22
-
23
- namespace Demand3
24
-
25
- open Demand Sequences
26
-
27
- -- ── 1 · WILSON'S THEOREM, and its converse, which is the half that makes it a test. (p−1)! ≡ −1 mod p for
28
- -- every prime, written as ≡ p−1 since Nat has no negatives; and for every composite above four,
29
- -- (n−1)! ≡ 0. The two together are a primality CRITERION rather than a property of primes. ──
30
- theorem wilsons_theorem_and_its_converse :
31
- ((List.range' 2 18).all (fun p => ¬ isPrime p || Sequences.fact (p - 1) % p == p - 1)) ∧
32
- ((List.range' 5 15).all (fun n => isPrime n || Sequences.fact (n - 1) % n == 0)) := by decide
33
-
34
- -- ── 2 · LAGRANGE'S FOUR-SQUARE THEOREM over the range the kernel can exhaust: every natural number is a sum
35
- -- of four squares. The negative is what gives it content — THREE squares do not suffice, and 7 is the
36
- -- first witness, which is exactly the excluded form Legendre's theorem describes in demand.lean. ──
37
- def isSumOfFour (n : Nat) : Bool :=
38
- (List.range 9).any (fun a => (List.range 9).any (fun b => (List.range 9).any (fun c =>
39
- (List.range 9).any (fun d => a*a + b*b + c*c + d*d == n))))
40
- def isSumOfThree (n : Nat) : Bool :=
41
- (List.range 9).any (fun a => (List.range 9).any (fun b => (List.range 9).any (fun c =>
42
- a*a + b*b + c*c == n)))
43
-
44
- theorem every_number_is_a_sum_of_four_squares :
45
- (List.range 60).all isSumOfFour ∧ isSumOfThree 7 = false ∧ isSumOfFour 7 = true := by decide
46
-
47
- -- ── 3 · THE CANTOR PAIRING FUNCTION is a bijection ℕ² → ℕ. Injectivity is checked over an 8×8 block by
48
- -- counting distinct images, and surjectivity onto an initial segment by checking that the block's
49
- -- images cover 0..35 exactly — a pairing that is merely injective would leave holes. ──
50
- def cantor (a b : Nat) : Nat := (a + b) * (a + b + 1) / 2 + b
51
- def block : List Nat := (List.range 8).flatMap (fun a => (List.range 8).map (fun b => cantor a b))
52
-
53
- theorem the_cantor_pairing_is_injective_and_covers_an_initial_segment :
54
- block.eraseDups.length = 64 ∧ ((List.range 36).all (fun n => block.contains n)) := by decide
55
-
56
- -- ── 4 · REPUNIT DIVISIBILITY: 3 divides R_n exactly when 3 divides n, and 7 divides R_n exactly when 6
57
- -- divides n. Both stated as iff over the range, so the pattern is decided in both directions rather
58
- -- than sampled where it happens to hold. ──
59
- def repunit : Nat → Nat
60
- | 0 => 0
61
- | Nat.succ n => 10 * repunit n + 1
62
-
63
- theorem repunit_divisibility_by_three_and_seven :
64
- ((List.range' 1 18).all (fun n => (repunit n % 3 == 0) == (n % 3 == 0))) ∧
65
- ((List.range' 1 18).all (fun n => (repunit n % 7 == 0) == (n % 6 == 0))) := by decide
66
-
67
- -- ── 5 · THE EULER CHARACTERISTIC of a closed orientable surface of genus g is 2 − 2g. Written 2 + 2·0 − 2g
68
- -- would truncate in ℕ, so the identity is stated as χ + 2g = 2 with χ carried as its own value —
69
- -- the same ℕ-subtraction trap that made an earlier draft "prove" 4 = 2. ──
70
- def chi (g : Nat) : Int := 2 - 2 * (g : Int)
71
-
72
- theorem the_euler_characteristic_of_a_genus_g_surface :
73
- ((List.range 12).all (fun g => chi g + 2 * (g : Int) == 2)) ∧ chi 0 = 2 ∧ chi 1 = 0 ∧ chi 2 = -2 := by decide
74
-
75
- -- ── 6 · A NUMBER HAS AN ODD NUMBER OF DIVISORS EXACTLY WHEN IT IS A PERFECT SQUARE — the divisors pair off
76
- -- as d with n/d, and only a square has a divisor paired with itself. Decided as an iff to 120. ──
77
- def isSquare (n : Nat) : Bool := (List.range 12).any (fun k => k * k == n)
78
-
79
- theorem odd_divisor_count_iff_perfect_square :
80
- (List.range' 1 120).all (fun n => ((divisors n).length % 2 == 1) == isSquare n) := by decide
81
-
82
- -- ── 7 · HAVEL–HAKIMI, at the sizes the kernel can hold. A degree sequence is graphical exactly when the
83
- -- reduction — remove the largest degree d, subtract one from the next d entries, re-sort — reaches
84
- -- all zeros. The sort is a structural insertion sort: Nat's own mergeSort is well-founded and would
85
- -- cost this file its axiom-free status. Stated with both a graphical sequence and a non-graphical one,
86
- -- since a test that only ever says yes is not a test. ──
87
- def ins (x : Nat) : List Nat → List Nat
88
- | [] => [x]
89
- | y :: ys => if x ≥ y then x :: y :: ys else y :: ins x ys
90
- def sortDesc : List Nat → List Nat
91
- | [] => []
92
- | x :: xs => ins x (sortDesc xs)
93
- -- FEASIBILITY IS CHECKED BEFORE SUBTRACTING, and that is the whole correctness of this definition in ℕ.
94
- -- The reduction subtracts one from the next d entries; if any of them is already 0 the real algorithm goes
95
- -- negative and reports NOT graphical, but ℕ truncates 0 − 1 to 0, so the subtraction silently succeeds and
96
- -- every sequence comes out graphical. [3,3,1,1] is the witness: it is not graphical, and the truncating
97
- -- version proved it was. The kernel refuted the theorem, in the file where I had just written a comment
98
- -- warning about this exact trap two theorems earlier.
99
- def feasible (d : Nat) (rest : List Nat) : Bool :=
100
- rest.length ≥ d && (rest.take d).all (fun x => x ≥ 1)
101
- def step : List Nat → List Nat
102
- | [] => []
103
- | d :: rest => sortDesc ((rest.take d).map (fun x => x - 1) ++ rest.drop d)
104
- def hh : Nat → List Nat → Bool
105
- | 0, l => l.all (fun x => x == 0)
106
- | Nat.succ f, l =>
107
- let s := sortDesc l
108
- if s.all (fun x => x == 0) then true
109
- else match s with
110
- | [] => true
111
- | d :: rest => if feasible d rest then hh f (step s) else false
112
-
113
- theorem havel_hakimi_decides_graphical_sequences :
114
- hh 12 [3, 3, 3, 3] = true ∧ hh 12 [2, 2, 2] = true ∧
115
- hh 12 [3, 3, 1, 1] = false ∧ hh 12 [4, 1, 1, 1, 1] = true ∧ hh 12 [5, 1, 1, 1, 1] = false := by decide
116
-
117
-
118
- -- ── the capped rows above, proved for every value by induction — no bound ────────────────────────────────────
119
- -- the_euler_characteristic_of_a_genus_g_surface checked g < 12; this proves χ(g) + 2g = 2 for every g.
120
- theorem the_euler_characteristic_of_a_genus_g_surface_for_every_g :
121
- ∀ g : Nat, chi g + 2 * (g : Int) = 2 := by
122
- intro g
123
- unfold chi
124
- omega
125
-
126
- theorem a_repunit_has_the_residue_of_its_length_mod_three : ∀ n : Nat, repunit n % 3 = n % 3 := by
127
- intro n
128
- induction n with
129
- | zero => rfl
130
- | succ n ih =>
131
- show (10 * repunit n + 1) % 3 = (n + 1) % 3
132
- rw [Nat.add_mod, Nat.mul_mod, ih]
133
- have h : n % 3 = 0 ∨ n % 3 = 1 ∨ n % 3 = 2 := by omega
134
- rcases h with h | h | h <;> simp [h] <;> omega
135
-
136
- -- repunit_divisibility_by_three_and_seven checked n ≤ 18; these prove both halves for every n.
137
- theorem a_repunit_is_divisible_by_three_exactly_when_its_length_is_for_every_n :
138
- ∀ n : Nat, (repunit n % 3 = 0) ↔ (n % 3 = 0) := by
139
- intro n
140
- rw [a_repunit_has_the_residue_of_its_length_mod_three]
141
-
142
- theorem repunit_of_a_sum : ∀ n k : Nat, repunit (n + k) = 10 ^ k * repunit n + repunit k := by
143
- intro n k
144
- induction k with
145
- | zero => simp [repunit]
146
- | succ k ih =>
147
- show 10 * repunit (n + k) + 1 = 10 ^ (k + 1) * repunit n + (10 * repunit k + 1)
148
- rw [ih, Nat.pow_succ, Nat.mul_add, ← Nat.mul_assoc, Nat.mul_comm 10 (10 ^ k)]
149
- omega
150
-
151
- theorem repunits_repeat_mod_seven_every_six_digits : ∀ n : Nat, repunit (n + 6) % 7 = repunit n % 7 := by
152
- intro n
153
- rw [repunit_of_a_sum, Nat.add_mod, Nat.mul_mod]
154
- have h1 : 10 ^ 6 % 7 = 1 := by decide
155
- have h2 : repunit 6 % 7 = 0 := by decide
156
- rw [h1, h2, Nat.one_mul, Nat.add_zero]
157
- omega
158
-
159
- theorem a_repunit_has_the_residue_of_its_length_mod_six_mod_seven : ∀ n : Nat, repunit n % 7 = repunit (n % 6) % 7 := by
160
- intro n
161
- induction n using Nat.strongRecOn with
162
- | _ n ih =>
163
- if hn : n < 6 then rw [Nat.mod_eq_of_lt hn]
164
- else
165
- have e : n = (n - 6) + 6 := by omega
166
- rw [e, repunits_repeat_mod_seven_every_six_digits, ih (n - 6) (by omega), Nat.add_mod_right]
167
-
168
- theorem a_repunit_is_divisible_by_seven_exactly_when_six_divides_its_length_for_every_n :
169
- ∀ n : Nat, (repunit n % 7 = 0) ↔ (n % 6 = 0) := by
170
- intro n
171
- rw [a_repunit_has_the_residue_of_its_length_mod_six_mod_seven]
172
- have h : n % 6 < 6 := Nat.mod_lt _ (by decide)
173
- generalize n % 6 = j at h ⊢
174
- revert j
175
- decide
176
-
177
-
178
- -- ── the fair-exchange unit, tied to the law above ───────────────────────────────────────────────────────────
179
- -- The deposit's fare is two coins, 110 − 108 = 2, written until now only in prose (split.lean's comments). χ is
180
- -- proved for every genus above; at genus 2 its negative is exactly the fare.
181
- theorem the_two_coin_fare_is_minus_the_euler_characteristic_at_genus_two : (110 : Int) - 108 = - chi 2 := by decide
182
-
183
- end Demand3