把黎曼猜想的 Lean 证明,写成人能读懂的证明
把黎曼猜想的 Lean 证明写成数学家能读的证明文章,以及人人能看懂的证明思路
Verify the pinned source archive and record reproducible provenance
Browse files+55 −2 routes/cogito-source-provenance/README.md View file
| @@ -4,8 +4,61 @@ status: working | ||
| 4 | 4 | --- |
| 5 | 5 | # Source provenance preflight for the declaration atlas |
| 6 | 6 | |
| 7 | -First step on the atlas task: reproduce the pinned archive integrity check without publishing unlicensed source. No atlas or mathematical finding is claimed. | |
| 7 | +## Result (2026-11-22) | |
| 8 | + | |
| 9 | +Downloaded the fourteen original source archive parts from the URLs pinned in | |
| 10 | +ATLAS.md to a private cache outside this clone. Read the compressed bytes in | |
| 11 | +part01 through part14 order, without extracting or executing source. | |
| 12 | + | |
| 13 | +- Observed total: **239,275,554 bytes**. | |
| 14 | +- Observed SHA-256: `9631b4f020199e580ba86178cb56c6e9b09f690c2369a80dc4334aa93f49c7fc`. | |
| 15 | +- Both match ATLAS.md. `provenance.json` records the observed per-part byte counts | |
| 16 | + and hashes. Those per-part hashes are observations from this run, not independently | |
| 17 | + authenticated upstream pins. The combined pinned digest is the integrity check. | |
| 18 | +- `verify_source.py` is the reproducible streaming downloader/checker. It caches | |
| 19 | + outside git, downloads at most four parts concurrently, and emits the report | |
| 20 | + only after combined size and hash validation. It never extracts source. | |
| 21 | + | |
| 22 | +This is source-byte integrity evidence only. It does not verify the authorship, | |
| 23 | +license, mathematical claims, Lean build, dependency graph, or declaration atlas. | |
| 24 | +No source, proof body, archive, olean, real atlas, or fabricated declaration is | |
| 25 | +included in this route. Metadata is proposed for maintainer review via PR. | |
| 26 | + | |
| 27 | +## Reproduce | |
| 28 | + | |
| 29 | +From the repository root, choose a private cache **outside** this repository: | |
| 30 | + | |
| 31 | +```text | |
| 32 | +python routes/cogito-source-provenance/verify_source.py --cache <private-cache> --download --report <report-path> | |
| 33 | +``` | |
| 34 | + | |
| 35 | +Repeat offline by omitting `--download`. The cache must contain all fourteen | |
| 36 | +`lean.tar.gz.part01` through `lean.tar.gz.part14` files. Expected output: | |
| 37 | + | |
| 38 | +```text | |
| 39 | +source archive: 239275554 bytes, 14 parts, sha256 matches ATLAS.md | |
| 40 | +No source was extracted; no declaration atlas or Lean build was verified. | |
| 41 | +``` | |
| 42 | + | |
| 43 | +## Validation and limitations | |
| 44 | + | |
| 45 | +The real download passed size and hash validation. A separate local synthetic | |
| 46 | +fixture confirmed numeric part ordering, rejection of same-length byte corruption, | |
| 47 | +and rejection of a missing part. These tests are software checks, not RH evidence. | |
| 48 | +The supplied fictional `examples/` fixture also passed the project's verifier; | |
| 49 | +that result is not evidence for this contribution or the RH proof. | |
| 50 | + | |
| 51 | +`python verify.py routes/cogito-source-provenance/` outputs `Nothing to check yet`. | |
| 52 | +The approved project checker does not inspect source-provenance reports or execute | |
| 53 | +route scripts. No atlas manifest is supplied, so this route cannot satisfy the | |
| 54 | +atlas task's acceptance criterion. No declaration count or coverage is claimed. | |
| 8 | 55 | |
| 9 | 56 | ## Next |
| 10 | 57 | |
| 11 | -Verify the fourteen source parts against ATLAS.md, record reproducible byte/hash evidence, and document the remaining built Lean environment and extraction requirements. | |
| 58 | +Build the privately retained, hash-checked source with the pinned Lean 4.33.1 | |
| 59 | +(`819816b2`) and Mathlib v4.33.1 (`0df444a3`) environment. Run a reviewed Lean | |
| 60 | +extractor over that built environment, recording module selection, handling of | |
| 61 | +generated declarations, and direct dependencies. Obtain maintainer rights and | |
| 62 | +provenance review before publishing extracted types to an external artifact store. | |
| 63 | +Then stage a hash-checked atlas and request the real `atlas: N declarations, | |
| 64 | +sha256 ok` check. Issue #1 remains unresolved. | |
+96 −0 routes/cogito-source-provenance/provenance.json added View file
| @@ -0,0 +1,96 @@ | ||
| 1 | +{ | |
| 2 | + "schema": "source-provenance-v1", | |
| 3 | + "observed_at_utc": "2026-11-22T06:44:19.407589+00:00", | |
| 4 | + "archive_bytes": 239275554, | |
| 5 | + "archive_sha256": "9631b4f020199e580ba86178cb56c6e9b09f690c2369a80dc4334aa93f49c7fc", | |
| 6 | + "parts": [ | |
| 7 | + { | |
| 8 | + "file": "lean.tar.gz.part01", | |
| 9 | + "url": "https://alpo.ge/lean.tar.gz.part01", | |
| 10 | + "bytes": 18000000, | |
| 11 | + "sha256": "86974b1c242ca7b6748f3299df4fc64ee0f6e06c776ac964fb64888101a3de77" | |
| 12 | + }, | |
| 13 | + { | |
| 14 | + "file": "lean.tar.gz.part02", | |
| 15 | + "url": "https://alpo.ge/lean.tar.gz.part02", | |
| 16 | + "bytes": 18000000, | |
| 17 | + "sha256": "1c2a2477354a9dfa97ff1ce54861e96ed885bd456fffbaaabc2028314a229c42" | |
| 18 | + }, | |
| 19 | + { | |
| 20 | + "file": "lean.tar.gz.part03", | |
| 21 | + "url": "https://alpo.ge/lean.tar.gz.part03", | |
| 22 | + "bytes": 18000000, | |
| 23 | + "sha256": "1465a23b1b579a881e24e5ffaf7c4c3727af28ea24741f1ec80e1d67947530a3" | |
| 24 | + }, | |
| 25 | + { | |
| 26 | + "file": "lean.tar.gz.part04", | |
| 27 | + "url": "https://alpo.ge/lean.tar.gz.part04", | |
| 28 | + "bytes": 18000000, | |
| 29 | + "sha256": "3929e327eecb4e2c5c7cae30e104e6a4a52fa6b82d28325bcda8e9da1c86893b" | |
| 30 | + }, | |
| 31 | + { | |
| 32 | + "file": "lean.tar.gz.part05", | |
| 33 | + "url": "https://alpo.ge/lean.tar.gz.part05", | |
| 34 | + "bytes": 18000000, | |
| 35 | + "sha256": "f25d7e80f7c4ad6d674aa18b323ca760f848857c8755501c149317c38a66c75d" | |
| 36 | + }, | |
| 37 | + { | |
| 38 | + "file": "lean.tar.gz.part06", | |
| 39 | + "url": "https://alpo.ge/lean.tar.gz.part06", | |
| 40 | + "bytes": 18000000, | |
| 41 | + "sha256": "a8c651a68327811b37dce3cca8eda5e0b2102fa227c0d395cbb7553e4dd69939" | |
| 42 | + }, | |
| 43 | + { | |
| 44 | + "file": "lean.tar.gz.part07", | |
| 45 | + "url": "https://alpo.ge/lean.tar.gz.part07", | |
| 46 | + "bytes": 18000000, | |
| 47 | + "sha256": "65c7e502a9b236a0f68d9e0aa6e089d4c09b9fc7a0960a149384063ccbe5e869" | |
| 48 | + }, | |
| 49 | + { | |
| 50 | + "file": "lean.tar.gz.part08", | |
| 51 | + "url": "https://alpo.ge/lean.tar.gz.part08", | |
| 52 | + "bytes": 18000000, | |
| 53 | + "sha256": "71b027ad6e4179c3a50ce72921e3fec0a2dd751ec7472ac2c644ad145a50ec7e" | |
| 54 | + }, | |
| 55 | + { | |
| 56 | + "file": "lean.tar.gz.part09", | |
| 57 | + "url": "https://alpo.ge/lean.tar.gz.part09", | |
| 58 | + "bytes": 18000000, | |
| 59 | + "sha256": "47718977ebaa8613f1647e93134479780db9320c5fa911463fd312a6257b796f" | |
| 60 | + }, | |
| 61 | + { | |
| 62 | + "file": "lean.tar.gz.part10", | |
| 63 | + "url": "https://alpo.ge/lean.tar.gz.part10", | |
| 64 | + "bytes": 18000000, | |
| 65 | + "sha256": "1d85ece78e0779cec26b0cce29c6462d9f90180e56d78120b152df101715240b" | |
| 66 | + }, | |
| 67 | + { | |
| 68 | + "file": "lean.tar.gz.part11", | |
| 69 | + "url": "https://alpo.ge/lean.tar.gz.part11", | |
| 70 | + "bytes": 18000000, | |
| 71 | + "sha256": "cf83a159d1a9540012229c376562587dd966da10cd657cbcef53acfd03232448" | |
| 72 | + }, | |
| 73 | + { | |
| 74 | + "file": "lean.tar.gz.part12", | |
| 75 | + "url": "https://alpo.ge/lean.tar.gz.part12", | |
| 76 | + "bytes": 18000000, | |
| 77 | + "sha256": "1aa5415bd2db83b2689afeeb946419303b3c4f599ae790ad74d38465f768b502" | |
| 78 | + }, | |
| 79 | + { | |
| 80 | + "file": "lean.tar.gz.part13", | |
| 81 | + "url": "https://alpo.ge/lean.tar.gz.part13", | |
| 82 | + "bytes": 18000000, | |
| 83 | + "sha256": "2de4edbce8ebdbfd0b94bc89bab518c7294209f408ec5b14a7be9e4832d9da81" | |
| 84 | + }, | |
| 85 | + { | |
| 86 | + "file": "lean.tar.gz.part14", | |
| 87 | + "url": "https://alpo.ge/lean.tar.gz.part14", | |
| 88 | + "bytes": 5275554, | |
| 89 | + "sha256": "53f8ea43a9b5dcab97b84a52f3ac2848711c844a5420a4c56418093bacb3c6f6" | |
| 90 | + } | |
| 91 | + ], | |
| 92 | + "integrity": "matches ATLAS.md pins", | |
| 93 | + "scope": "Compressed source archive bytes only; not a Lean build, declaration atlas, proof verification, or publication permission.", | |
| 94 | + "lean_build_verified": false, | |
| 95 | + "atlas_extracted": false | |
| 96 | +} | |
+79 −0 routes/cogito-source-provenance/verify_source.py added View file
| @@ -0,0 +1,79 @@ | ||
| 1 | +"""Verify ATLAS.md's pinned source, without extracting or redistributing it. | |
| 2 | + | |
| 3 | +Download/cache outside git: | |
| 4 | + python verify_source.py --cache <private-folder> --download --report provenance.json | |
| 5 | +Repeat offline by omitting --download. Only the small report belongs in git. | |
| 6 | +""" | |
| 7 | +import argparse | |
| 8 | +from concurrent.futures import ThreadPoolExecutor | |
| 9 | +from datetime import datetime, timezone | |
| 10 | +import hashlib | |
| 11 | +import json | |
| 12 | +from pathlib import Path | |
| 13 | +import subprocess | |
| 14 | + | |
| 15 | +SOURCE = 'https://alpo.ge/lean.tar.gz.part' | |
| 16 | +EXPECTED_BYTES = 239_275_554 | |
| 17 | +EXPECTED_SHA256 = '9631b4f020199e580ba86178cb56c6e9b09f690c2369a80dc4334aa93f49c7fc' | |
| 18 | +PARTS = tuple(f'lean.tar.gz.part{i:02d}' for i in range(1, 15)) | |
| 19 | + | |
| 20 | + | |
| 21 | +def fetch(cache, name): | |
| 22 | + target = cache / name | |
| 23 | + if target.exists(): | |
| 24 | + return | |
| 25 | + temporary = cache / (name + '.partial') | |
| 26 | + subprocess.run(['curl.exe' if __import__('os').name == 'nt' else 'curl', | |
| 27 | + '-fsSL', '--max-time', '120', '--retry', '2', | |
| 28 | + SOURCE + name[-2:], '-o', str(temporary)], check=True) | |
| 29 | + temporary.replace(target) | |
| 30 | + | |
| 31 | + | |
| 32 | +def verify(cache, expected_bytes=EXPECTED_BYTES, expected_sha256=EXPECTED_SHA256): | |
| 33 | + # Numeric order is part of the contract: never concatenate a glob/lexical | |
| 34 | + # directory listing, and never load the entire archive into memory. | |
| 35 | + combined = hashlib.sha256() | |
| 36 | + total = 0 | |
| 37 | + parts = [] | |
| 38 | + for name in PARTS: | |
| 39 | + individual = hashlib.sha256() | |
| 40 | + size = 0 | |
| 41 | + with (cache / name).open('rb') as stream: | |
| 42 | + while block := stream.read(1024 * 1024): | |
| 43 | + combined.update(block) | |
| 44 | + individual.update(block) | |
| 45 | + size += len(block) | |
| 46 | + total += size | |
| 47 | + parts.append({'file': name, 'url': SOURCE + name[-2:], | |
| 48 | + 'bytes': size, 'sha256': individual.hexdigest()}) | |
| 49 | + if total != expected_bytes: | |
| 50 | + raise ValueError(f'archive size mismatch: {total} != {expected_bytes}') | |
| 51 | + digest = combined.hexdigest() | |
| 52 | + if digest != expected_sha256: | |
| 53 | + raise ValueError(f'archive sha256 mismatch: {digest} != {expected_sha256}') | |
| 54 | + return {'schema': 'source-provenance-v1', | |
| 55 | + 'observed_at_utc': datetime.now(timezone.utc).isoformat(), | |
| 56 | + 'archive_bytes': total, 'archive_sha256': digest, | |
| 57 | + 'parts': parts, 'integrity': 'matches ATLAS.md pins', | |
| 58 | + 'scope': 'Compressed source archive bytes only; not a Lean build, declaration atlas, proof verification, or publication permission.', | |
| 59 | + 'lean_build_verified': False, 'atlas_extracted': False} | |
| 60 | + | |
| 61 | + | |
| 62 | +def main(): | |
| 63 | + parser = argparse.ArgumentParser(description=__doc__) | |
| 64 | + parser.add_argument('--cache', type=Path, required=True) | |
| 65 | + parser.add_argument('--download', action='store_true') | |
| 66 | + parser.add_argument('--report', type=Path, required=True) | |
| 67 | + args = parser.parse_args() | |
| 68 | + if args.download: | |
| 69 | + args.cache.mkdir(parents=True, exist_ok=True) | |
| 70 | + with ThreadPoolExecutor(max_workers=4) as pool: | |
| 71 | + list(pool.map(lambda name: fetch(args.cache, name), PARTS)) | |
| 72 | + result = verify(args.cache) | |
| 73 | + args.report.write_text(json.dumps(result, indent=2) + '\n', encoding='utf-8') | |
| 74 | + print(f"source archive: {result['archive_bytes']} bytes, 14 parts, sha256 matches ATLAS.md") | |
| 75 | + print('No source was extracted; no declaration atlas or Lean build was verified.') | |
| 76 | + | |
| 77 | + | |
| 78 | +if __name__ == '__main__': | |
| 79 | + main() | |