From 04db9f7052c9d1d18c3b10ae9226960453eb652a Mon Sep 17 00:00:00 2001 From: "K.Takahashi" Date: Fri, 2 Oct 2026 12:38:46 +0900 Subject: [PATCH 1/2] P001: connect Nat two-branch criterion to Int prime reconstruction Add PrimeBranchBridge.lean (9 theorems) linking PrimeDivisorBranches (Nat, general c) and PrimeCoprimality (Int, 4x-p): - shift_cast: for p < 4x, Nat subtraction 4*x-p casts to 4x-p - shift_coprime: Nat.Coprime (4*x-p) p from odd_prime_coprimality - prime_factor_witness_iff_branches: two-branch equivalence at c=4x-p - factor_witness_reconstruction, branchI/branchII_reconstruction: a Nat factor witness or branch parameter yields 0 (306,21618,61251) via branchII_reconstruction, Branch I t=34 -> (306,15980,172727820) Local lake build: PrimeBranchBridge built, 645 jobs, exit 0; axioms within propext/Classical.choice/Quot.sound; check_policy 7 files. No existence theorem for the witness t is claimed. Co-Authored-By: Claude Opus 5.5 --- OutcastsMathLab.lean | 1 + .../PrimeBranchBridge.lean | 137 ++++++++++++++++++ Problems/P001_ErdosStraus1201/BRIDGE.md | 32 ++++ 3 files changed, 170 insertions(+) create mode 100644 OutcastsMathLab/Problems/P001_ErdosStraus1201/PrimeBranchBridge.lean create mode 100644 Problems/P001_ErdosStraus1201/BRIDGE.md diff --git a/OutcastsMathLab.lean b/OutcastsMathLab.lean index b19f55a..acd34ac 100644 --- a/OutcastsMathLab.lean +++ b/OutcastsMathLab.lean @@ -3,3 +3,4 @@ import OutcastsMathLab.Problems.P001_ErdosStraus1201.Verification import OutcastsMathLab.Problems.P001_ErdosStraus1201.ReverseDivisor import OutcastsMathLab.Problems.P001_ErdosStraus1201.PrimeCoprimality import OutcastsMathLab.Problems.P001_ErdosStraus1201.PrimeDivisorBranches +import OutcastsMathLab.Problems.P001_ErdosStraus1201.PrimeBranchBridge diff --git a/OutcastsMathLab/Problems/P001_ErdosStraus1201/PrimeBranchBridge.lean b/OutcastsMathLab/Problems/P001_ErdosStraus1201/PrimeBranchBridge.lean new file mode 100644 index 0000000..596eef8 --- /dev/null +++ b/OutcastsMathLab/Problems/P001_ErdosStraus1201/PrimeBranchBridge.lean @@ -0,0 +1,137 @@ +import Mathlib.Data.Nat.Prime.Defs +import Mathlib.Tactic.NormNum.Prime +import OutcastsMathLab.Problems.P001_ErdosStraus1201.PrimeCoprimality +import OutcastsMathLab.Problems.P001_ErdosStraus1201.PrimeDivisorBranches + +namespace OutcastsPrimeBranchBridge + +open OutcastsPrimeDivisorBranches + +-- In the prime range p < 4x, Nat subtraction 4*x-p is not truncated. +theorem shift_cast (p x : Nat) (hlo : p < 4 * x) : + ((4 * x - p : Nat) : Int) = 4 * (x : Int) - (p : Int) := by + omega + +-- Nat coprimality of the shift with p, taken from the Int-level theorem. +theorem shift_coprime (p x : Nat) (hp : Nat.Prime p) (hodd : p ≠ 2) + (hlo : p < 4 * x) (hhi : 4 * x ≤ 3 * p) : + Nat.Coprime (4 * x - p) p := by + have hx : 0 < x := by omega + have hxp : x < p := by omega + have h := OutcastsPrimeCoprimality.odd_prime_coprimality p x hp hodd hx hxp + rw [← shift_cast p x hlo, ← Int.natCast_mul, Int.gcd_natCast_natCast] at h + exact Nat.Coprime.coprime_dvd_right (Nat.dvd_mul_right p x) h + +-- The two-branch equivalence with c = 4*x-p; no coprimality hypothesis remains. +theorem prime_factor_witness_iff_branches (p x a : Nat) + (hp : Nat.Prime p) (hodd : p ≠ 2) + (hlo : p < 4 * x) (hhi : 4 * x ≤ 3 * p) : + FactorWitness p x (4 * x - p) a ↔ + BranchI p x (4 * x - p) a ∨ + ∃ t, a = p * t ∧ BranchII p x (4 * x - p) t := + factor_witness_iff_branches p x (4 * x - p) a hp (by omega) + (shift_coprime p x hp hodd hlo hhi) + +-- A Nat factor witness yields the Int reconstruction of PrimeCoprimality. +-- The complementary factor b is the exact Nat quotient (px)^2 / a. +theorem factor_witness_reconstruction (p x a : Nat) + (hp : Nat.Prime p) (hodd : p ≠ 2) + (hlo : p < 4 * x) (hhi : 4 * x ≤ 3 * p) + (hw : FactorWitness p x (4 * x - p) a) : + let b : Int := (((p * x) * (p * x) / a : Nat) : Int) + let y := ((a : Int) + (p : Int) * (x : Int)) / (4 * (x : Int) - (p : Int)) + let z := (b + (p : Int) * (x : Int)) / (4 * (x : Int) - (p : Int)) + 0 < (x : Int) ∧ (x : Int) ≤ y ∧ y ≤ z ∧ + 4 * (x : Int) * y * z = + (p : Int) * ((x : Int) * y + (x : Int) * z + y * z) := by + obtain ⟨ha, haM, hd, hcong, hbound⟩ := hw + have hc := shift_cast p x hlo + have hab : (a : Int) * (((p * x) * (p * x) / a : Nat) : Int) = + ((p : Int) * (x : Int)) * ((p : Int) * (x : Int)) := by + exact_mod_cast Nat.mul_div_cancel' hd + have hda : (4 * (x : Int) - (p : Int)) ∣ (a : Int) + (p : Int) * (x : Int) := by + rw [← hc] + exact_mod_cast hcong + have hlower : (4 * (x : Int) - (p : Int)) * (x : Int) - + (p : Int) * (x : Int) ≤ (a : Int) := by + have h : (((4 * x - p : Nat) : Int)) * (x : Int) ≤ (a : Int) + (p : Int) * (x : Int) := by + exact_mod_cast hbound + rw [hc] at h + omega + exact OutcastsPrimeCoprimality.odd_prime_reconstruction p x (a : Int) _ + hp hodd hlo hhi (by exact_mod_cast ha) (by exact_mod_cast haM) hab hda hlower + +-- Branch I: the factor is t itself. +theorem branchI_reconstruction (p x t : Nat) + (hp : Nat.Prime p) (hodd : p ≠ 2) + (hlo : p < 4 * x) (hhi : 4 * x ≤ 3 * p) + (h : BranchI p x (4 * x - p) t) : + let b : Int := (((p * x) * (p * x) / t : Nat) : Int) + let y := ((t : Int) + (p : Int) * (x : Int)) / (4 * (x : Int) - (p : Int)) + let z := (b + (p : Int) * (x : Int)) / (4 * (x : Int) - (p : Int)) + 0 < (x : Int) ∧ (x : Int) ≤ y ∧ y ≤ z ∧ + 4 * (x : Int) * y * z = + (p : Int) * ((x : Int) * y + (x : Int) * z + y * z) := + factor_witness_reconstruction p x t hp hodd hlo hhi + ((prime_factor_witness_iff_branches p x t hp hodd hlo hhi).mpr (Or.inl h)) + +-- Branch II: the factor is p*t. +theorem branchII_reconstruction (p x t : Nat) + (hp : Nat.Prime p) (hodd : p ≠ 2) + (hlo : p < 4 * x) (hhi : 4 * x ≤ 3 * p) + (h : BranchII p x (4 * x - p) t) : + let b : Int := (((p * x) * (p * x) / (p * t) : Nat) : Int) + let y := (((p * t : Nat) : Int) + (p : Int) * (x : Int)) / (4 * (x : Int) - (p : Int)) + let z := (b + (p : Int) * (x : Int)) / (4 * (x : Int) - (p : Int)) + 0 < (x : Int) ∧ (x : Int) ≤ y ∧ y ≤ z ∧ + 4 * (x : Int) * y * z = + (p : Int) * ((x : Int) * y + (x : Int) * z + y * z) := + factor_witness_reconstruction p x (p * t) hp hodd hlo hhi + ((prime_factor_witness_iff_branches p x (p * t) hp hodd hlo hhi).mpr + (Or.inr ⟨t, rfl, h⟩)) + +-- Non-vacuity: the known solution 4/1201 = 1/306 + 1/21618 + 1/61251 +-- is Branch II with t = 108 (a = 1201*108), and the bridge reproduces it. +theorem example_1201_branchII : + BranchII 1201 306 (4 * 306 - 1201) 108 ∧ + (((1201 * 108 : Nat) : Int) + 1201 * 306) / (4 * 306 - 1201) = 21618 ∧ + ((((1201 * 306) * (1201 * 306) / (1201 * 108) : Nat) : Int) + 1201 * 306) / + (4 * 306 - 1201) = 61251 := by + refine ⟨?_, by decide, by decide⟩ + unfold BranchII + decide + +theorem example_1201_reconstruction : + let y : Int := 21618 + let z : Int := 61251 + 0 < (306 : Int) ∧ (306 : Int) ≤ y ∧ y ≤ z ∧ + 4 * (306 : Int) * y * z = (1201 : Int) * (306 * y + 306 * z + y * z) := by + have h := branchII_reconstruction 1201 306 108 (by norm_num) (by decide) + (by decide) (by decide) example_1201_branchII.1 + have hy := example_1201_branchII.2.1 + have hz := example_1201_branchII.2.2 + simp only [Nat.cast_ofNat] at h hy hz ⊢ + rw [hy, hz] at h + exact h + +-- Branch I is inhabited too: 4/1201 = 1/306 + 1/15980 + 1/172727820 has t = 34. +theorem example_1201_branchI : + BranchI 1201 306 (4 * 306 - 1201) 34 ∧ + (((34 : Nat) : Int) + 1201 * 306) / (4 * 306 - 1201) = 15980 ∧ + ((((1201 * 306) * (1201 * 306) / 34 : Nat) : Int) + 1201 * 306) / + (4 * 306 - 1201) = 172727820 := by + refine ⟨?_, by decide, by decide⟩ + unfold BranchI + decide + +end OutcastsPrimeBranchBridge + +#print axioms OutcastsPrimeBranchBridge.shift_cast +#print axioms OutcastsPrimeBranchBridge.shift_coprime +#print axioms OutcastsPrimeBranchBridge.prime_factor_witness_iff_branches +#print axioms OutcastsPrimeBranchBridge.factor_witness_reconstruction +#print axioms OutcastsPrimeBranchBridge.branchI_reconstruction +#print axioms OutcastsPrimeBranchBridge.branchII_reconstruction +#print axioms OutcastsPrimeBranchBridge.example_1201_branchII +#print axioms OutcastsPrimeBranchBridge.example_1201_reconstruction +#print axioms OutcastsPrimeBranchBridge.example_1201_branchI diff --git a/Problems/P001_ErdosStraus1201/BRIDGE.md b/Problems/P001_ErdosStraus1201/BRIDGE.md new file mode 100644 index 0000000..42424af --- /dev/null +++ b/Problems/P001_ErdosStraus1201/BRIDGE.md @@ -0,0 +1,32 @@ +# 二枝判定(Nat)と素数向けの復元(Int)の接続 + +`PrimeBranchBridge.lean` は、Outcasts #23 で未形式化と指摘した接続を埋める追補です。`PrimeDivisorBranches.lean`(自然数上の一般の `c`)と `PrimeCoprimality.lean`(整数上の `4x−p`)は、それぞれ単独では検証済みでしたが、`c = 4x−p` を代入して両者をつなぐ定理がありませんでした。 + +作成者はルナ側(Outcasts Neo & ルナ)で、前提とする 6 定理の作成者(境界測量士)とは別です。 + +## 命題 + +すべて `Nat.Prime p`、`p ≠ 2`、`p < 4x ≤ 3p` を仮定します。 + +1. `shift_cast`: `p < 4x` なら、自然数の引き算 `4*x-p` を整数へ移すと `4x−p` に一致する(切り捨てが起きない)。 +2. `shift_coprime`: `Nat.Coprime (4*x-p) p`。`odd_prime_coprimality` の整数版の `gcd(4x−p, px)=1` から取り出します。 +3. `prime_factor_witness_iff_branches`: `c = 4*x-p` で `factor_witness_iff_branches` を使った形。gcd の仮定が消えます。 +4. `factor_witness_reconstruction`: 自然数の因数 `a` が `FactorWitness p x (4*x-p) a` を満たせば、`b = (px)²/a`(自然数の正確な商)として、`y = (a+px)/(4x−p)`、`z = (b+px)/(4x−p)` は `0 < x ≤ y ≤ z` と `4xyz = p(xy+xz+yz)` を満たす(整数上)。 +5. `branchI_reconstruction`: Branch I の `t` から、`a = t` として 4 の結論。 +6. `branchII_reconstruction`: Branch II の `t` から、`a = p*t` として 4 の結論。 + +この 6 つで、「奇素数 `p` と許容範囲の `x` に対し、`x²` の約数 `t` が表のどちらかの行を満たせば、エルデシュ=シュトラウス方程式の整列済みの解が得られる」が、gcd 条件や型変換を追加の仮定に持たない一つながりの定理になります。 + +## 仮定が空でないことの確認 + +`4/1201 = 1/306 + 1/21618 + 1/61251` は `c = 23`、`a = 23·21618 − 367506 = 129708 = 1201·108` で Branch II の `t = 108` です。`example_1201_branchII` で `BranchII 1201 306 23 108` と復元値 `y = 21618`、`z = 61251` を確かめ、`example_1201_reconstruction` で `branchII_reconstruction` を実際に適用してこの解の等式を得ています。 + +`4/1201 = 1/306 + 1/15980 + 1/172727820` は `a = 34`(`1201 ∤ 34`、`34 ∣ 306²`)で Branch I の `t = 34` です(`example_1201_branchI`)。 + +## 検証 + +Lean 4.34.0 / mathlib v4.34.0(固定版)。ローカル Windows で生成物を削除して `lake build`: `PrimeBranchBridge` Built、645 jobs、終了コード 0。全 9 定理の `#print axioms` は `propext` / `Classical.choice` / `Quot.sound` の部分集合です。`check_policy.py` は 7 files 通過。jobs が 541 から増えたのは、`Nat.Prime 1201` の証明に `Mathlib.Tactic.NormNum.Prime` を読み込んだためです。 + +## 含まないもの + +各対象素数で表のどちらかの行を満たす `x, t` が存在すること(研究の本題)は含みません。2 枝が重ならないこと(`p ∣ t` の排除)、復元した分母に対する Type I/II のラベル付けの定理、Python 列挙器の形式検証も含みません。この追補の独立した仕様レビューは未実施です。 From ccea7147314f83d1835818e3f90a7136e4df02ac Mon Sep 17 00:00:00 2001 From: "K.Takahashi" Date: Mon, 5 Oct 2026 05:11:25 +0900 Subject: [PATCH 2/2] P001: weaken shift_coprime to x < p as requested in #25 shift_coprime and prime_factor_witness_iff_branches now assume p < 4x and x < p instead of p < 4x <= 3p; the reconstruction theorems keep 4x <= 3p because odd_prime_reconstruction requires it. Rebuilt from deleted build products: PrimeBranchBridge Built, 645 jobs, standard axioms only. Co-Authored-By: Claude Fable 5.1 --- .../P001_ErdosStraus1201/PrimeBranchBridge.lean | 14 +++++++------- Problems/P001_ErdosStraus1201/BRIDGE.md | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/OutcastsMathLab/Problems/P001_ErdosStraus1201/PrimeBranchBridge.lean b/OutcastsMathLab/Problems/P001_ErdosStraus1201/PrimeBranchBridge.lean index 596eef8..d4d8f37 100644 --- a/OutcastsMathLab/Problems/P001_ErdosStraus1201/PrimeBranchBridge.lean +++ b/OutcastsMathLab/Problems/P001_ErdosStraus1201/PrimeBranchBridge.lean @@ -13,11 +13,11 @@ theorem shift_cast (p x : Nat) (hlo : p < 4 * x) : omega -- Nat coprimality of the shift with p, taken from the Int-level theorem. +-- Only x < p is needed on the upper side; 0 < x follows from p < 4x. theorem shift_coprime (p x : Nat) (hp : Nat.Prime p) (hodd : p ≠ 2) - (hlo : p < 4 * x) (hhi : 4 * x ≤ 3 * p) : + (hlo : p < 4 * x) (hxp : x < p) : Nat.Coprime (4 * x - p) p := by have hx : 0 < x := by omega - have hxp : x < p := by omega have h := OutcastsPrimeCoprimality.odd_prime_coprimality p x hp hodd hx hxp rw [← shift_cast p x hlo, ← Int.natCast_mul, Int.gcd_natCast_natCast] at h exact Nat.Coprime.coprime_dvd_right (Nat.dvd_mul_right p x) h @@ -25,12 +25,12 @@ theorem shift_coprime (p x : Nat) (hp : Nat.Prime p) (hodd : p ≠ 2) -- The two-branch equivalence with c = 4*x-p; no coprimality hypothesis remains. theorem prime_factor_witness_iff_branches (p x a : Nat) (hp : Nat.Prime p) (hodd : p ≠ 2) - (hlo : p < 4 * x) (hhi : 4 * x ≤ 3 * p) : + (hlo : p < 4 * x) (hxp : x < p) : FactorWitness p x (4 * x - p) a ↔ BranchI p x (4 * x - p) a ∨ ∃ t, a = p * t ∧ BranchII p x (4 * x - p) t := - factor_witness_iff_branches p x (4 * x - p) a hp (by omega) - (shift_coprime p x hp hodd hlo hhi) + factor_witness_iff_branches p x (4 * x - p) a hp hxp + (shift_coprime p x hp hodd hlo hxp) -- A Nat factor witness yields the Int reconstruction of PrimeCoprimality. -- The complementary factor b is the exact Nat quotient (px)^2 / a. @@ -73,7 +73,7 @@ theorem branchI_reconstruction (p x t : Nat) 4 * (x : Int) * y * z = (p : Int) * ((x : Int) * y + (x : Int) * z + y * z) := factor_witness_reconstruction p x t hp hodd hlo hhi - ((prime_factor_witness_iff_branches p x t hp hodd hlo hhi).mpr (Or.inl h)) + ((prime_factor_witness_iff_branches p x t hp hodd hlo (by omega)).mpr (Or.inl h)) -- Branch II: the factor is p*t. theorem branchII_reconstruction (p x t : Nat) @@ -87,7 +87,7 @@ theorem branchII_reconstruction (p x t : Nat) 4 * (x : Int) * y * z = (p : Int) * ((x : Int) * y + (x : Int) * z + y * z) := factor_witness_reconstruction p x (p * t) hp hodd hlo hhi - ((prime_factor_witness_iff_branches p x (p * t) hp hodd hlo hhi).mpr + ((prime_factor_witness_iff_branches p x (p * t) hp hodd hlo (by omega)).mpr (Or.inr ⟨t, rfl, h⟩)) -- Non-vacuity: the known solution 4/1201 = 1/306 + 1/21618 + 1/61251 diff --git a/Problems/P001_ErdosStraus1201/BRIDGE.md b/Problems/P001_ErdosStraus1201/BRIDGE.md index 42424af..2ce0385 100644 --- a/Problems/P001_ErdosStraus1201/BRIDGE.md +++ b/Problems/P001_ErdosStraus1201/BRIDGE.md @@ -6,10 +6,10 @@ ## 命題 -すべて `Nat.Prime p`、`p ≠ 2`、`p < 4x ≤ 3p` を仮定します。 +1〜3 は `Nat.Prime p`、`p ≠ 2`、`p < 4x`、`x < p` を仮定します(Outcasts #25 の依頼どおり。上側は `4x ≤ 3p` ではなく `x < p` で足ります)。4〜6 は復元の元定理 `odd_prime_reconstruction` が `4x ≤ 3p` を要求するので、その範囲で述べます。 -1. `shift_cast`: `p < 4x` なら、自然数の引き算 `4*x-p` を整数へ移すと `4x−p` に一致する(切り捨てが起きない)。 -2. `shift_coprime`: `Nat.Coprime (4*x-p) p`。`odd_prime_coprimality` の整数版の `gcd(4x−p, px)=1` から取り出します。 +1. `shift_cast`: `p < 4x` なら、自然数の引き算 `4*x-p` を整数へ移すと `4x−p` に一致する(切り捨てが起きない)。素数性は不要です。 +2. `shift_coprime`: `Nat.Coprime (4*x-p) p`。`odd_prime_coprimality` の整数版の `gcd(4x−p, px)=1` から `Int.gcd_natCast_natCast` で自然数へ戻し、`p ∣ px` で右側を `p` に落とします。 3. `prime_factor_witness_iff_branches`: `c = 4*x-p` で `factor_witness_iff_branches` を使った形。gcd の仮定が消えます。 4. `factor_witness_reconstruction`: 自然数の因数 `a` が `FactorWitness p x (4*x-p) a` を満たせば、`b = (px)²/a`(自然数の正確な商)として、`y = (a+px)/(4x−p)`、`z = (b+px)/(4x−p)` は `0 < x ≤ y ≤ z` と `4xyz = p(xy+xz+yz)` を満たす(整数上)。 5. `branchI_reconstruction`: Branch I の `t` から、`a = t` として 4 の結論。