Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/rhd05-geometric-premises.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: RHD-05 pinned geometric and theta-lift premises

on:
push:
paths:
- 'research/rh_proof_distillation/galois_row_deep_audit.py'
- 'research/rh_proof_distillation/GEOMETRY_THETA_DEEP_GATES.md'
- 'tests/test_rhd05_geometric_gates.py'
- '.github/workflows/rhd05-geometric-premises.yml'
pull_request:
paths:
- 'research/rh_proof_distillation/galois_row_deep_audit.py'
- 'research/rh_proof_distillation/GEOMETRY_THETA_DEEP_GATES.md'
- 'tests/test_rhd05_geometric_gates.py'
- '.github/workflows/rhd05-geometric-premises.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
source-attested-premises:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
path: mathcan
persist-credentials: false
- uses: actions/checkout@v4
with:
repository: leanprover-community/riemann-hypothesis
ref: f150e02623b1e2bbe1f1da8eab5ffee5e930a6a3
path: upstream
persist-credentials: false
sparse-checkout-cone-mode: false
sparse-checkout: |
src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/MapInvMul.lean
src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/PackExOf.lean
src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/StepsMain.lean
src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/WeightOneGeometricRealization.lean
src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/PrimeLevelLocalization/ExistsUnitaryGroupDatumOfVectorExponentSpectral.lean
src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/PrimeLevelLocalization/SpecTopHolds.lean
src/Development/AbelianVarietyTheory/Proofs/SatakeParameters/LefschetzFixedPointFiniteEtaleCorrespondence.lean
src/Development/AutomorphicArithmetic/Foundations/EtaleClopenDescent/LefschetzFixedPointFiniteEtaleCorrespondence.lean
src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/LefschetzSigmaSums/KsHodgeOfGeo.lean
src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/ThetaParseval/ThetaKernels/TPGTop.lean
src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/ThetaParseval/ThetaKernels/TPGHolds.lean
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Test mutation controls and proof-field shapes
working-directory: mathcan
run: python -m unittest tests.test_rhd05_geometric_gates -v
- name: Audit exact upstream Git blobs and supplier interfaces
working-directory: mathcan
run: |
mkdir -p rhd05
python -m research.rh_proof_distillation.galois_row_deep_audit \
--upstream ../upstream \
--output rhd05/deep_geometric_theta_gates.json
- uses: actions/upload-artifact@v4
if: always()
with:
name: rhd05-geometric-theta-source-receipts
path: mathcan/rhd05/
if-no-files-found: ignore
61 changes: 61 additions & 0 deletions research/rh_proof_distillation/GEOMETRY_THETA_DEEP_GATES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# RHD-05: deeper Galois row premises

Original upstream: leanprover-community/riemann-hypothesis, commit `f150e02623b1e2bbe1f1da8eab5ffee5e930a6a3`.
Source checks in `galois_row_deep_audit.py` assert **11 immutable Git blobs** and direct supplier interfaces. This is a source proof *route* audit. It does not independently reconstruct, replay, or certify the mathematical proofs imported by the original declarations.

## Geometric row premise

The exact source-level construction is:

1. `geoOne_holds : GeoOne` calls `geometric_realization_of_weight_one weight_one_geometric_realization`.
2. `geometric_realization_of_weight_one` calls `geoOne_of_parts steps_holds (kodaira_spencer_of_weight_one hW) Pl.planEx_holds`.
3. `geoOne_of_parts` takes `Steps`, `KSAll` and `PlanEx`. The `Steps` structure has **17 fields**, including representation, crystalline, étale, jump, Frobenius, and theta transport conditions. `KSAll` contains **six** fields, ending in `KSHodge`.
4. `PlanEx` is a quantified existence theorem for geometric `Plan` packages across CM-field, prime, odd-weight, splitting, local saturation, and automorphic conditions. The source supplies it via `planEx_holds`, using `VecEx`, `ExpOf`, `SpecTop` through `exists_unitaryGroupDatum_of_vector_exponent_spectral` and a larger 15-field assembly.
5. The Hodge component requires `LocalSmoothExtension.HolomorphicLefschetzFormula` plus `FixK`. The former is supplied by `weight_one_geometric_realization` and reduces to `GlobalTheory.T.lefschetz_fixedPoint_finite_etale_correspondence`. Its upstream theorem statement concerns finite étale correspondences on smooth projective schemes, a fixed-point finite set, tangent matrices, and a Hodge-trace equality. The supplier is in the étale-clopen Lefschetz proof module.

