From 1b6d15d1231b8715e6d345ca8a2ea431ebb50b63 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sat, 21 Nov 2026 22:46:40 +0800 Subject: [PATCH 1/4] research(rh): pin theta-lift and geometry inputs to actual Galois row --- .github/workflows/rhd04-galois-row.yml | 100 ++++++++++ MathCan.lean | 1 + MathCan/RHGaloisRowInputs.lean | 84 ++++++++ .../GALOIS_ROW_INPUTS.md | 70 +++++++ .../galois_row_input_audit.py | 181 ++++++++++++++++++ tests/test_rhd04_galois_sources.py | 35 ++++ 6 files changed, 471 insertions(+) create mode 100644 .github/workflows/rhd04-galois-row.yml create mode 100644 MathCan/RHGaloisRowInputs.lean create mode 100644 research/rh_proof_distillation/GALOIS_ROW_INPUTS.md create mode 100644 research/rh_proof_distillation/galois_row_input_audit.py create mode 100644 tests/test_rhd04_galois_sources.py diff --git a/.github/workflows/rhd04-galois-row.yml b/.github/workflows/rhd04-galois-row.yml new file mode 100644 index 00000000..556c106a --- /dev/null +++ b/.github/workflows/rhd04-galois-row.yml @@ -0,0 +1,100 @@ +name: RHD-04 Galois row and theta lift source audit + +on: + push: + paths: + - 'MathCan/RHGaloisRowInputs.lean' + - 'MathCan.lean' + - 'research/rh_proof_distillation/galois_row_input_audit.py' + - 'tests/test_rhd04_galois_sources.py' + - 'research/rh_proof_distillation/GALOIS_ROW_INPUTS.md' + - '.github/workflows/rhd04-galois-row.yml' + pull_request: + paths: + - 'MathCan/RHGaloisRowInputs.lean' + - 'MathCan.lean' + - 'research/rh_proof_distillation/galois_row_input_audit.py' + - 'tests/test_rhd04_galois_sources.py' + - 'research/rh_proof_distillation/GALOIS_ROW_INPUTS.md' + - '.github/workflows/rhd04-galois-row.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + source-pinned-galois: + 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/ThetaParseval/HalfIndexLattices/TLiftK.lean + src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/ThetaParseval/ThetaKernels/GalTPDefs.lean + src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/ThetaParseval/ThetaKernels/TPGHolds.lean + src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/ThetaParseval/ThetaKernels/TLiftK.lean + src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/GeoOneOfParts.lean + src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/GeometricRealizationOfWeightOne.lean + src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/WeightOneGeometricRealization.lean + src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/Development.lean + src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/GaloisRepresentationsOfThetaLift.lean + src/Development/AutomorphicArithmetic/Foundations/GaloisRepresentations/IntegralStructures/RowSrc.lean + src/Development/AutomorphicArithmetic/Foundations/LocalLanglands/LocalCentralUnits/RecTExists.lean + src/Development/AutomorphicArithmetic/CharacterBoxes/MainConclusion.lean + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Pure-Python source gate and statement mutation tests + working-directory: mathcan + run: python -m unittest tests.test_rhd04_galois_sources -v + - name: Audit original Galois and theta lift source interfaces + working-directory: mathcan + run: | + mkdir -p rhd04 + python -m research.rh_proof_distillation.galois_row_input_audit \ + --upstream ../upstream \ + --output rhd04/source-galois-row-graph.json + - uses: actions/upload-artifact@v4 + if: always() + with: + name: rhd04-source-theta-galois-graph + path: mathcan/rhd04/ + if-no-files-found: ignore + + independent-lean-logic: + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - uses: actions/checkout@v4 + - uses: leanprover/lean-action@v1 + with: + auto-config: false + build: true + build-args: MathCan + test: false + lint: false + use-mathlib-cache: false + - name: Check source-interface implications and axiom inventory + shell: bash + run: | + set -euo pipefail + lake env lean MathCan/RHGaloisRowInputs.lean | tee rhd04-lean-axioms.txt + if grep -Eq 'sorryAx|ofReduceBool|^error:|admit' rhd04-lean-axioms.txt; then + exit 1 + fi + - uses: actions/upload-artifact@v4 + if: always() + with: + name: rhd04-theta-galois-lean-axioms + path: rhd04-lean-axioms.txt + if-no-files-found: ignore diff --git a/MathCan.lean b/MathCan.lean index a5131d09..961e5bcf 100644 --- a/MathCan.lean +++ b/MathCan.lean @@ -150,3 +150,4 @@ import MathCan.NOR46ExactIntegerTrace import MathCan.RHWindowExponents import MathCan.RHFamilyWitnesses import MathCan.RHMainLogic +import MathCan.RHGaloisRowInputs diff --git a/MathCan/RHGaloisRowInputs.lean b/MathCan/RHGaloisRowInputs.lean new file mode 100644 index 00000000..316ed32f --- /dev/null +++ b/MathCan/RHGaloisRowInputs.lean @@ -0,0 +1,84 @@ +import MathCan.RHMainLogic + +/-! +# RHD-04: Galois row from geometry and theta lifting. + +An Init-only logical model of the verified source theorem boundaries. +This module does not recreate GeoOne, TLiftK, Row0b, the genuine +local Langlands representation, or any arithmetic-geometric proof. +-/ + +namespace MathCan.RHGaloisRowInputs + +universe u + +/-- Original source: galoisRepresentations_of_thetaLift composes +the GeoOne result with the TLiftK result and produces Row0b recT. -/ +theorem galois_row_from_geometry_and_theta_lift + {GeoOne TLiftK CoreAll Row0 Row0b : Prop} + (geo : GeoOne) (lift : TLiftK) + (produceCore : GeoOne → TLiftK → CoreAll) + (produceRow : CoreAll → Row0) + (strengthenRow : Row0 → Row0b) : Row0b := + strengthenRow (produceRow (produceCore geo lift)) + +/-- Source MainConclusion uses the same Row0b witness twice, +and the separately proved RecTExists as its third input. -/ +theorem literature_inputs_from_row_and_recT + {Row0b RecTExists : Prop} (row : Row0b) (rec : RecTExists) : + MathCan.RHMainLogic.OpenLiteratureProxy Row0b RecTExists := + ⟨row, rec, row⟩ + +/-- A fixed initial unitary problem may choose a lifting threshold +before the target dimension and all subsequent local data are chosen. -/ +def UniformEventualLift {Local : Type u} + (Admissible : (d : Nat) → Local → Prop) : Prop := + ∃ d0 : Nat, ∀ d : Nat, d0 ≤ d → ∀ local : Local, Admissible d local + +/-- The stronger source order of quantifiers implies eventual validity +for each particular later local datum. -/ +theorem uniform_eventual_lift_implies_pointwise + {Local : Type u} + (Admissible : (d : Nat) → Local → Prop) + (h : UniformEventualLift Admissible) : + ∀ local : Local, ∃ d0 : Nat, + ∀ d : Nat, d0 ≤ d → Admissible d local := by + obtain ⟨d0, hd0⟩ := h + intro local + exact ⟨d0, fun d hd => hd0 d hd local⟩ + +/-- The inverse quantifier exchange is invalid in general. Each local +datum n may require d≥n, without one finite threshold for every n. -/ +theorem pointwise_lift_thresholds_need_not_be_uniform : + (∀ local : Nat, ∃ d0 : Nat, + ∀ d : Nat, d0 ≤ d → local ≤ d) ∧ + ¬ (∃ d0 : Nat, ∀ d : Nat, d0 ≤ d → + ∀ local : Nat, local ≤ d) := by + constructor + · intro local + exact ⟨local, fun d hd => hd⟩ + · rintro ⟨d0, h⟩ + have hh := h d0 (Nat.le_refl d0) (d0 + 1) + omega + +/-- A separate parameter can change which initial problem is being +lifted, so the threshold need not be uniform across all initial problems. -/ +theorem initial_data_can_change_lift_threshold : + (∀ initial : Nat, ∃ d0 : Nat, ∀ d : Nat, + d0 ≤ d → initial ≤ d) ∧ + ¬ (∃ d0 : Nat, ∀ initial d : Nat, + d0 ≤ d → initial ≤ d) := by + constructor + · intro initial + exact ⟨initial, fun d hd => hd⟩ + · rintro ⟨d0, h⟩ + have bad := h (d0 + 1) d0 (Nat.le_refl d0) + omega + +#print axioms galois_row_from_geometry_and_theta_lift +#print axioms literature_inputs_from_row_and_recT +#print axioms uniform_eventual_lift_implies_pointwise +#print axioms pointwise_lift_thresholds_need_not_be_uniform +#print axioms initial_data_can_change_lift_threshold + +end MathCan.RHGaloisRowInputs diff --git a/research/rh_proof_distillation/GALOIS_ROW_INPUTS.md b/research/rh_proof_distillation/GALOIS_ROW_INPUTS.md new file mode 100644 index 00000000..993db0c9 --- /dev/null +++ b/research/rh_proof_distillation/GALOIS_ROW_INPUTS.md @@ -0,0 +1,70 @@ +# RHD-04 | Galois row: geometric realization and eventual theta lift + +Live RH proof source pin: `leanprover-community/riemann-hypothesis` +commit `f150e02623b1e2bbe1f1da8eab5ffee5e930a6a3`. +This note investigates the actual character-theorem input branch. + +## Two independently supplied mathematical premises + +`UpperTheory.Gal.Int.galoisLocalGlobalStrong_recParameter` is built +from `UpperTheory.Gal.Int.galoisRepresentations_of_thetaLift` +with `UpperTheory.TP.K.tLiftK`. The former invokes +`galoisLocalGlobalStrong_of_geometry_lift` on the proof +`UpperTheory.Gal.Int.Geo.geoOne_holds` and the provided lift. + +The geometric term `GeoOne` is produced by +`geometric_realization_of_weight_one` using the source +steps theorem, the Kodaira-Spencer/holomorphic Lefschetz step, +and a `PlanEx` construction. The theta-lift term uses +`tLift_holds_k`, built from `tools_holds_k` and +`tLift_of_tools_k` with a theta integrability premise. + +These are concrete, source-named theorem inputs rather than +generic placeholders. The mathematical task is to review what +their geometry and lift statements assert and whether their +imported prerequisites are independently justified. + +## Two theta lifting propositions agree syntactically + +`HalfIndexLattices/TLiftK.lean` defines `UpperTheory.TP.TLiftK`. +`ThetaKernels/GalTPDefs.lean` defines `UpperTheory.TP.TLift_k`. +After replacing the qualified `GoodK` name with the local +namespace spelling and normalizing whitespace, their +entire quantified statements coincide byte-for-byte. + +The source states for every admissible initial CM-field datum +and Hermitian input a dimension threshold `d0` such that, +for every `d>=d0` and every later admissible skew-Hermitian +input, character, weight and automorphic representation, +an appropriate lifted representation exists. In particular, +`d0` is chosen before the later data, though it can depend +on the original field, rank and Hermitian input. + +`MathCan/RHGaloisRowInputs.lean` proves a conditional logical +Galois-row interface and two quantifier-order counterexamples. +A pointwise threshold `d0(local)` cannot automatically replace +the stronger source threshold selected before all later data. + +## Separately supplied local Langlands witness + +The final `everyCharacter_of_row` construction passes +`UpperTheory.Zero.LLC.recTExists` separately from the +Galois row. The pinned `RecTExists.lean` source builds +that witness from `artEx`, `cuspEx`, +`GlobalTheory.LocLanglands.exists_isLExt`, dimension and +twist transport, and other explicit representation properties. +The exact source audit records this route independently. + +## Verification level + +The dedicated RHD-04 CI uses a sparse checkout of **twelve** +source files, requires every original Git blob to match the +published pinned commit and verifies the named source links. +It checks the theta-lift statement equivalence as a normalized +source-text comparison. The independent Lean 4.35/Init +theorems assert only conditional logic and quantifier ordering. + +The source-level statements here do not establish the global RH +result, nor constitute a kernel recheck of the 175k-module +published formalization. The further work is actual theorem +dependency extraction for `GeoOne` and `TLiftK` premises. diff --git a/research/rh_proof_distillation/galois_row_input_audit.py b/research/rh_proof_distillation/galois_row_input_audit.py new file mode 100644 index 00000000..54d3e912 --- /dev/null +++ b/research/rh_proof_distillation/galois_row_input_audit.py @@ -0,0 +1,181 @@ +"""RHD-04: source-attested inputs to the published Galois row theorem. + +Compares the two source formulations of the theta lifting proposition, +and follows the named geometric/lift/recT witnesses to MainConclusion. +Statements are verified against the original, exact Git blob IDs. + +This is source-text analysis, not full imported Lean proof-term closure. +""" +from __future__ import annotations + +import argparse +import hashlib +import json +from pathlib import Path +import re +import subprocess + +PIN = "f150e02623b1e2bbe1f1da8eab5ffee5e930a6a3" +BASE = "src/Development/AutomorphicArithmetic/" +F = { + "lift_type": ("Foundations/GaloisRepresentations/ThetaParseval/HalfIndexLattices/TLiftK.lean", + "4b36fc43e988270944cef2fc1b5e9ee1493fc275"), + "lift_source": ("Foundations/GaloisRepresentations/ThetaParseval/ThetaKernels/GalTPDefs.lean", + "42831f56b9baacfaca0cde1207a1337882556e4c"), + "lift_tools": ("Foundations/GaloisRepresentations/ThetaParseval/ThetaKernels/TPGHolds.lean", + "c621b46b313d554ed00af05fb0ab8eb4c5050c60"), + "lift_proved": ("Foundations/GaloisRepresentations/ThetaParseval/ThetaKernels/TLiftK.lean", + "e9101ee7d8551561a1d6ca3b18fdcfe84dbfc713"), + "geo_parts": ("Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/GeoOneOfParts.lean", + "3954be7d48aae14c9c362152bdb3fffdb968fa05"), + "geo_realization": ("Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/GeometricRealizationOfWeightOne.lean", + "a3966183e2d20f54fc7109a14dcf14979d89d8e1"), + "geo_proved": ("Foundations/GaloisRepresentations/IntegralStructures/GeometricFlagBases/WeightOneGeometricRealization.lean", + "4af6c909184001b272f7bfc504eac4606dcda763"), + "row_core": ("Foundations/GaloisRepresentations/IntegralStructures/Development.lean", + "4d4d9506494734f28fce7d39bac1a50650ecf148"), + "row_of_lift": ("Foundations/GaloisRepresentations/IntegralStructures/GaloisRepresentationsOfThetaLift.lean", + "869a5e68fcff90c1ee29a6dae75594ed8a59ada9"), + "row_final": ("Foundations/GaloisRepresentations/IntegralStructures/RowSrc.lean", + "f769999ac5e49241993e5efbf81e4d2cded18acd"), + "recT": ("Foundations/LocalLanglands/LocalCentralUnits/RecTExists.lean", + "268786576f96cb5a2cea5fab2da4cf4f291c1116"), + "conclusion": ("CharacterBoxes/MainConclusion.lean", + "ee340012ab19713a8acfecf8adc6a331cbc2f1a4"), +} +REQUIRED = { + "lift_type": ("def TLiftK : Prop :=", "∃ d₀ : ℕ, ∀ d, d₀ ≤ d", "∃ U' :"), + "lift_source": ("def TLift_k : Prop :=", "∃ d₀ : ℕ, ∀ d, d₀ ≤ d", "∃ U' :"), + "lift_tools": ("theorem tools_holds_k", "theorem tLift_holds_k", "tLift_of_tools_k"), + "lift_proved": ("theorem UpperTheory.TP.K.tLiftK", "UpperTheory.TP.tLift_holds_k"), + "geo_parts": ("theorem geoOne_of_parts", "geoOne_of h₁ (packEx_of h₂ h₃)"), + "geo_realization": ("theorem geometric_realization_of_weight_one", "steps_holds", "kodaira_spencer_of_weight_one", "Pl.planEx_holds"), + "geo_proved": ("theorem geoOne_holds : GeoOne", "geometric_realization_of_weight_one weight_one_geometric_realization"), + "row_core": ("theorem coreAll_of", "theorem galoisLocalGlobalStrong_of_geometry_lift", "UpperTheory.GalStar.Row0.row0b", "galoisLocalGlobal_of_geometry_lift geo up"), + "row_of_lift": ("theorem galoisRepresentations_of_thetaLift", "galoisLocalGlobalStrong_of_geometry_lift UpperTheory.Gal.Int.Geo.geoOne_holds up"), + "row_final": ("theorem galoisLocalGlobalStrong_recParameter", "galoisRepresentations_of_thetaLift UpperTheory.TP.K.tLiftK"), + "recT": ("theorem UpperTheory.Zero.LLC.recTExists", "GlobalTheory.LocLanglands.exists_isLExt"), + "conclusion": ("everyCharacter_of_row", "UpperTheory.Zero.LLC.recTExists", "UpperTheory.Gal.Int.galoisLocalGlobalStrong_recParameter"), +} + + +def git_blob(raw: bytes) -> str: + return hashlib.sha1(b"blob " + str(len(raw)).encode() + b"\0" + raw).hexdigest() + + +def definition_body(source: str, start: str) -> str: + i = source.find(start) + if i < 0: + raise ValueError(f"missing Lean definition: {start}") + rest = source[i + len(start):] + ends = [p for tag in ("\ndef ", "\ntheorem ", "\nend ", "\nsection ") + if (p := rest.find(tag)) >= 0] + return rest[:min(ends) if ends else len(rest)].strip() + + +def normalize_lift_statement(statement: str) -> str: + return " ".join( + statement.replace("_root_.UpperTheory.TP.W.GoodK", "W.GoodK").split() + ) + + +def compare_lifts(a: str, b: str) -> dict: + t1 = definition_body(a, "def TLiftK : Prop :=") + t2 = definition_body(b, "def TLift_k : Prop :=") + n1, n2 = normalize_lift_statement(t1), normalize_lift_statement(t2) + if n1 != n2: + raise ValueError("lift variants are not the same source proposition after normalization") + if not all(needle in n1 for needle in ( + "∃ d₀ : ℕ, ∀ d, d₀ ≤ d", + "W.IsSkew", + "IsHecke", + "HasExp", + "∃ U' : Submodule", + )): + raise ValueError("pinned lifting statement lost quantified conditions") + return { + "canonical_statement_sha256": hashlib.sha256(n1.encode()).hexdigest(), + "same_after_namespace_and_whitespace_normalization": True, + "source_statement_bytes": [len(t1.encode()), len(t2.encode())], + "scope": "source text; no definitional-equality kernel check", + "quantifier_note": ( + "d0 is chosen before d, W, Hecke characters, weights and U, " + "but after initial E/B/n/X and its hypotheses." + ), + } + + +def audit(root: Path) -> dict: + head = subprocess.check_output(["git", "-C", str(root), "rev-parse", "HEAD"], + text=True).strip() + if head != PIN: + raise ValueError(f"upstream revision mismatch: {head}") + source, receipts = {}, {} + for name, (relative, expected) in F.items(): + path = BASE + relative + raw = (root / path).read_bytes() + actual = git_blob(raw) + if actual != expected: + raise ValueError(f"original source blob changed for {name}") + s = raw.decode("utf-8") + absent = [x for x in REQUIRED[name] if x not in s] + if absent: + raise ValueError(f"source theorem links missing at {name}: {absent}") + source[name] = s + receipts[name] = { + "source": path, "git_blob": actual, "sha256": hashlib.sha256(raw).hexdigest(), + "bytes": len(raw), + } + lift = compare_lifts(source["lift_type"], source["lift_source"]) + return { + "schema_version": 1, + "mode": "pinned_source_theorem_input_graph", + "upstream_commit": PIN, + "proof_term_data": False, + "verified_files": receipts, + "theta_lift_equivalence": lift, + "named_input_graph": [ + {"from": "UpperTheory.TP.K.tLiftK", "requires": "UpperTheory.TP.tLift_holds_k"}, + {"from": "UpperTheory.TP.tLift_holds_k", "requires": "UpperTheory.TP.tools_holds_k"}, + {"from": "UpperTheory.Gal.Int.Geo.geoOne_holds", "requires": "geometric_realization_of_weight_one"}, + {"from": "geometric_realization_of_weight_one", "requires": "Steps + KSAll + PlanEx"}, + {"from": "galoisRepresentations_of_thetaLift", "requires": "GeoOne + TLiftK"}, + {"from": "galoisLocalGlobalStrong_recParameter", "requires": "galoisRepresentations_of_thetaLift + tLiftK"}, + {"from": "UpperTheory.FinalTheorems.everyCharacter_of_row", + "requires": "galoisLocalGlobalStrong_recParameter + recTExists + vwin_of_row"}, + ], + "separate_local_langlands_proof": { + "theorem": "UpperTheory.Zero.LLC.recTExists", + "direct_source_calls": [ + "UpperTheory.Zero.LLC.artEx", "UpperTheory.Zero.LLC.cuspEx", + "GlobalTheory.LocLanglands.exists_isLExt", + "UpperTheory.Zero.LLC.extDim", "UpperTheory.Zero.LLC.extTw", + ], + }, + "limitations": [ + "These are named source statements and links, not full Lean proof-term references", + "Identical normalized propositions are a source-text equality test, not a proof of Lean definitional equality", + "The quantified theta-lifting and geometric input theorems remain unverified independently of the upstream published formalization", + ], + } + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--upstream", required=True, type=Path) + parser.add_argument("--output", required=True, type=Path) + args = parser.parse_args() + out = audit(args.upstream.resolve()) + args.output.parent.mkdir(parents=True, exist_ok=True) + args.output.write_text(json.dumps(out, indent=2, sort_keys=True) + "\n") + print(json.dumps({ + "upstream": PIN, + "verified_files": len(out["verified_files"]), + "lift_statements_equal": out["theta_lift_equivalence"]["same_after_namespace_and_whitespace_normalization"], + "named_gates": len(out["named_input_graph"]), + "proof_term_data": False, + }, sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/tests/test_rhd04_galois_sources.py b/tests/test_rhd04_galois_sources.py new file mode 100644 index 00000000..14f7b87d --- /dev/null +++ b/tests/test_rhd04_galois_sources.py @@ -0,0 +1,35 @@ +"""RHD-04 source-statement equivalence and mutation controls.""" +import unittest +from research.rh_proof_distillation.galois_row_input_audit import ( + git_blob, definition_body, normalize_lift_statement, compare_lifts, F, REQUIRED, +) + + +class GaloisRowInputTests(unittest.TestCase): + def test_source_pin_manifest_is_complete(self): + self.assertEqual(len(F), 12) + self.assertTrue(all(len(entry[1]) == 40 for entry in F.values())) + self.assertEqual(set(F), set(REQUIRED)) + + def test_definition_extraction(self): + source = "def TLiftK : Prop := A\n\ndef Other : Prop := True\n" + self.assertEqual(definition_body(source, "def TLiftK : Prop :="), "A") + with self.assertRaises(ValueError): + definition_body(source, "def DoesNotExist : Prop :=") + + def test_namespace_and_whitespace_normalization(self): + a = " W.GoodK \n ∃ d₀ : ℕ, ∀ d, d₀ ≤ d W.IsSkew IsHecke HasExp ∃ U' : Submodule" + b = a.replace("W.GoodK", "_root_.UpperTheory.TP.W.GoodK") + self.assertEqual(normalize_lift_statement(a), normalize_lift_statement(b)) + a = "def TLiftK : Prop := " + a + "\nend" + b = "def TLift_k : Prop := " + b + "\ndef HgtFst_k : Prop := True" + self.assertTrue(compare_lifts(a, b)["same_after_namespace_and_whitespace_normalization"]) + with self.assertRaisesRegex(ValueError, "not the same"): + compare_lifts(a, b.replace("W.IsSkew", "W.IsHerm")) + + def test_git_empty_blob(self): + self.assertEqual(git_blob(b""), "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391") + + +if __name__ == "__main__": + unittest.main() From 99208c1c07f42b267fd643dba6c5564f4a7aac7a Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sat, 21 Nov 2026 22:47:50 +0800 Subject: [PATCH 2/4] fix(rh): avoid reserved Lean local keyword in theta cutoff examples --- MathCan/RHGaloisRowInputs.lean | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/MathCan/RHGaloisRowInputs.lean b/MathCan/RHGaloisRowInputs.lean index 316ed32f..4af9ac39 100644 --- a/MathCan/RHGaloisRowInputs.lean +++ b/MathCan/RHGaloisRowInputs.lean @@ -5,7 +5,7 @@ import MathCan.RHMainLogic An Init-only logical model of the verified source theorem boundaries. This module does not recreate GeoOne, TLiftK, Row0b, the genuine -local Langlands representation, or any arithmetic-geometric proof. +datum Langlands representation, or any arithmetic-geometric proof. -/ namespace MathCan.RHGaloisRowInputs @@ -30,33 +30,33 @@ theorem literature_inputs_from_row_and_recT ⟨row, rec, row⟩ /-- A fixed initial unitary problem may choose a lifting threshold -before the target dimension and all subsequent local data are chosen. -/ +before the target dimension and all subsequent datum data are chosen. -/ def UniformEventualLift {Local : Type u} (Admissible : (d : Nat) → Local → Prop) : Prop := - ∃ d0 : Nat, ∀ d : Nat, d0 ≤ d → ∀ local : Local, Admissible d local + ∃ d0 : Nat, ∀ d : Nat, d0 ≤ d → ∀ datum : Local, Admissible d datum /-- The stronger source order of quantifiers implies eventual validity -for each particular later local datum. -/ +for each particular later datum datum. -/ theorem uniform_eventual_lift_implies_pointwise {Local : Type u} (Admissible : (d : Nat) → Local → Prop) (h : UniformEventualLift Admissible) : - ∀ local : Local, ∃ d0 : Nat, - ∀ d : Nat, d0 ≤ d → Admissible d local := by + ∀ datum : Local, ∃ d0 : Nat, + ∀ d : Nat, d0 ≤ d → Admissible d datum := by obtain ⟨d0, hd0⟩ := h - intro local - exact ⟨d0, fun d hd => hd0 d hd local⟩ + intro datum + exact ⟨d0, fun d hd => hd0 d hd datum⟩ -/-- The inverse quantifier exchange is invalid in general. Each local +/-- The inverse quantifier exchange is invalid in general. Each datum datum n may require d≥n, without one finite threshold for every n. -/ theorem pointwise_lift_thresholds_need_not_be_uniform : - (∀ local : Nat, ∃ d0 : Nat, - ∀ d : Nat, d0 ≤ d → local ≤ d) ∧ + (∀ datum : Nat, ∃ d0 : Nat, + ∀ d : Nat, d0 ≤ d → datum ≤ d) ∧ ¬ (∃ d0 : Nat, ∀ d : Nat, d0 ≤ d → - ∀ local : Nat, local ≤ d) := by + ∀ datum : Nat, datum ≤ d) := by constructor - · intro local - exact ⟨local, fun d hd => hd⟩ + · intro datum + exact ⟨datum, fun d hd => hd⟩ · rintro ⟨d0, h⟩ have hh := h d0 (Nat.le_refl d0) (d0 + 1) omega From 96604b343e3c4593d4458868a764607fc6d245cc Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sat, 21 Nov 2026 22:56:46 +0800 Subject: [PATCH 3/4] fix(rhd04): handle bare Lean end when comparing lift propositions --- research/rh_proof_distillation/galois_row_input_audit.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/research/rh_proof_distillation/galois_row_input_audit.py b/research/rh_proof_distillation/galois_row_input_audit.py index 54d3e912..9076df7f 100644 --- a/research/rh_proof_distillation/galois_row_input_audit.py +++ b/research/rh_proof_distillation/galois_row_input_audit.py @@ -68,10 +68,9 @@ def definition_body(source: str, start: str) -> str: if i < 0: raise ValueError(f"missing Lean definition: {start}") rest = source[i + len(start):] - ends = [p for tag in ("\ndef ", "\ntheorem ", "\nend ", "\nsection ") - if (p := rest.find(tag)) >= 0] - return rest[:min(ends) if ends else len(rest)].strip() - + # A namespace-free "end" at EOF is a valid terminator too. + boundary = re.search(r"(?m)^[ \t]*(?:def|theorem|end|section)\b", rest) + return rest[:boundary.start() if boundary else len(rest)].strip() def normalize_lift_statement(statement: str) -> str: return " ".join( From f5bc34f7b83d48d7f935fff7cbd4f5ed0cce1df3 Mon Sep 17 00:00:00 2001 From: Patrick Dugan Date: Sat, 21 Nov 2026 22:56:47 +0800 Subject: [PATCH 4/4] test(rhd04): cover bare end terminator and normalized lift declarations --- tests/test_rhd04_galois_sources.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_rhd04_galois_sources.py b/tests/test_rhd04_galois_sources.py index 14f7b87d..bc453edf 100644 --- a/tests/test_rhd04_galois_sources.py +++ b/tests/test_rhd04_galois_sources.py @@ -16,6 +16,7 @@ def test_definition_extraction(self): self.assertEqual(definition_body(source, "def TLiftK : Prop :="), "A") with self.assertRaises(ValueError): definition_body(source, "def DoesNotExist : Prop :=") + self.assertEqual(definition_body("def TLiftK : Prop := True\nend", "def TLiftK : Prop :="), "True") def test_namespace_and_whitespace_normalization(self): a = " W.GoodK \n ∃ d₀ : ℕ, ∀ d, d₀ ≤ d W.IsSkew IsHecke HasExp ∃ U' : Submodule"