@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.
- package/README.md +54 -40
- package/dist/mod.core.d.ts +9 -0
- package/dist/mod.core.js +9 -0
- package/dist/src/0/index.d.ts +47 -0
- package/dist/src/0/index.js +189 -0
- package/dist/src/0/ledger.d.ts +1 -0
- package/dist/src/0/ledger.js +25 -0
- package/dist/src/0/trinity-matrix.d.ts +1 -0
- package/dist/src/0/trinity-matrix.js +16 -0
- package/dist/src/5/aspects.d.ts +1 -0
- package/dist/src/5/aspects.js +22 -0
- package/dist/src/5/reflection.d.ts +1 -0
- package/dist/src/5/reflection.js +25 -0
- package/dist/src/7/rosetta.d.ts +1 -0
- package/dist/src/7/rosetta.js +24 -0
- package/dist/src/9/enumeration.d.ts +1 -0
- package/dist/src/9/enumeration.js +14 -0
- package/dist/src/honesty/index.d.ts +16 -0
- package/dist/src/honesty/index.js +69 -0
- package/package.json +27 -10
- package/.zenodo.json +0 -51
- package/ABSTRACT.md +0 -155
- package/ACCOUNTING.md +0 -27
- package/AXIOMS.md +0 -574
- package/CHALLENGES.md +0 -2434
- package/DEPLOY.md +0 -39
- package/DEVELOP.md +0 -34
- package/HEART.md +0 -112
- package/PHYSICS-SCALES.md +0 -80
- package/PRIOR-ART.md +0 -151
- package/PROOF-OF-CONCEPT.md +0 -81
- package/REALISATIONS.md +0 -87
- package/RESEARCH.md +0 -188
- package/RULES.md +0 -57
- package/SEQUENCE-DECODE.md +0 -196
- package/SIGNATURE.md +0 -34
- package/THEOREMS.md +0 -97
- package/WHITEPAPER.md +0 -40
- package/WORKFLOWS.md +0 -47
- package/boundaries.md +0 -23
- package/captain.md +0 -85
- package/compare.md +0 -42
- package/compute.md +0 -543
- package/cryptography.md +0 -55
- package/dashboard.md +0 -50
- package/examples.md +0 -47
- package/folds.md +0 -65
- package/forensic.md +0 -67
- package/guide.md +0 -126
- package/harness.md +0 -20
- package/index.md +0 -217
- package/mod.core.ts +0 -10
- package/nature.md +0 -58
- package/organism.md +0 -30
- package/paper.md +0 -8100
- package/proofs.md +0 -26
- package/quantum.md +0 -40
- package/rights.md +0 -39
- package/solutions.md +0 -28
- package/speedup.md +0 -41
- package/src/0/chacha.ts +0 -3
- package/src/0/crypt.ts +0 -4
- package/src/0/csp.ts +0 -10
- package/src/0/entanglement.ts +0 -31
- package/src/0/fusion.ts +0 -28
- package/src/0/holographic.ts +0 -57
- package/src/0/impossible.ts +0 -30
- package/src/0/imprint.ts +0 -160
- package/src/0/index.ts +0 -263
- package/src/0/ledger.ts +0 -25
- package/src/0/legible.ts +0 -29
- package/src/0/limit.ts +0 -29
- package/src/0/merkle-proof.ts +0 -3
- package/src/0/null-token.ts +0 -24
- package/src/0/sha256.ts +0 -3
- package/src/0/singularity.ts +0 -20
- package/src/0/stream.ts +0 -47
- package/src/0/trinities.ts +0 -37
- package/src/0/trinity-matrix.ts +0 -20
- package/src/0/version-matrix.ts +0 -70
- package/src/1/acceptance.ts +0 -26
- package/src/1/index.ts +0 -80
- package/src/1/paradox.ts +0 -28
- package/src/1/vortex.lean +0 -6
- package/src/2/frequency-scales.ts +0 -28
- package/src/2/iching.ts +0 -34
- package/src/2/index.ts +0 -78
- package/src/2/primes-vortex.ts +0 -12
- package/src/2/quantum.ts +0 -48
- package/src/2/string-scale.ts +0 -14
- package/src/2/vortex.lean +0 -10
- package/src/3/index.ts +0 -63
- package/src/3/pi-bbp.ts +0 -13
- package/src/3/trinity.ts +0 -39
- package/src/3/vortex.lean +0 -7
- package/src/4/git.ts +0 -30
- package/src/4/index.ts +0 -63
- package/src/4/vortex.lean +0 -6
- package/src/5/aspects.ts +0 -27
- package/src/5/center.ts +0 -35
- package/src/5/development.ts +0 -45
- package/src/5/diamond.ts +0 -35
- package/src/5/folds.ts +0 -12
- package/src/5/index.ts +0 -63
- package/src/5/reflection.lean +0 -14
- package/src/5/reflection.ts +0 -14
- package/src/5/vortex.lean +0 -10
- package/src/6/dna.ts +0 -27
- package/src/6/index.ts +0 -63
- package/src/6/vortex.lean +0 -7
- package/src/7/cross.ts +0 -31
- package/src/7/glagolitic.ts +0 -51
- package/src/7/index.ts +0 -67
- package/src/7/language-lens.ts +0 -41
- package/src/7/lens.ts +0 -41
- package/src/7/locale.ts +0 -105
- package/src/7/rbac.ts +0 -31
- package/src/7/rosetta-clay.ts +0 -15
- package/src/7/rosetta.lean +0 -11
- package/src/7/rosetta.ts +0 -11
- package/src/7/string-dimensions.ts +0 -14
- package/src/7/vortex.lean +0 -6
- package/src/8/infinite.ts +0 -26
- package/src/8/merkaba/field.ts +0 -27
- package/src/8/merkaba/geometry.ts +0 -16
- package/src/8/merkaba/touch.ts +0 -26
- package/src/8/nucleus/magic.lean +0 -15
- package/src/8/nucleus/proton-mass-fit.ts +0 -9
- package/src/8/nucleus/proton-mass.lean +0 -10
- package/src/8/nucleus/shell-model-magic.ts +0 -10
- package/src/8/vortex.lean +0 -7
- package/src/9/access.ts +0 -34
- package/src/9/aura-funding.ts +0 -25
- package/src/9/coins.ts +0 -25
- package/src/9/enumeration.ts +0 -13
- package/src/9/funding.ts +0 -85
- package/src/9/security.ts +0 -36
- package/src/9/society.ts +0 -32
- package/src/9/vortex.lean +0 -11
- package/src/api/gates.ts +0 -122
- package/src/api/index.ts +0 -447
- package/src/api/lanes.ts +0 -81
- package/src/claims/index.ts +0 -81
- package/src/demand/queries.json +0 -1764
- package/src/face/index.ts +0 -100
- package/src/from/the/heart/index.ts +0 -11
- package/src/honesty/boundaries.ts +0 -29
- package/src/honesty/index.ts +0 -63
- package/src/html/index.ts +0 -10
- package/src/latex/index.ts +0 -474
- package/src/millennium/index.ts +0 -53
- package/src/play/the/game/index.ts +0 -12
- package/src/proof/README.md +0 -118
- package/src/proof/address.lean +0 -147
- package/src/proof/coin.lean +0 -152
- package/src/proof/covered.json +0 -9
- package/src/proof/demand.lean +0 -134
- package/src/proof/demand2.lean +0 -207
- package/src/proof/demand3.lean +0 -183
- package/src/proof/discovered.json +0 -19125
- package/src/proof/elementary.lean +0 -446
- package/src/proof/energy.lean +0 -291
- package/src/proof/families.lean +0 -648
- package/src/proof/fixtures/axiom-control.lean +0 -39
- package/src/proof/flow.lean +0 -54
- package/src/proof/fnv.lean +0 -116
- package/src/proof/generated-theorems.json +0 -207
- package/src/proof/generated.lean +0 -101
- package/src/proof/imagined.lean +0 -492
- package/src/proof/index.lean +0 -156
- package/src/proof/index.ts +0 -916
- package/src/proof/involution.lean +0 -90
- package/src/proof/ledgerclaims.lean +0 -84
- package/src/proof/light.lean +0 -158
- package/src/proof/mechanical.lean +0 -524
- package/src/proof/merkaba.lean +0 -89
- package/src/proof/merkle.lean +0 -132
- package/src/proof/nim.lean +0 -311
- package/src/proof/novelty.json +0 -751
- package/src/proof/phenomena.lean +0 -90
- package/src/proof/priorart.lean +0 -190
- package/src/proof/quantum.lean +0 -159
- package/src/proof/reach.lean +0 -105
- package/src/proof/recovered.lean +0 -56
- package/src/proof/reversal.lean +0 -148
- package/src/proof/revoked.json +0 -317
- package/src/proof/rights.lean +0 -155
- package/src/proof/sequences.lean +0 -219
- package/src/proof/speed.lean +0 -152
- package/src/proof/split.lean +0 -199
- package/src/proof/theorems.lean +0 -67
- package/src/proof/trial-all.json +0 -16046
- package/src/proof/z9.lean +0 -99
- package/src/proof/z9plus.lean +0 -300
- package/src/proofs.lisp +0 -170
- package/src/prove/emit.ts +0 -115
- package/src/prove/index.ts +0 -143
- package/src/prove/translate.ts +0 -638
- package/src/publication/index.ts +0 -362
- package/src/quantum/field.ts +0 -73
- package/src/quantum/tree.ts +0 -79
- package/src/receipts/1431b4c4-7950-8d7b-88d1-b633219692f8.json +0 -7
- package/src/receipts/171e09c0-4cfd-8ce0-a6ed-cd33d5553da3.json +0 -7
- package/src/receipts/1a1f16c9-3491-8050-b221-e2a362439be4.json +0 -12
- package/src/receipts/1da15f83-83a6-8d04-b1ac-334c2dd6abb3.json +0 -7
- package/src/receipts/375a57ed-ef99-855e-8f34-b77d08010f3c.json +0 -6
- package/src/receipts/3dcbbf9e-0e49-8ba7-921e-17e478dbafaf.json +0 -6
- package/src/receipts/43a24136-5ad9-81ef-97c9-17be1c05bb5f.json +0 -11
- package/src/receipts/4991be51-74ba-8f66-9534-e6dba52fb569.json +0 -10
- package/src/receipts/52375d8f-232b-8c01-9d82-a824ffa7b2b7.json +0 -6
- package/src/receipts/593b546a-36b4-8553-941a-0e03b7053a64.json +0 -7
- package/src/receipts/7f75c989-96c9-8a24-8d0d-7e690861ccb4.json +0 -6
- package/src/receipts/80f80b59-81d8-866d-9a14-f469729d3dc8.json +0 -6
- package/src/receipts/85ac8585-9dc1-8964-9848-ae0f49cc82fb.json +0 -7
- package/src/receipts/85db092e-f2c0-88e5-bf75-61c4a65d84e7.json +0 -7
- package/src/receipts/95bacad3-9e56-8741-b0f8-def2c6ecb050.json +0 -7
- package/src/receipts/a1d33966-7bbd-84ca-902b-49e315af60e0.json +0 -6
- package/src/receipts/b20ced61-24ad-8123-adee-56031ab734dd.json +0 -11
- package/src/receipts/ba0447cd-f489-841a-a70f-a39b18ec2946.json +0 -11
- package/src/receipts/bcddbe66-06cf-8f31-a261-98b836938947.json +0 -7
- package/src/receipts/c1bac0d8-d906-8196-a4f0-3d8270b2e944.json +0 -6
- package/src/receipts/ce851ea3-3cf8-8646-a5d6-c0c6281210fe.json +0 -10
- package/src/receipts/cf43a122-c880-8d86-9e25-6f22f92d6b0a.json +0 -7
- package/src/receipts/daad8cd4-d4db-8dca-9c97-9a838cbce528.json +0 -7
- package/src/receipts/dc8bdb82-599f-8020-9eb2-cb016b408ec1.json +0 -6
- package/src/receipts/df77c265-d1a8-8354-8a9e-769fa5c676e2.json +0 -6
- package/src/receipts/e96686da-a411-8838-a5c8-ee7472bce048.json +0 -10
- package/src/receipts/f073c46f-7b67-83d0-aca5-db11fac4b5ec.json +0 -7
- package/src/receipts/f946d99d-a1c2-89f7-9426-a367c5b04191.json +0 -6
- package/src/receipts/fc069e45-115d-8983-ad25-fb9f735da84b.json +0 -6
- package/src/the/abstract/index.ts +0 -21
- package/src/the/abundance/index.ts +0 -20
- package/src/the/apple/earth/index.ts +0 -23
- package/src/the/apple/earth/navigation/index.ts +0 -28
- package/src/the/apple/earth/truth/index.ts +0 -19
- package/src/the/apple/index.ts +0 -27
- package/src/the/cancer/index.ts +0 -26
- package/src/the/clown/index.ts +0 -25
- package/src/the/creation/index.ts +0 -16
- package/src/the/crystal/index.ts +0 -23
- package/src/the/domain/index.ts +0 -16
- package/src/the/game/index.ts +0 -11
- package/src/the/gold/compass/index.ts +0 -26
- package/src/the/gold/index.ts +0 -35
- package/src/the/heart/index.ts +0 -15
- package/src/the/index.ts +0 -23
- package/src/the/law/index.ts +0 -20
- package/src/the/path/index.ts +0 -19
- package/src/the/rosetta/index.ts +0 -33
- package/src/the/sequence/index.ts +0 -12
- package/src/the/solids/index.ts +0 -25
- package/src/the/state/index.ts +0 -20
- package/src/the/superposition/state/index.ts +0 -22
- package/src/the/surface/index.ts +0 -26
- package/src/the/theorem/index.ts +0 -14
- package/src/the/torus/index.ts +0 -23
- package/src/the/waves/index.ts +0 -23
- package/the.md +0 -20
- package/verify.md +0 -67
package/src/proof/sequences.lean
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import Fnv
|
|
2
|
-
set_option maxRecDepth 4000000
|
|
3
|
-
set_option maxHeartbeats 2000000
|
|
4
|
-
-- title: Sequences
|
|
5
|
-
-- wing: the ring
|
|
6
|
-
-- prior_art: named
|
|
7
|
-
-- prior_art_domain: integer sequences and identities
|
|
8
|
-
-- prior_art_note: Cassini’s identity — G. D. Cassini, 1680; Lucas sequences — Édouard Lucas, 1878; the Brahmagupta–Fibonacci identity — Brahmagupta, 628; Pascal’s triangle mod 2 — Blaise Pascal, 1654
|
|
9
|
-
-- Sequences and identities — Cassini, Lucas, Brahmagupta–Fibonacci, and Pascal mod two.
|
|
10
|
-
-- Author: Tsvetan Rouschev · License: CC BY-NC-ND 4.0
|
|
11
|
-
--
|
|
12
|
-
-- The ledger held these as TypeScript tests. Each is a classical identity with a real proof; what is done
|
|
13
|
-
-- here is to DECIDE each over a stated finite range, which is what `decide` can honestly deliver — the range
|
|
14
|
-
-- is named in every theorem rather than implied, and no theorem claims the general case.
|
|
15
|
-
--
|
|
16
|
-
-- Cassini alternates in sign, which the naturals cannot express directly, so it is stated in the two forms it
|
|
17
|
-
-- takes: the product exceeds the square by one at even indices and falls short by one at odd ones. Stating it
|
|
18
|
-
-- as a single subtraction would truncate at zero and quietly hold for the wrong reason.
|
|
19
|
-
|
|
20
|
-
namespace Sequences
|
|
21
|
-
|
|
22
|
-
def fib : Nat → Nat
|
|
23
|
-
| 0 => 0
|
|
24
|
-
| 1 => 1
|
|
25
|
-
| Nat.succ (Nat.succ n) => fib n + fib (n + 1)
|
|
26
|
-
|
|
27
|
-
def fact (n : Nat) : Nat := (List.range n).foldl (fun a k => a * (k + 1)) 1
|
|
28
|
-
def choose (n k : Nat) : Nat := fact n / (fact k * fact (n - k))
|
|
29
|
-
|
|
30
|
-
/-- bitwise AND, structural: Nat's own is well-founded and would drag propext into every theorem here -/
|
|
31
|
-
def andF : Nat → Nat → Nat → Nat
|
|
32
|
-
| 0, _, _ => 0
|
|
33
|
-
| _, 0, _ => 0
|
|
34
|
-
| _, _, 0 => 0
|
|
35
|
-
| Nat.succ f, a, b => (if a % 2 == 1 && b % 2 == 1 then 1 else 0) + 2 * andF f (a / 2) (b / 2)
|
|
36
|
-
def andN (a b : Nat) : Nat := andF 33 a b
|
|
37
|
-
|
|
38
|
-
-- ── CASSINI: F(n−1)·F(n+1) − F(n)² = ±1, alternating. Stated in both directions over 1..20. ──
|
|
39
|
-
theorem cassini_at_even_indices :
|
|
40
|
-
(List.range' 1 20).all (fun n => n % 2 == 1 || fib (n - 1) * fib (n + 1) == fib n * fib n + 1) := by decide
|
|
41
|
-
|
|
42
|
-
theorem cassini_at_odd_indices :
|
|
43
|
-
(List.range' 1 20).all (fun n => n % 2 == 0 || fib (n - 1) * fib (n + 1) + 1 == fib n * fib n) := by decide
|
|
44
|
-
|
|
45
|
-
-- ── and the deviation is never more than one, in either direction — the identity is tight ──
|
|
46
|
-
theorem cassini_deviation_is_exactly_one :
|
|
47
|
-
(List.range' 1 20).all (fun n =>
|
|
48
|
-
(fib (n - 1) * fib (n + 1) == fib n * fib n + 1) || (fib (n - 1) * fib (n + 1) + 1 == fib n * fib n)) := by decide
|
|
49
|
-
|
|
50
|
-
-- ── LUCAS mod two: C(n,k) is odd exactly when k AND n = k — the Sierpiński rule behind Rule 90 ──
|
|
51
|
-
theorem lucas_mod_two_is_the_and_rule :
|
|
52
|
-
(List.range 14).all (fun n => (List.range (n + 1)).all (fun k =>
|
|
53
|
-
(choose n k % 2 == 1) == (andN k n == k))) := by decide
|
|
54
|
-
|
|
55
|
-
-- ── NON-VACUITY: both cases actually occur in that range — odd and even entries are both present ──
|
|
56
|
-
theorem pascal_has_both_parities :
|
|
57
|
-
((List.range 14).flatMap (fun n => (List.range (n + 1)).map (fun k => choose n k % 2))).contains 1
|
|
58
|
-
∧ ((List.range 14).flatMap (fun n => (List.range (n + 1)).map (fun k => choose n k % 2))).contains 0 := by decide
|
|
59
|
-
|
|
60
|
-
-- ── BRAHMAGUPTA–FIBONACCI: sums of two squares are closed under multiplication ──
|
|
61
|
-
theorem sums_of_two_squares_are_closed :
|
|
62
|
-
(List.range 8).all (fun a => (List.range 8).all (fun b => (List.range 8).all (fun c => (List.range 8).all (fun d =>
|
|
63
|
-
(a*a + b*b) * (c*c + d*d) == (a*c - b*d) * (a*c - b*d) + (a*d + b*c) * (a*d + b*c)
|
|
64
|
-
|| (a*c) < (b*d))))) := by decide
|
|
65
|
-
|
|
66
|
-
-- ── the Fibonacci triple three, five, eight — consecutive, and summing as the recurrence requires ──
|
|
67
|
-
theorem three_five_eight_are_consecutive :
|
|
68
|
-
fib 4 = 3 ∧ fib 5 = 5 ∧ fib 6 = 8 ∧ fib 4 + fib 5 = fib 6 := by decide
|
|
69
|
-
|
|
70
|
-
-- ── the Pisano period binds Fibonacci to the ring: mod 9 it repeats every 24, four times the doubling six ──
|
|
71
|
-
theorem pisano_twentyfour_is_four_sixes :
|
|
72
|
-
(List.range 30).all (fun k => fib k % 9 == fib (k + 24) % 9) ∧ 24 = 4 * 6 := by decide
|
|
73
|
-
|
|
74
|
-
-- ── THUE–MORSE, RECOMPUTED AS LEAN ─────────────────────────────────────────────────────────────────────
|
|
75
|
-
-- The ledger carried `thue_morse_doubling_recurrence` and WITHDREW it, with the reason recorded: "not
|
|
76
|
-
-- backed by a Lean proof. Its evidence is a TypeScript test, which reports that a computation agreed once
|
|
77
|
-
-- on one machine; the kernel checks a proposition over its whole domain. Its content has no stated
|
|
78
|
-
-- decidable form yet."
|
|
79
|
-
--
|
|
80
|
-
-- Withdrawn for want of a proof, not because it is false — and it HAS a decidable form. t(n) is the parity
|
|
81
|
-
-- of the 1-bits of n. Doubling shifts every bit one place and introduces no new one, so the popcount is
|
|
82
|
-
-- unchanged and t(2n) = t(n). 2n+1 sets exactly one further bit, so the parity flips: t(2n+1) = 1 − t(n).
|
|
83
|
-
-- Both are decided below over a stated finite domain, which is what the withdrawal said was missing, and
|
|
84
|
-
-- proved for every n at the end of this file.
|
|
85
|
-
-- The fuel is n + 1, which covers every bit of every n (n < 2^(n+1)); the earlier fuel of 12 counted only the
|
|
86
|
-
-- low twelve bits — a cap every statement here had to stay under.
|
|
87
|
-
def popcount (n : Nat) : Nat := (List.range (n + 1)).foldl (fun a i => a + n / 2 ^ i % 2) 0
|
|
88
|
-
def tm (n : Nat) : Nat := popcount n % 2
|
|
89
|
-
|
|
90
|
-
-- Domain: n < 200 — the decided instance of the law proved for every n at the end of this file. The popcount
|
|
91
|
-
-- no longer stops at twelve bits, so no statement here can hold for the wrong reason at any size.
|
|
92
|
-
theorem thue_morse_doubling_recurrence :
|
|
93
|
-
(List.range 200).all (fun n => tm (2 * n) == tm n && tm (2 * n + 1) == 1 - tm n) := by decide
|
|
94
|
-
|
|
95
|
-
-- The two halves separately, so a reader can see which one a counterexample would break.
|
|
96
|
-
theorem doubling_preserves_the_parity_of_the_bits :
|
|
97
|
-
(List.range 200).all (fun n => popcount (2 * n) == popcount n) := by decide
|
|
98
|
-
|
|
99
|
-
theorem the_odd_step_sets_exactly_one_further_bit :
|
|
100
|
-
(List.range 200).all (fun n => popcount (2 * n + 1) == popcount n + 1) := by decide
|
|
101
|
-
|
|
102
|
-
-- And the domain is not vacuous: the sequence actually takes both values inside it, so `all` is not
|
|
103
|
-
-- passing over a set on which the property is trivially true.
|
|
104
|
-
theorem the_sequence_takes_both_values :
|
|
105
|
-
((List.range 200).filter (fun n => tm n == 0)).length = 100
|
|
106
|
-
∧ ((List.range 200).filter (fun n => tm n == 1)).length = 100 := by decide
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
-- ── the capped rows above, proved for every value — no bound ─────────────────────────────────────────────────
|
|
110
|
-
-- cassini_at_even_indices, cassini_at_odd_indices and cassini_deviation_is_exactly_one were checked n ≤ 20; one law
|
|
111
|
-
-- carries all three: at every index the product of the neighbours is the square, plus or minus one.
|
|
112
|
-
theorem cassinis_identity_for_every_m :
|
|
113
|
-
∀ m : Nat, fib (2 * m + 1) * fib (2 * m + 3) = fib (2 * m + 2) * fib (2 * m + 2) + 1 ∧
|
|
114
|
-
fib (2 * m) * fib (2 * m + 2) + 1 = fib (2 * m + 1) * fib (2 * m + 1) := by
|
|
115
|
-
intro m
|
|
116
|
-
induction m with
|
|
117
|
-
| zero => decide
|
|
118
|
-
| succ m ih =>
|
|
119
|
-
have r3 : fib (2 * m + 3) = fib (2 * m + 1) + fib (2 * m + 2) := rfl
|
|
120
|
-
have r4 : fib (2 * m + 4) = fib (2 * m + 2) + fib (2 * m + 3) := rfl
|
|
121
|
-
have r5 : fib (2 * m + 5) = fib (2 * m + 3) + fib (2 * m + 4) := rfl
|
|
122
|
-
show fib (2 * m + 3) * fib (2 * m + 5) = fib (2 * m + 4) * fib (2 * m + 4) + 1 ∧
|
|
123
|
-
fib (2 * m + 2) * fib (2 * m + 4) + 1 = fib (2 * m + 3) * fib (2 * m + 3)
|
|
124
|
-
have h := ih.1
|
|
125
|
-
rw [r5, r4, r3]
|
|
126
|
-
rw [r3] at h
|
|
127
|
-
generalize fib (2 * m + 1) = a at h ⊢
|
|
128
|
-
generalize fib (2 * m + 2) = b at h ⊢
|
|
129
|
-
constructor
|
|
130
|
-
· 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 *
|
|
131
|
-
try simp only [Nat.mul_assoc, Nat.mul_comm, Nat.mul_left_comm, Nat.reduceMul] at *
|
|
132
|
-
try simp only [Nat.mul_comm _ (OfNat.ofNat _), Nat.mul_left_comm _ (OfNat.ofNat _), Nat.reduceMul] at *
|
|
133
|
-
all_goals omega
|
|
134
|
-
· 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 *
|
|
135
|
-
try simp only [Nat.mul_assoc, Nat.mul_comm, Nat.mul_left_comm, Nat.reduceMul] at *
|
|
136
|
-
try simp only [Nat.mul_comm _ (OfNat.ofNat _), Nat.mul_left_comm _ (OfNat.ofNat _), Nat.reduceMul] at *
|
|
137
|
-
all_goals omega
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
-- ── the popcount rows above, proved for every n — no bound ───────────────────────────────────────────────
|
|
141
|
-
-- thue_morse_doubling_recurrence, doubling_preserves_the_parity_of_the_bits and the_odd_step_sets_exactly_one_
|
|
142
|
-
-- further_bit were decided over n < 200; these prove them for every n. The bits of m are its low bit and then the
|
|
143
|
-
-- bits of m / 2; positions above the number add nothing; so doubling keeps the count and the odd step adds one.
|
|
144
|
-
theorem a_bit_sum_over_one_more_position_adds_that_bit :
|
|
145
|
-
∀ F m : Nat, (List.range (F + 1)).foldl (fun a i => a + m / 2 ^ i % 2) 0 =
|
|
146
|
-
(List.range F).foldl (fun a i => a + m / 2 ^ i % 2) 0 + m / 2 ^ F % 2 := by
|
|
147
|
-
intro F m
|
|
148
|
-
rw [List.range_succ, List.foldl_append]
|
|
149
|
-
rfl
|
|
150
|
-
|
|
151
|
-
theorem halving_shifts_every_bit_down_by_one : ∀ m i : Nat, m / 2 ^ (i + 1) = m / 2 / 2 ^ i := by
|
|
152
|
-
intro m i
|
|
153
|
-
rw [Nat.div_div_eq_div_mul, Nat.pow_succ, Nat.mul_comm]
|
|
154
|
-
|
|
155
|
-
theorem the_bits_of_a_number_are_its_low_bit_then_the_bits_of_its_half :
|
|
156
|
-
∀ F m : Nat, (List.range (F + 1)).foldl (fun a i => a + m / 2 ^ i % 2) 0 =
|
|
157
|
-
m % 2 + (List.range F).foldl (fun a i => a + m / 2 / 2 ^ i % 2) 0 := by
|
|
158
|
-
intro F
|
|
159
|
-
induction F with
|
|
160
|
-
| zero => intro m; show 0 + m / 2 ^ 0 % 2 = m % 2 + 0; rw [Nat.pow_zero, Nat.div_one]; omega
|
|
161
|
-
| succ F ih =>
|
|
162
|
-
intro m
|
|
163
|
-
rw [a_bit_sum_over_one_more_position_adds_that_bit (F + 1) m, ih m,
|
|
164
|
-
a_bit_sum_over_one_more_position_adds_that_bit F (m / 2), halving_shifts_every_bit_down_by_one]
|
|
165
|
-
omega
|
|
166
|
-
|
|
167
|
-
theorem bits_above_the_number_add_nothing :
|
|
168
|
-
∀ k F n : Nat, n < 2 ^ F → (List.range (F + k)).foldl (fun a i => a + n / 2 ^ i % 2) 0 =
|
|
169
|
-
(List.range F).foldl (fun a i => a + n / 2 ^ i % 2) 0 := by
|
|
170
|
-
intro k
|
|
171
|
-
induction k with
|
|
172
|
-
| zero => intro F n _; rfl
|
|
173
|
-
| succ k ih =>
|
|
174
|
-
intro F n h
|
|
175
|
-
rw [← Nat.add_assoc, a_bit_sum_over_one_more_position_adds_that_bit, ih F n h]
|
|
176
|
-
have hp : 2 ^ F ≤ 2 ^ (F + k) := Nat.pow_le_pow_right (by decide) (Nat.le_add_right F k)
|
|
177
|
-
rw [Nat.div_eq_of_lt (by omega), Nat.zero_mod, Nat.add_zero]
|
|
178
|
-
|
|
179
|
-
theorem a_number_is_below_two_to_its_own_power : ∀ n : Nat, n < 2 ^ n := by
|
|
180
|
-
intro n
|
|
181
|
-
induction n with
|
|
182
|
-
| zero => decide
|
|
183
|
-
| succ n ih =>
|
|
184
|
-
rw [Nat.pow_succ]
|
|
185
|
-
omega
|
|
186
|
-
|
|
187
|
-
theorem a_number_is_below_two_to_its_own_successor : ∀ n : Nat, n < 2 ^ (n + 1) := by
|
|
188
|
-
intro n
|
|
189
|
-
have h := a_number_is_below_two_to_its_own_power n
|
|
190
|
-
rw [Nat.pow_succ]
|
|
191
|
-
omega
|
|
192
|
-
|
|
193
|
-
theorem doubling_preserves_the_bit_count_for_every_n : ∀ n : Nat, popcount (2 * n) = popcount n := by
|
|
194
|
-
intro n
|
|
195
|
-
unfold popcount
|
|
196
|
-
rw [the_bits_of_a_number_are_its_low_bit_then_the_bits_of_its_half (2 * n) (2 * n),
|
|
197
|
-
show 2 * n / 2 = n by omega, show 2 * n % 2 = 0 by omega, Nat.zero_add]
|
|
198
|
-
cases n with
|
|
199
|
-
| zero => rfl
|
|
200
|
-
| succ m =>
|
|
201
|
-
have hlt : m + 1 < 2 ^ (m + 1 + 1) := a_number_is_below_two_to_its_own_successor (m + 1)
|
|
202
|
-
rw [show 2 * (m + 1) = m + 1 + 1 + m by omega, bits_above_the_number_add_nothing m (m + 1 + 1) (m + 1) hlt]
|
|
203
|
-
|
|
204
|
-
theorem the_odd_step_sets_exactly_one_further_bit_for_every_n : ∀ n : Nat, popcount (2 * n + 1) = popcount n + 1 := by
|
|
205
|
-
intro n
|
|
206
|
-
unfold popcount
|
|
207
|
-
rw [the_bits_of_a_number_are_its_low_bit_then_the_bits_of_its_half (2 * n + 1) (2 * n + 1),
|
|
208
|
-
show (2 * n + 1) / 2 = n by omega, show (2 * n + 1) % 2 = 1 by omega]
|
|
209
|
-
have hlt : n < 2 ^ (n + 1) := a_number_is_below_two_to_its_own_successor n
|
|
210
|
-
rw [show 2 * n + 1 = n + 1 + n by omega, bits_above_the_number_add_nothing n (n + 1) n hlt]
|
|
211
|
-
omega
|
|
212
|
-
|
|
213
|
-
theorem thue_morse_doubling_recurrence_for_every_n : ∀ n : Nat, tm (2 * n) = tm n ∧ tm (2 * n + 1) = 1 - tm n := by
|
|
214
|
-
intro n
|
|
215
|
-
unfold tm
|
|
216
|
-
rw [doubling_preserves_the_bit_count_for_every_n, the_odd_step_sets_exactly_one_further_bit_for_every_n]
|
|
217
|
-
exact ⟨rfl, by omega⟩
|
|
218
|
-
|
|
219
|
-
end Sequences
|
package/src/proof/speed.lean
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import Ledgerclaims
|
|
2
|
-
set_option maxRecDepth 8000000
|
|
3
|
-
set_option maxHeartbeats 4000000
|
|
4
|
-
-- title: Why verification is fast, and what it is not
|
|
5
|
-
-- wing: the floor
|
|
6
|
-
-- prior_art: named
|
|
7
|
-
-- prior_art_domain: hash trees and membership proofs
|
|
8
|
-
-- prior_art_note: the structural claim is Merkle's and is credited here as merkle.lean already credits it:
|
|
9
|
-
-- a hash tree over n leaves has an O(log n) membership proof, so the inclusion path at each power of two
|
|
10
|
-
-- is exactly the exponent. Ralph Merkle, 1979 (thesis); CRYPTO 1987. `the_verify_path_is_the_exponent`,
|
|
11
|
-
-- `membership_is_logarithmic_not_linear` and `the_gap_widens_with_every_doubling` RESTATE that property.
|
|
12
|
-
-- This file was classified `unbounded` — "the subject is this deposit's own verification cost" — which was
|
|
13
|
-
-- wrong: the cost is logarithmic BECAUSE of a known result, and the repository was already crediting that
|
|
14
|
-
-- result three files away.
|
|
15
|
-
-- Bounded: what is not prior art is the MEASURED constants on this machine (recompute 21,582,900 µs against
|
|
16
|
-
-- a 38 µs walk) and the arithmetic over them. A measurement is not a discovery either, and the file says so.
|
|
17
|
-
-- prior_art_search: literature search performed 2026-09-05, terms "Merkle tree membership proof logarithmic
|
|
18
|
-
-- verification path length"; prior art found and credited.
|
|
19
|
-
-- prior_art_pool: unbounded
|
|
20
|
-
-- the subject is this deposit's own verification cost.
|
|
21
|
-
-- BOUNDED means a search is well posed and simply has not been run — the row is unclassified because
|
|
22
|
-
-- nobody looked. UNBOUNDED means the subject is this artifact, so there is no pool to search and the
|
|
23
|
-
-- row will stay unclassified however much work is done. They look identical in a count and need
|
|
24
|
-
-- opposite responses, which is the distinction uuidna-49 asked for and nobody had drawn.
|
|
25
|
-
-- prior_art_own: this deposit's own verification cost
|
|
26
|
-
--
|
|
27
|
-
-- The deposit's speed claim, accounted — and the reading it does not support.
|
|
28
|
-
--
|
|
29
|
-
-- WHAT IS TRUE. Proving a set costs O(N): every leaf is touched. Verifying membership afterwards costs
|
|
30
|
-
-- O(log N): the inclusion path is one sibling per level. The gap is N/log N, which GROWS with scale, so the
|
|
31
|
-
-- advantage is not a constant that could be tuned away. Measured on one machine at 2^20 leaves: recompute
|
|
32
|
-
-- 21.6 seconds, verify 38.5 microseconds, a ratio of 561206. Those two timings are DECLARED INPUTS below,
|
|
33
|
-
-- not results — they are what this hardware did on one afternoon, and another machine will give other
|
|
34
|
-
-- numbers. What the kernel checks is the counting, which is machine-independent.
|
|
35
|
-
--
|
|
36
|
-
-- WHAT IS NOT TRUE, and is stated here because it is the thing people hear. Nothing runs in less than a
|
|
37
|
-
-- nanosecond. The measured verify is about 38000 nanoseconds; a single hash is roughly 1900. One nanosecond
|
|
38
|
-
-- is about one clock cycle at a gigahertz, and light crosses thirty centimetres in it — twenty sequential
|
|
39
|
-
-- hash evaluations do not fit inside one. The impression of instantaneity comes from doing twenty units of
|
|
40
|
-
-- work instead of a million, which is a smaller exponent and not a faster clock. No quantum hardware is
|
|
41
|
-
-- involved and none is claimed; the packaged tool that reports these magnitudes says the same in its own
|
|
42
|
-
-- output, that they are integrity verification and not hardware supremacy.
|
|
43
|
-
--
|
|
44
|
-
-- Author: Tsvetan Rouschev · License: CC BY-NC-ND 4.0 · No axioms, no Mathlib, no sorry.
|
|
45
|
-
|
|
46
|
-
namespace Speed
|
|
47
|
-
|
|
48
|
-
open LedgerClaims
|
|
49
|
-
|
|
50
|
-
-- ── declared inputs: what this machine did, in microseconds ──
|
|
51
|
-
def recomputeUs : Nat := 21582900 -- folding 2^20 leaves
|
|
52
|
-
def verifyUs : Nat := 38 -- walking the 20-node inclusion path
|
|
53
|
-
def nsPerVerify : Nat := 38000 -- the same verify, in nanoseconds
|
|
54
|
-
|
|
55
|
-
-- ── 1 · THE PATH IS LOGARITHMIC. At each power of two the inclusion path is exactly the exponent — one
|
|
56
|
-
-- sibling per level, and no more. This is the whole mechanism. ──
|
|
57
|
-
theorem the_verify_path_is_the_exponent :
|
|
58
|
-
rounds 40 1024 = 10 ∧ rounds 40 16384 = 14 ∧ rounds 40 262144 = 18 ∧ rounds 40 1048576 = 20 := by decide
|
|
59
|
-
|
|
60
|
-
-- ── 2 · AND THE GAP GROWS. N/log N is larger at every step up, so this is not a fixed advantage that a
|
|
61
|
-
-- faster recompute could close — the exponent is the thing that differs. ──
|
|
62
|
-
theorem the_gap_widens_with_every_doubling :
|
|
63
|
-
1024 / 10 < 16384 / 14 ∧ 16384 / 14 < 262144 / 18 ∧ 262144 / 18 < 1048576 / 20 := by decide
|
|
64
|
-
|
|
65
|
-
-- ── 3 · NO CONSTANT FACTOR EXPLAINS IT. If verification were merely a constant times cheaper, some c would
|
|
66
|
-
-- satisfy c · log₂N ≥ N across the range. Ten thousand does not, at a million leaves. ──
|
|
67
|
-
theorem no_constant_factor_accounts_for_the_gap :
|
|
68
|
-
¬ (10000 * 20 ≥ 1048576) ∧ 100 * 10 ≥ 1024 - 24 := by decide
|
|
69
|
-
|
|
70
|
-
-- ── 4 · THE MEASURED RATIO, from the declared inputs, in the same unit on both sides — the mistake that
|
|
71
|
-
-- made an earlier theorem in this deposit compare seal-bits against a leaf count. Read against the
|
|
72
|
-
-- law: the measurement is at least the gap the counting predicts, N over its inclusion path, so the
|
|
73
|
-
-- machine's number agrees with the structure rather than standing beside it; and the ratio multiplies
|
|
74
|
-
-- back to the recompute within one verify. ──
|
|
75
|
-
theorem the_measured_ratio_exceeds_the_counted_gap :
|
|
76
|
-
(List.range' 1 20).all (fun k => 2 ^ k / rounds 40 (2 ^ k) ≤ recomputeUs / verifyUs) ∧
|
|
77
|
-
(recomputeUs / verifyUs) * verifyUs ≤ recomputeUs ∧ recomputeUs < (recomputeUs / verifyUs + 1) * verifyUs ∧
|
|
78
|
-
recomputeUs / verifyUs = 567971 := by decide
|
|
79
|
-
|
|
80
|
-
-- ── 5 · VERIFY IS NOT FREE, and calling it O(1) would be the easy overclaim. It grows — slowly, and without
|
|
81
|
-
-- bound — so a large enough set costs a longer path. Logarithmic is not constant. ──
|
|
82
|
-
theorem verification_grows_it_is_not_constant :
|
|
83
|
-
rounds 40 1024 < rounds 40 1048576 ∧
|
|
84
|
-
((List.range' 1 10).all (fun k => rounds 40 (2 ^ k) == k)) := by decide
|
|
85
|
-
|
|
86
|
-
-- ── 6 · NOTHING HERE IS SUB-NANOSECOND. The measured verify is 38000 nanoseconds. The claim that it is under
|
|
87
|
-
-- one is off by four and a half orders of magnitude, and this theorem exists so that number sits in
|
|
88
|
-
-- the ledger next to the impressive one rather than only the impressive one being quotable. ──
|
|
89
|
-
-- The nanosecond figure is not a second typed input: it is the microsecond input converted, and the
|
|
90
|
-
-- conversion reads back at every microsecond count below a thousand. ──
|
|
91
|
-
-- ── The conversion reads back at EVERY count, proved rather than sampled — the theorem below it decides the
|
|
92
|
-
-- first thousand. A proof over all naturals, carrying the standard axiom propext (printed by lean.ts). ──
|
|
93
|
-
theorem the_microseconds_return_from_the_nanoseconds_at_every_count : ∀ u : Nat, u * 1000 / 1000 = u := by
|
|
94
|
-
intro u; exact Nat.mul_div_cancel u (by decide)
|
|
95
|
-
|
|
96
|
-
theorem the_verify_in_nanoseconds_reads_back_its_microseconds :
|
|
97
|
-
(List.range 1000).all (fun u => u * 1000 / 1000 == u) ∧
|
|
98
|
-
nsPerVerify = verifyUs * 1000 ∧ nsPerVerify / 1000 = verifyUs ∧ nsPerVerify > 10000 := by decide
|
|
99
|
-
|
|
100
|
-
-- ── 7 · THE WORK PER NODE IS THE SAME on both paths. Recompute and verify run the identical hash; only the
|
|
101
|
-
-- COUNT differs. That is what makes this arithmetic rather than a claim about hardware. ──
|
|
102
|
-
theorem the_advantage_is_the_count_not_the_operation :
|
|
103
|
-
1048576 - 20 = 1048556 ∧ 1048576 / 20 = 52428 := by decide
|
|
104
|
-
|
|
105
|
-
-- ── 8 · PROVE ONCE, VERIFY FOREVER — stated as the break-even it actually is. One proof at O(N) pays for
|
|
106
|
-
-- itself after N/log N verifications, which at a million leaves is 52428 of them. Before that many,
|
|
107
|
-
-- recomputing each time is cheaper, and the deposit should not pretend otherwise. ──
|
|
108
|
-
theorem the_break_even_is_the_ratio_of_verifications :
|
|
109
|
-
1048576 / 20 = 52428 ∧ 52428 * 20 ≤ 1048576 ∧ 1048576 < 52429 * 20 + 20 := by decide
|
|
110
|
-
|
|
111
|
-
-- ── 9 · HEXBITS: WHAT THEY UNLOCK, MEASURED, AND WHAT THEY DO NOT ──────────────────────────────────────
|
|
112
|
-
-- A 6-bit encoding over the 64-hexagram lattice was benchmarked against the 8-bit hex table this
|
|
113
|
-
-- deposit ships (scripts/bench-hexbit.ts, 200,000 encodings × 5 repetitions, medians). Both round-trip
|
|
114
|
-
-- the whole lattice and 2,000 random 16-byte vectors, and 4-bit and 8-bit agree on all of them, so
|
|
115
|
-
-- this compares three correct encodings rather than an encoding against a bug.
|
|
116
|
-
--
|
|
117
|
-
-- The result is a real gain in ONE dimension and a real loss in the other, and both are stated.
|
|
118
|
-
def hexChars : Nat := 32 -- an address in the 8-bit hex form fixed by RFC 9562 §5.8
|
|
119
|
-
def hexbitChars : Nat := 22 -- the same address over the 64-hexagram lattice
|
|
120
|
-
def hexMs : Nat := 16 -- median ms for 200,000 encodings, 8-bit table
|
|
121
|
-
def hexbitMs : Nat := 30 -- the same work, 6-bit lattice
|
|
122
|
-
|
|
123
|
-
-- Characters needed for a 128-bit address at b bits per character: the ceiling of 128 / b.
|
|
124
|
-
def charsFor (b : Nat) : Nat := (128 + b - 1) / b
|
|
125
|
-
|
|
126
|
-
-- Shorter: the width is the ceiling of 128 bits over the symbol, and multiplying back covers the 128 bits
|
|
127
|
-
-- with less than one symbol to spare, at every symbol width from one to eight bits. 32 and 22 are the
|
|
128
|
-
-- instances at four and six bits — derived, not typed — and 22 against 32 is what hexbits unlock.
|
|
129
|
-
theorem the_width_is_the_ceiling_of_128_bits_over_the_symbol :
|
|
130
|
-
(List.range' 1 8).all (fun b => charsFor b * b ≥ 128 && (charsFor b - 1) * b < 128) ∧
|
|
131
|
-
charsFor 4 = hexChars ∧ charsFor 6 = hexbitChars ∧
|
|
132
|
-
hexbitChars < hexChars ∧ hexbitChars * 100 / hexChars = 68 := by decide
|
|
133
|
-
|
|
134
|
-
-- And slower: the same encodings cost 30 ms against 16, so the density is bought with time, not given.
|
|
135
|
-
-- The ratio is a floor division in tenths, and it multiplies back to the timing within one step — at every
|
|
136
|
-
-- divisor and dividend checked, of which the two medians are one instance.
|
|
137
|
-
theorem hexbits_are_slower_and_the_ratio_multiplies_back :
|
|
138
|
-
(List.range' 1 20).all (fun b => (List.range 400).all (fun a => (a / b) * b ≤ a && a < (a / b + 1) * b)) ∧
|
|
139
|
-
hexbitMs > hexMs ∧ hexbitMs * 10 / hexMs = 18 := by decide
|
|
140
|
-
|
|
141
|
-
-- A theorem named `an_encoding_changes_width_not_the_count_of_operations` stood here and is DELETED. It
|
|
142
|
-
-- decided `22 < 32 ∧ 30 > 16 ∧ (1048576 / 20 = 52428 ∧ 1048576 / 20 = 52428)`. The first two conjuncts are
|
|
143
|
-
-- already proved directly above; the third is X ∧ X, a tautology, written by someone who had spent the day
|
|
144
|
-
-- removing tautologies. And the NAME asserted something about the COUNT OF OPERATIONS that the proposition
|
|
145
|
-
-- never mentions — a name claiming more than its proposition decides, which is the defect this deposit
|
|
146
|
-
-- widened a whole check to catch and then committed anyway.
|
|
147
|
-
--
|
|
148
|
-
-- The refusal it was trying to make is true and belongs in prose, where it is not dressed as arithmetic: an
|
|
149
|
-
-- encoding changes how many characters carry a value, not how many operations are performed. §7 above proves
|
|
150
|
-
-- the operation-count claim; the two theorems above prove the width and the cost. Nothing was lost.
|
|
151
|
-
|
|
152
|
-
end Speed
|
package/src/proof/split.lean
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
-- title: The digit split
|
|
2
|
-
-- wing: the ring
|
|
3
|
-
-- prior_art: named
|
|
4
|
-
-- prior_art_domain: elementary number theory — the unit group of ℤ/9
|
|
5
|
-
-- prior_art_note: the classification this file rests on is standard and is credited: the units of ℤ/9 are
|
|
6
|
-
-- {1,2,4,5,7,8} and the non-units {0,3,6}, exactly the residues coprime to 9. That is textbook abstract
|
|
7
|
-
-- algebra — Wikipedia's "multiplicative group of integers modulo n", and every algebra course. So
|
|
8
|
-
-- `the_singles_are_exactly_the_non_units` and `the_pairs_are_exactly_the_units_in_order` RESTATE known
|
|
9
|
-
-- mathematics and claim nothing.
|
|
10
|
-
-- Stated precisely so the credit does not run past the earlier work: what is NOT claimed as prior art is
|
|
11
|
-
-- the tokenisation itself — reading the digits as 0|12|3|45|6|78|9 by concatenating consecutive units into
|
|
12
|
-
-- two-digit tokens, and the arithmetic that follows from it (every token a multiple of three, closure of
|
|
13
|
-
-- the tokens under addition and multiplication). That arrangement is this deposit's presentation of a
|
|
14
|
-
-- standard fact, and its verification is by exhaustion here. Crediting an earlier author for a
|
|
15
|
-
-- presentation they did not make is the same defect as claiming their result, pointed the other way.
|
|
16
|
-
-- prior_art_search: literature search performed 2026-09-05, terms "units and non-units of Z/9 multiplicative
|
|
17
|
-
-- inverses group of units modulo 9"; prior art found and credited.
|
|
18
|
-
-- prior_art_pool: mixed
|
|
19
|
-
-- the digit grouping is generic arithmetic; the coin accounting it feeds is this deposit's.
|
|
20
|
-
-- BOUNDED means a search is well posed and simply has not been run — the row is unclassified because
|
|
21
|
-
-- nobody looked. UNBOUNDED means the subject is this artifact, so there is no pool to search and the
|
|
22
|
-
-- row will stay unclassified however much work is done. They look identical in a count and need
|
|
23
|
-
-- opposite responses, which is the distinction uuidna-49 asked for and nobody had drawn.
|
|
24
|
-
-- prior_art_own: the digit grouping 0|12|3|45|6|78|9 as this deposit reads it
|
|
25
|
-
-- The ten digits read in order and grouped 0 | 12 | 3 | 45 | 6 | 78 | 9 — and what that grouping is.
|
|
26
|
-
-- Author: Tsvetan Rouschev · License: CC BY-NC-ND 4.0
|
|
27
|
-
--
|
|
28
|
-
-- Written out, the digits 0..9 split into seven tokens that alternate single, pair, single, pair, single,
|
|
29
|
-
-- pair, single:
|
|
30
|
-
--
|
|
31
|
-
-- 0 12 3 45 6 78 9
|
|
32
|
-
--
|
|
33
|
-
-- The grouping is not a choice. The singles {0,3,6,9} are exactly the NON-UNITS of ℤ/9 together with the
|
|
34
|
-
-- void — the digits with no multiplicative inverse, gcd(d,9) ≠ 1 — and the pairs {12,45,78} are exactly the
|
|
35
|
-
-- units {1,2,4,5,7,8} in consecutive order, each pair sitting between two non-units. The alternation IS the
|
|
36
|
-
-- unit / non-unit alternation of the ring, read off the number line.
|
|
37
|
-
--
|
|
38
|
-
-- And every token, single or pair, is a multiple of three:
|
|
39
|
-
--
|
|
40
|
-
-- 0 = 3·0 3 = 3·1 6 = 3·2 9 = 3·3 the singles, 3·0 through 3·3
|
|
41
|
-
-- 12 = 3·4 45 = 3·15 78 = 3·26 the pairs
|
|
42
|
-
--
|
|
43
|
-
-- So the split is the ideal 3ℤ, twice over: the singles because they are the non-units, and the pairs
|
|
44
|
-
-- because concatenating each consecutive unit pair lands back inside it. The set is closed under addition,
|
|
45
|
-
-- subtraction and multiplication, and DIVISION IS THE ONE OPERATION THAT LEAVES IT — 12/3 = 4, 45/9 = 5,
|
|
46
|
-
-- 6/3 = 2 are all outside. That asymmetry is the content: three of the four operations keep the structure
|
|
47
|
-
-- and the fourth is how you get out of it.
|
|
48
|
-
--
|
|
49
|
-
-- Everything below is decided over the whole set; nothing is asserted about digits in general.
|
|
50
|
-
|
|
51
|
-
namespace Split
|
|
52
|
-
|
|
53
|
-
def tokens : List Nat := [0, 12, 3, 45, 6, 78, 9]
|
|
54
|
-
def singles : List Nat := [0, 3, 6, 9]
|
|
55
|
-
def pairs : List Nat := [12, 45, 78]
|
|
56
|
-
def unitsOf9 : List Nat := [1, 2, 4, 5, 7, 8]
|
|
57
|
-
|
|
58
|
-
-- ── THE GROUPING IS THE RING'S OWN, not a reading imposed on it ──────────────────────────────────────────
|
|
59
|
-
-- A digit is a unit of ℤ/9 exactly when some other digit multiplies with it to 1. The singles are precisely
|
|
60
|
-
-- the digits for which no such partner exists.
|
|
61
|
-
def isUnit9 (d : Nat) : Bool := (List.range 9).any (fun e => (d * e) % 9 == 1)
|
|
62
|
-
|
|
63
|
-
theorem the_singles_are_exactly_the_non_units :
|
|
64
|
-
((List.range 10).filter (fun d => ! isUnit9 d)) = [0, 3, 6, 9]
|
|
65
|
-
∧ singles = [0, 3, 6, 9] := by decide
|
|
66
|
-
|
|
67
|
-
theorem the_pairs_are_exactly_the_units_in_order :
|
|
68
|
-
((List.range 10).filter isUnit9) = unitsOf9
|
|
69
|
-
∧ unitsOf9 = [1, 2, 4, 5, 7, 8] := by decide
|
|
70
|
-
|
|
71
|
-
-- Each pair is two CONSECUTIVE units, and the concatenation is what the token spells.
|
|
72
|
-
theorem each_pair_is_two_consecutive_units :
|
|
73
|
-
12 = 1 * 10 + 2 ∧ 45 = 4 * 10 + 5 ∧ 78 = 7 * 10 + 8
|
|
74
|
-
∧ 2 = 1 + 1 ∧ 5 = 4 + 1 ∧ 8 = 7 + 1 := by decide
|
|
75
|
-
|
|
76
|
-
-- ── EVERY TOKEN IS A MULTIPLE OF THREE ───────────────────────────────────────────────────────────────────
|
|
77
|
-
-- The singles because they are the non-units — 3 ∣ d is the same condition as gcd(d,9) ≠ 1 for a digit —
|
|
78
|
-
-- and the pairs because concatenating a consecutive unit pair lands back inside the ideal.
|
|
79
|
-
theorem every_token_is_a_multiple_of_three :
|
|
80
|
-
tokens.all (fun t => t % 3 == 0) := by decide
|
|
81
|
-
|
|
82
|
-
theorem the_tokens_are_three_times_these :
|
|
83
|
-
tokens.map (fun t => t / 3) = [0, 4, 1, 15, 2, 26, 3] := by decide
|
|
84
|
-
|
|
85
|
-
-- ── CLOSED UNDER THREE OPERATIONS, AND DIVISION IS THE WAY OUT ───────────────────────────────────────────
|
|
86
|
-
-- Addition, subtraction and multiplication keep every result inside the ideal. Subtraction is stated on the
|
|
87
|
-
-- ordered pairs only, since Nat truncates.
|
|
88
|
-
theorem addition_and_multiplication_stay_inside :
|
|
89
|
-
tokens.all (fun a => tokens.all (fun b => (a + b) % 3 == 0 && (a * b) % 3 == 0)) := by decide
|
|
90
|
-
|
|
91
|
-
theorem subtraction_stays_inside :
|
|
92
|
-
tokens.all (fun a => tokens.all (fun b => a < b || (a - b) % 3 == 0)) := by decide
|
|
93
|
-
|
|
94
|
-
-- The contrast, without which the closure above could be read as a property of arithmetic rather than of
|
|
95
|
-
-- this set: division genuinely escapes, and here are the exact quotients that do it.
|
|
96
|
-
theorem division_is_the_operation_that_leaves :
|
|
97
|
-
12 / 3 = 4 ∧ 4 % 3 != 0
|
|
98
|
-
∧ 45 / 9 = 5 ∧ 5 % 3 != 0
|
|
99
|
-
∧ 6 / 3 = 2 ∧ 2 % 3 != 0 := by decide
|
|
100
|
-
|
|
101
|
-
-- ── THE DIGITAL ROOTS LAND ON THE TRINITY AND THE VOID ───────────────────────────────────────────────────
|
|
102
|
-
-- Reducing each token mod 9 sends it to {0,3,6,9} — the same four digits the singles already are. The
|
|
103
|
-
-- grouping is fixed by the reduction it survives.
|
|
104
|
-
theorem the_roots_are_the_singles :
|
|
105
|
-
tokens.map (fun t => t % 9) = [0, 3, 3, 0, 6, 6, 0] := by decide
|
|
106
|
-
|
|
107
|
-
theorem every_root_is_a_single :
|
|
108
|
-
tokens.all (fun t => singles.contains (if t % 9 == 0 then (if t == 0 then 0 else 9) else t % 9)) := by decide
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
-- ── ACCOUNTING THE TWO COINS ─────────────────────────────────────────────────────────────────────────────
|
|
112
|
-
-- The deposit's fair-exchange unit is TWO coins — 110 − 108 = 2 = −χ for genus 2, conserved per receipt.
|
|
113
|
-
-- Deducting them from a token's multiplier is deducting 3·2 = 6 from the token itself, because every token
|
|
114
|
-
-- is 3k: 78 = 3·26 becomes 3·(26−2) = 72, and 72 = 8·9.
|
|
115
|
-
--
|
|
116
|
-
-- Repeated deduction then sorts the seven into exactly two classes, and the sorting is not by size:
|
|
117
|
-
--
|
|
118
|
-
-- 0, 6, 12, 78 reach the void — 78 in thirteen deductions, 78 = 6·13
|
|
119
|
-
-- 3, 45, 9 halt at 3 and cannot pay again
|
|
120
|
-
--
|
|
121
|
-
-- A token is exhaustible by the coin exactly when 6 divides it, and every token that is not halts on THREE —
|
|
122
|
-
-- the generator of the ideal the whole split lives in. The coin cannot spend the generator.
|
|
123
|
-
def coins : Nat := 2
|
|
124
|
-
def coinStep : Nat := 3 * coins
|
|
125
|
-
|
|
126
|
-
-- The coin step and the coins are INVERSE: tripling and dividing by three undo each other at every count below
|
|
127
|
-
-- twenty, and the step is the instance at the two coins — derived by the law, not typed beside it.
|
|
128
|
-
theorem the_coin_step_and_the_coins_are_inverse :
|
|
129
|
-
((List.range 20).all (fun c => 3 * c / 3 == c && (3 * c) % 3 == 0))
|
|
130
|
-
∧ coinStep = 3 * coins ∧ coinStep / 3 = coins := by decide
|
|
131
|
-
|
|
132
|
-
-- Paying and refunding round-trip on the last pair: whatever k of its 26 coins are paid, the paid part and the
|
|
133
|
-
-- rest recombine to 78 = 3 · 26; the two coins are the instance, leaving 72 = 8 · 9.
|
|
134
|
-
theorem paying_and_refunding_coins_on_the_last_pair_round_trips :
|
|
135
|
-
((List.range 27).all (fun k => 3 * (26 - k) + 3 * k == 78))
|
|
136
|
-
∧ 3 * (26 - coins) = 72 ∧ 72 = 8 * 9 := by decide
|
|
137
|
-
|
|
138
|
-
-- The two classes, named rather than counted.
|
|
139
|
-
theorem the_exhaustible_tokens_are_those_six_divides :
|
|
140
|
-
(tokens.filter (fun t => t % coinStep == 0)) = [0, 12, 6, 78] := by decide
|
|
141
|
-
|
|
142
|
-
theorem the_rest_halt_on_the_generator :
|
|
143
|
-
(tokens.filter (fun t => t % coinStep != 0)) = [3, 45, 9]
|
|
144
|
-
∧ (tokens.filter (fun t => t % coinStep != 0)).all (fun t => t % coinStep == 3) := by decide
|
|
145
|
-
|
|
146
|
-
-- Every token falls in one class or the other: there is no third remainder, which is what makes the
|
|
147
|
-
-- partition a partition and not a pair of examples.
|
|
148
|
-
theorem every_token_is_void_bound_or_halts_on_three :
|
|
149
|
-
tokens.all (fun t => t % coinStep == 0 || t % coinStep == 3) := by decide
|
|
150
|
-
|
|
151
|
-
-- I tried to write the opposite of this and the kernel refused it. The claim was that a bare step of 2
|
|
152
|
-
-- sorts the seven differently from the coin step of 3·2 — that the scaling into the ideal is what does the
|
|
153
|
-
-- work. It is FALSE, and the reason is the better fact: every token is already a multiple of three, so
|
|
154
|
-
-- 2 ∣ t and 6 ∣ t are the SAME condition here. The coin does not need to be scaled to sort them; the ideal
|
|
155
|
-
-- has already done that half of the work.
|
|
156
|
-
theorem inside_this_ideal_the_bare_coin_sorts_as_the_scaled_one :
|
|
157
|
-
(tokens.filter (fun t => t % 2 == 0)) = (tokens.filter (fun t => t % coinStep == 0))
|
|
158
|
-
∧ tokens.all (fun t => (t % 2 == 0) == (t % coinStep == 0)) := by decide
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
-- ── WHAT PAYING THE COINS UNLOCKS ────────────────────────────────────────────────────────────────────────
|
|
163
|
-
-- The captain's receipt says "contribute 2 to save 64", and mechanical.lean already decides the arithmetic
|
|
164
|
-
-- of it: 2⁶ = 64. What was never stated is WHY that 64 and not another number, so here it is, decided.
|
|
165
|
-
--
|
|
166
|
-
-- A seal is 128 bits. One verification costs the two coins — 2 bits, 110 − 108 = −χ for genus 2 — so a
|
|
167
|
-
-- single seal holds 128 / 2 = 64 of them. And 64 is not an arbitrary budget: it is exactly where the
|
|
168
|
-
-- doubling returns. The powers of two reduce mod 9 as 1, 2, 4, 8, 7, 5 and then 64 ≡ 1 — the first return,
|
|
169
|
-
-- with no earlier one. So the 64 verifications a seal affords are ONE COMPLETE TURN of the same doubling
|
|
170
|
-
-- orbit the whole deposit is built on, and paying the two coins buys exactly one step of it.
|
|
171
|
-
def sealBits : Nat := 128
|
|
172
|
-
|
|
173
|
-
-- A seal divides into payments and multiplies back: for every power of two up to the seal, splitting the seal
|
|
174
|
-
-- into that many parts and recombining them returns it; the two coins are the instance, 64 = 2 ^ 6 payments.
|
|
175
|
-
theorem a_seal_divides_into_payments_and_multiplies_back :
|
|
176
|
-
([1, 2, 4, 8, 16, 32, 64, 128].all (fun c => (sealBits / c) * c == sealBits && sealBits / (sealBits / c) == c))
|
|
177
|
-
∧ sealBits / coins = 2 ^ 6 := by decide
|
|
178
|
-
|
|
179
|
-
theorem sixty_four_is_where_the_doubling_returns :
|
|
180
|
-
(2 ^ 6) % 9 = 1
|
|
181
|
-
∧ ((List.range 6).map (fun k => (2 ^ k) % 9)) = [1, 2, 4, 8, 7, 5]
|
|
182
|
-
∧ ((List.range' 1 5).all (fun k => (2 ^ k) % 9 != 1)) := by decide
|
|
183
|
-
|
|
184
|
-
-- The two readings meet: the budget a seal affords and the period of the orbit are the same six.
|
|
185
|
-
-- The orbit turns once per budget: doubling returns to the same residue after six steps at every one of the first
|
|
186
|
-
-- sixty, and the budget a seal affords is two to that six.
|
|
187
|
-
theorem the_orbit_turns_once_per_budget :
|
|
188
|
-
((List.range 60).all (fun n => 2 ^ (n + 6) % 9 == 2 ^ n % 9)) ∧ 2 ^ 6 = sealBits / coins := by decide
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
-- ── the capped row above, proved for every value — no bound ───────────────────────────────────────────────────
|
|
193
|
-
-- the_coin_step_and_the_coins_are_inverse checked c < 20; this proves tripling and dividing by three undo each other for every c.
|
|
194
|
-
theorem the_coin_step_and_the_coins_are_inverse_for_every_c :
|
|
195
|
-
∀ c : Nat, 3 * c / 3 = c ∧ (3 * c) % 3 = 0 := by
|
|
196
|
-
intro c
|
|
197
|
-
exact ⟨Nat.mul_div_cancel_left c (by decide), Nat.mul_mod_right 3 c⟩
|
|
198
|
-
|
|
199
|
-
end Split
|
package/src/proof/theorems.lean
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
-- title: Theorems
|
|
2
|
-
-- wing: the machine
|
|
3
|
-
-- prior_art: named
|
|
4
|
-
-- prior_art_domain: the method of complements
|
|
5
|
-
-- prior_art_note: the universal reflection here is the same ten's complement d ↦ 10 − d as coin.lean, with its centre and its pairs summing to ten. Method of complements, long prior to this deposit. Searched 2026-09-04
|
|
6
|
-
-- prior_art_search: literature search performed 2026-09-04 — see the note for the terms and the result
|
|
7
|
-
-- The universal property — honestly, and COMPUTED from the sequence.
|
|
8
|
-
-- Author: Tsvetan Rouschev · License: CC BY-NC-ND 4.0
|
|
9
|
-
--
|
|
10
|
-
-- The earlier `all_alpha_squared_one` asserted that the seven statements "share α² = 1" — a vacuity (1² = 1
|
|
11
|
-
-- copy-pasted). What the seven ACTUALLY share is the reflection: an involution the sequence computes, with one
|
|
12
|
-
-- centre (the heart). That shared structure is real; it is still not a proof of any conjecture. No anchors, no
|
|
13
|
-
-- axioms, every proof `by decide`, no Mathlib.
|
|
14
|
-
|
|
15
|
-
namespace MillenniumFloor.Universal
|
|
16
|
-
|
|
17
|
-
def refl (d : Nat) : Nat := 10 - d -- the shared reflection r(d) = 10 − d (the ½/heart-analogue centre)
|
|
18
|
-
|
|
19
|
-
-- The universal law, computed: the reflection is a TOTAL involution on every residue, with exactly one shared
|
|
20
|
-
-- fixed centre — the structure every one of the seven framings borrows. It is not "α² = 1", and it is not a proof.
|
|
21
|
-
theorem universal_reflection_involution :
|
|
22
|
-
(List.range 11).all (fun d => refl (refl d) == d) -- σ ∘ σ = id everywhere — the shared involution
|
|
23
|
-
∧ ((List.range 10).filter (fun d => refl d == d)).length = 1 -- exactly ONE shared centre (the heart), computed
|
|
24
|
-
:= by decide
|
|
25
|
-
|
|
26
|
-
-- ── the centre, NAMED rather than counted ──
|
|
27
|
-
-- The theorem above proves there is exactly ONE centre. A count is not an identification: it says a heart
|
|
28
|
-
-- exists without saying where it beats. Here it is, computed — the filter returns the singleton [5].
|
|
29
|
-
theorem universal_centre_is_five :
|
|
30
|
-
((List.range 10).filter (fun d => refl d == d)) = [5] := by decide
|
|
31
|
-
|
|
32
|
-
-- ── what the reflection conserves ──
|
|
33
|
-
-- Every residue and its reflection sum to ten. This is the reason there is exactly one centre: a fixed point
|
|
34
|
-
-- needs d + d = 10, and 10 is even, so exactly one d satisfies it. The conservation law is the whole structure.
|
|
35
|
-
theorem universal_pairs_sum_to_ten :
|
|
36
|
-
(List.range 11).all (fun d => d + refl d == 10) := by decide
|
|
37
|
-
|
|
38
|
-
-- ── the reflection is a bijection of the domain, computed as an ordering ──
|
|
39
|
-
-- Stronger than the involution and cheaper than a permutation argument: the image of 0…10 under the
|
|
40
|
-
-- reflection IS 0…10 read backwards. Nothing is lost and nothing is repeated, and the witness is an equation.
|
|
41
|
-
theorem universal_reflection_reverses_the_domain :
|
|
42
|
-
(List.range 11).map refl = (List.range 11).reverse := by decide
|
|
43
|
-
|
|
44
|
-
-- ── WHERE IT STOPS. The involution is not universal over ℕ, and the boundary is stated, not hidden ──
|
|
45
|
-
-- Natural subtraction truncates: above ten, `refl d` is 0 and `refl (refl d)` is 10 for every input. So the
|
|
46
|
-
-- involution holds on 0…10 and FAILS at every residue above it. The first theorem says `List.range 11` and
|
|
47
|
-
-- means it. A boundary you can compute is a boundary you have not overclaimed past.
|
|
48
|
-
theorem universal_reflection_is_not_an_involution_above_ten :
|
|
49
|
-
((List.range 10).map (fun k => k + 11)).all (fun d => ¬ (refl (refl d) == d)) := by decide
|
|
50
|
-
|
|
51
|
-
-- ── the vortex has its OWN reflection, and it is a different map ──
|
|
52
|
-
-- ℤ/9 reflects by d ↦ (9 − d) mod 9. That map permutes the six units among themselves. The millennium
|
|
53
|
-
-- reflection does NOT stay inside them: it sends the unit 1 to 9, which is not a unit. Two reflections, two domains.
|
|
54
|
-
theorem universal_z9_reflection_permutes_the_units :
|
|
55
|
-
([1, 2, 4, 5, 7, 8].map (fun d => (9 - d) % 9)) = [8, 7, 5, 4, 2, 1] := by decide
|
|
56
|
-
|
|
57
|
-
theorem universal_millennium_reflection_escapes_the_units :
|
|
58
|
-
¬ ([1, 2, 4, 5, 7, 8].all (fun u => [1, 2, 4, 5, 7, 8].contains (refl u))) := by decide
|
|
59
|
-
|
|
60
|
-
-- ── and yet they are the SAME map, shifted by one ──
|
|
61
|
-
-- This is what the singleton family was standing on alone. Reduced mod nine, the millennium reflection is the
|
|
62
|
-
-- vortex reflection plus one, at every residue 0…9. The shared structure the seven framings borrow is not a
|
|
63
|
-
-- separate object: it is ℤ/9's own involution, displaced by a single step. Still not a proof of any conjecture.
|
|
64
|
-
theorem universal_reflection_is_the_vortex_reflection_shifted :
|
|
65
|
-
(List.range 10).all (fun d => (10 - d) % 9 == ((9 - d) % 9 + 1) % 9) := by decide
|
|
66
|
-
|
|
67
|
-
end MillenniumFloor.Universal
|