Important issue for proof auditing: the `PlanEx` result and the Galois-row application are conditional on demanding local and global admissibility predicates. A source-level witness name can coexist with an empty domain of relevant applications. The review must exhibit at least one representative instance satisfying the antecedents used in the actual row, and then verify the theorem supplies the intended representation.

## Theta-lifting premise

`UpperTheory.TP.K.tLiftK` calls `UpperTheory.TP.tLift_holds_k`, which calls `tLift_of_tools_k`. The latter supplies `tLift_of_k` with a `Tools_k` record and the following major proof components: `HgtFst_k`, `RealPair_k`, `NonVan_k` (built via Rallis, decomposition, bump, datum, tail and Schur arguments), `LiftAut_k` and `ReadLift_k`.

The quantified claim fixes `E`, `B`, `n` and the Hermitian `X` first, then chooses an eventual bound `d₀` before later skew-Hermitian `W`, characters, weights and admissible automorphic `U`. The weight inequality `d + mW(w) ≤ 2 λ(w)_k` is part of the later antecedent. A useful nonvacuity test must construct compatible data at dimensions covered by the theorem and by the Galois-row use site.

The source declarations `TLift_k` and `TLiftK` were found textually identical after namespace normalization in RHD-04. That result checks proposition spelling. A compiled elaborated type-equivalence and proof-term/axiom audit are still valuable independent tests.

## Acceptance checks

- Recover compiled upstream declarations for `GeoOne`, `PlanEx`, `HolomorphicLefschetzFormula` and `TLiftK` from the pinned toolchain. Report `#print axioms` for the actual upstream constants, including `galoisLocalGlobalStrong_recParameter` and the final Main theorem.
- Extract proof-expression references at each named supplier and follow any axioms, `sorryAx`, custom trusted constants, typeclass assumptions or compressed proof-term boundaries.
- Prove or exhibit the relevant antecedents at the exact Galois-row call site. In particular, check `PlanEx` admissibility and eventual `TLiftK` witnesses jointly, not as unrelated existence exercises.
- Compare the mathematical meaning of the local Langlands input `recTExists` and its use in `everyCharacter_of_row` after the geometric and theta-lift gates pass.

Source baseline for the extra 11 files is recorded by the auditor under `SOURCES`, including the direct Lefschetz bridge, PlanEx supplier, 17-field Steps record, six-field KSAll record and theta construction. The receipts deliberately mark `proof_term_data=false`.


## External whole-proof verification as of 2026-11-21 12:55 UTC

Andrew Sutherland's independent checking log at https://math.mit.edu/~drew/grh/
reports that all 175,187 upstream modules compiled and passed Lean `leanchecker`
replay; the Rust nanoda kernel and con-leche accepted the full export; lean4lean
accepted the compiled modules; and con-leche's independent statement comparator
found all five headline Main theorems justified against the Mathlib-only
challenge. The five headline declarations list only the standard axioms
`propext`, `Classical.choice` and `Quot.sound`. The report still listed the
full `lake comparator` and default/paranoid Lean export-kernel replay as
running at that timestamp.

This is independent *whole-proof* checking and substantially strengthens the
formal correctness evidence. The local RHD-05 CI is deliberately a much narrower
source-pinning and proof-interface gate. Its purpose is now to identify the
actual geometric, automorphic and local-global mathematical claims and exhibit
their intended nonvacuous instantiations. Statement meaning and the exact
row-call hypotheses take priority over redundant abstract Lean wrappers.

The external comparison reports that the claimed RH and four Dirichlet
L-function statements are exactly the Mathlib-only challenge statements.
This is evidence about encoded theorem semantics at the headline level.
It leaves room for a detailed mathematical audit of the underlying Galois
row's role, especially how `PlanEx` and `TLiftK` discharge their hypotheses
in the eventual construction. Maintain separate evidence levels for
source matches, compiled proof-term checks, and mathematical interpretation.
180 changes: 180 additions & 0 deletions research/rh_proof_distillation/galois_row_deep_audit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
"""RHD-05: source-pinned geometric and theta-lift prerequisite contracts.

Checks source hashes, named supplier links, and the immediate proof-field
interfaces. This is NOT a Lean proof-term dependency graph or a proof of RH.
"""
from __future__ import annotations

import argparse
import hashlib
import json
from pathlib import Path
import re
import subprocess

PIN = "f150e02623b1e2bbe1f1da8eab5ffee5e930a6a3"

SOURCES = {
"steps": ("src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/MapInvMul.lean", "5f0b07b831bbe8bf0dea7ce8a5e7378a28614f0b"),
"ks_plan": ("src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/PackExOf.lean", "760bbf58b01d01e4fbcea2f829564ab08e5bb621"),
"steps_builder": ("src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/StepsMain.lean", "741722ffb47f56ad88d06182644eb441d1b096b6"),
"geometry": ("src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/WeightOneGeometricRealization.lean", "4af6c909184001b272f7bfc504eac4606dcda763"),
"plan_builder": ("src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/PrimeLevelLocalization/ExistsUnitaryGroupDatumOfVectorExponentSpectral.lean", "c9f1a910b54570f9658168301a6f37141c2796bf"),
"plan_final": ("src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/PrimeLevelLocalization/SpecTopHolds.lean", "8cf10d013812af3c28862907cfbf0d62847dd302"),
"lefschetz_wrapper": ("src/Development/AbelianVarietyTheory/Proofs/SatakeParameters/LefschetzFixedPointFiniteEtaleCorrespondence.lean", "aac9adb87289e23b0695ccf0307535f9a9f91713"),
"lefschetz_proof": ("src/Development/AutomorphicArithmetic/Foundations/EtaleClopenDescent/LefschetzFixedPointFiniteEtaleCorrespondence.lean", "e8dda5d174faa367dd7e786b98a5a68308efc83d"),
"ks_hodge": ("src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/LefschetzSigmaSums/KsHodgeOfGeo.lean", "a7d61d0d4c186d70c262692c7344dacc013c7d83"),
"theta_builder": ("src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/ThetaParseval/ThetaKernels/TPGTop.lean", "c1e81ba09c0e00fba45da9250509c36a72714bc1"),
"theta_final": ("src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/ThetaParseval/ThetaKernels/TPGHolds.lean", "c621b46b313d554ed00af05fb0ab8eb4c5050c60"),
}

EXPECTED_FIELDS = {
"steps": (
"rep", "es", "crys", "jump", "phi", "cut", "twES", "twCrys",
"twJ", "twPhi", "phiOf", "card", "jumpsOf", "rich",
"char", "ss", "cont",
),
"ks_plan": ("std", "ex", "nice", "good", "cong", "hodge"),
}

REQUIRED = {
"steps": ("structure Steps : Prop where", "rep : RepEx", "cont : TP.Sub.ContLeft"),
"ks_plan": (
"def PlanEx : Prop :=", "Odd a →", "FieldOK E l d",
"OneK x w₀ v'", "AutOffT T U", "SphOffU w₀ S U",
"structure KSAll : Prop where", "hodge : KSHodge",
),
"steps_builder": (
"theorem steps_of (hC : CrysStep) (hJ : JumpStep) (hP : PhiStep) : Steps :=",
"repEx_holds", "Mod.esStep_holds", "TP.Sub.contLeft_holds",
),
"geometry": (
"theorem weight_one_geometric_realization : LocalSmoothExtension.HolomorphicLefschetzFormula",
"exact GlobalTheory.T.lefschetz_fixedPoint_finite_etale_correspondence",
"theorem geoOne_holds : GeoOne := geometric_realization_of_weight_one weight_one_geometric_realization",
),
"plan_builder": (
"theorem exists_unitaryGroupDatum_of_vector_exponent_spectral (h1 : VecEx) (h2 : ExpOf) (h3 : SpecTop) : PlanEx :=",
"planEx_of ⟨frameEx_holds", "CertificateRingHomMap.rootsAlg_holds",
),
"plan_final": (
"theorem specTop_holds : SpecTop := UpperTheory.Gal.Spc.specTopG wtOf_holds",
"theorem planEx_holds : PlanEx := exists_unitaryGroupDatum_of_vector_exponent_spectral vecEx_holds expOf_holds specTop_holds",
),
"lefschetz_wrapper": (
"theorem _root_.GlobalTheory.T.lefschetz_fixedPoint_finite_etale_correspondence",
"UpperTheory.Cb.lefschetz_fixedPoint_finite_etale_correspondence",
),
"lefschetz_proof": (
"theorem UpperTheory.Cb.lefschetz_fixedPoint_finite_etale_correspondence",
"exists_integral_clopen_decomposition_of_smooth",
"holomorphic_lefschetz_finiteEtale_correspondence",
),
"ks_hodge": (
"theorem ksHodge_of_geo (hW : HolomorphicLefschetzFormula) (hF : FixK) : UpperTheory.Gal.Int.Geo.KSHodge :=",
"ksHodge_of_inputs hW hF",
),
"theta_builder": (
"theorem tLift_of_tools_k", "_root_.UpperTheory.TP.tLift_of_k T hH",
"_root_.UpperTheory.TP.nonVan_k T", "_root_.UpperTheory.TP.readLift_k T",
),
"theta_final": (
"theorem tools_holds_k", "theorem tLift_holds_k",
"_root_.UpperTheory.TP.tLift_of_tools_k",
),
}


def blob_sha(raw: bytes) -> str:
return hashlib.sha1(b"blob " + str(len(raw)).encode() + b"\0" + raw).hexdigest()


def proof_fields(source: str, name: str) -> tuple[str, ...]:
marker = f"structure {name} : Prop where"
if source.count(marker) != 1:
raise ValueError(f"expected exactly one {marker}")
body = source.split(marker, 1)[1]
fields: list[str] = []
for line in body.splitlines():
m = re.match(r"^ ([a-zA-Z][a-zA-Z0-9]*)\s*:", line)
if m:
fields.append(m.group(1))
elif line.strip():
break
return tuple(fields)


def verify_source(label: str, text: str) -> dict:
missing = [s for s in REQUIRED[label] if s not in text]
if missing:
raise ValueError(f"{label} lost pinned supplier interface: {missing}")
result = {"matched_anchors": len(REQUIRED[label])}
if label == "steps":
actual = proof_fields(text, "Steps")
if actual != EXPECTED_FIELDS[label]:
raise ValueError(f"Steps fields changed: {actual}")
result["proof_fields"] = list(actual)
if label == "ks_plan":
actual = proof_fields(text, "KSAll")
if actual != EXPECTED_FIELDS[label]:
raise ValueError(f"KSAll fields changed: {actual}")
result["proof_fields"] = list(actual)
return result


def audit(upstream: Path) -> dict:
head = subprocess.check_output(
["git", "-C", str(upstream), "rev-parse", "HEAD"], text=True
).strip()
if head != PIN:
raise ValueError(f"upstream changed: {head}")
receipts = {}
for label, (path, expected_sha) in SOURCES.items():
raw = (upstream / path).read_bytes()
got = blob_sha(raw)
if got != expected_sha:
raise ValueError(f"pinned source changed: {label}: {got}")
checks = verify_source(label, raw.decode("utf-8"))
receipts[label] = {
"path": path, "git_blob": got, "sha256": hashlib.sha256(raw).hexdigest(),
**checks,
}
return {
"schema_version": 1,
"mode": "pinned_source_geometric_and_theta_prerequisites",
"upstream_commit": PIN,
"proof_term_data": False,
"sources": receipts,
"immediate_inputs": {
"GeoOne": ["Steps (17 fields)", "KSAll (6 fields)", "PlanEx"],
"PlanEx": ["VecEx", "ExpOf", "SpecTop", "15-field planEx_of bundle"],
"HolomorphicLefschetzFormula": ["finite-etale Lefschetz theorem"],
"TLiftK": ["tLift_of_tools_k", "Tools_k", "HgtEx_k", "theta readLift/nonVan chain"],
},
"review_gates": [
"Kernel axiom inventory on upstream GeoOne, TLiftK, row and Main declarations",
"Compiled proof-term references for each imported mathematical supplier",
"Concrete inhabitance/nonvacuity of PlanEx and TLiftK antecedents on row inputs",
"Verify the actual row supplies all geometric and theta lift hypotheses",
],
}


def main() -> None:
p = argparse.ArgumentParser(description=__doc__)
p.add_argument("--upstream", required=True, type=Path)
p.add_argument("--output", required=True, type=Path)
args = p.parse_args()
report = audit(args.upstream.resolve())
args.output.parent.mkdir(parents=True, exist_ok=True)
args.output.write_text(json.dumps(report, indent=2, sort_keys=True) + "\n", encoding="utf-8")
print(json.dumps({
"source_files": len(report["sources"]),
"proof_term_data": False,
"steps_fields": len(EXPECTED_FIELDS["steps"]),
"ks_fields": len(EXPECTED_FIELDS["ks_plan"]),
}, sort_keys=True))


if __name__ == "__main__":
main()
Loading
Loading