diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a31c072e..027e5913 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,6 +54,9 @@ jobs: python3 scripts/audit_floor_product_descent.py python3 scripts/audit_product_delay_certificates.py python3 scripts/audit_product_thresholds.py + python3 scripts/audit_coefficient_gap_threshold.py + python3 scripts/audit_sharp_finite_survival.py + python3 scripts/audit_sharp_survival_counts.py python3 scripts/audit_eleven_halves_clock.py - name: Check exact first-descent intervals diff --git a/Collatz.lean b/Collatz.lean index a64ddec9..8657c508 100644 --- a/Collatz.lean +++ b/Collatz.lean @@ -2127,3 +2127,6 @@ import Collatz.Exploration.ExactTraceProduct import Collatz.Exploration.FloorProductDescent import Collatz.Exploration.ProductDelayCertificates import Collatz.Exploration.ProductThresholds +import Collatz.Exploration.CoefficientGapThreshold +import Collatz.Exploration.SharpFirstLightEventual +import Collatz.Exploration.SharpSurvivalCounts diff --git a/Collatz/Exploration/CoefficientGapThreshold.lean b/Collatz/Exploration/CoefficientGapThreshold.lean new file mode 100644 index 00000000..d11e7f2d --- /dev/null +++ b/Collatz/Exploration/CoefficientGapThreshold.lean @@ -0,0 +1,58 @@ +import Collatz.Exploration.ProductThresholds +import Collatz.Exploration.FloorBudgetComparison +import Collatz.Strategy.FirstLightDescent + +/-! A linear sufficient source-floor threshold for each light coefficient pair. +These are conditional descent tools based on classical Bernoulli bounds. -/ +namespace Collatz.Exploration.CoefficientGapThreshold +open FloorAffineError FloorProductError ProductThresholds FloorBudgetComparison + +/-- A scalar margin implies the full powered product test. -/ +theorem passes_of_scalar {C D k b : Nat} + (hc : C*weight b < D*(weight b-k)) : Passes C D k b := by + have hw : 0 < weight b^k := Nat.pow_pos (by unfold weight; omega) + have h1 := Nat.mul_lt_mul_of_pos_right hc hw + have h2 := Nat.mul_le_mul_left D (ratio_comparison b k) + simp only [Nat.mul_assoc,Nat.mul_left_comm,Nat.mul_comm] at h1 h2 + have hh : (C*weight b^k)*weight b < (D*base b^k)*weight b := by + simp only [Nat.mul_left_comm,Nat.mul_comm] + omega + exact Nat.lt_of_mul_lt_mul_right hh + +/-- The required floor weight scales with odd count and reciprocal coefficient gap. -/ +theorem passes_of_gap {C D k b : Nat} (hl : C ≤ D) + (hg : k*D < (D-C)*weight b) : Passes C D k b := by + apply passes_of_scalar + have he : (D-C)*weight b = D*weight b-C*weight b := Nat.sub_mul _ _ _ + have hm : D*(weight b-k) = D*weight b-D*k := Nat.mul_sub _ _ _ + have hc := Nat.mul_le_mul_right (weight b) hl + rw [he] at hg + rw [hm] + have hk : k*D=D*k := Nat.mul_comm _ _ + omega + +/-- Gap-specific scalar source thresholds certify descent, with no individual trace products. -/ +theorem descent_of_gap {n j : Nat} (hn : 0 < n) + (hl : 3^oddCount n j ≤ 2^j) + (hg : oddCount n j*2^j < (2^j-3^oddCount n j)*weight n) : + ∃ i, i ≤ j ∧ acceleratedOrbit i n < n := by + apply FloorProductDescent.descent_before hn + exact passes_of_gap hl hg + +/-- Improve the existing H*3^H cutoff using the first-light accumulator bound. -/ +theorem first_light_below_horizon {H n j : Nat} (hj : j ≤ H) + (hn : H*2^H < 3*n) + (hf : FirstLightDescent.FirstLight n j) : acceleratedOrbit j n < n := by + by_cases hd : acceleratedOrbit j n < n + · exact hd + · have hb := FirstLightDescent.failure_bound hf (by omega) + have ha := Nat.le_trans (AffineExact.oddCount_le_self n j) hj + have hp : 3^oddCount n j ≤ 2^H := Nat.le_trans (Nat.le_of_lt hf.1) + (Nat.pow_le_pow_right (by decide) hj) + have hm := Nat.mul_le_mul ha hp + have hg : 1 ≤ 2^j-3^oddCount n j := by have := hf.1; omega + have hl := Nat.mul_le_mul_left (3*n) hg + simp only [Nat.mul_assoc,Nat.mul_left_comm,Nat.mul_comm] at hl hb + omega + +end Collatz.Exploration.CoefficientGapThreshold diff --git a/Collatz/Exploration/SharpFirstLightEventual.lean b/Collatz/Exploration/SharpFirstLightEventual.lean new file mode 100644 index 00000000..dbffe5c2 --- /dev/null +++ b/Collatz/Exploration/SharpFirstLightEventual.lean @@ -0,0 +1,58 @@ +import Collatz.Exploration.CoefficientGapThreshold +import Collatz.Strategy.FirstLightCounting + +/-! Propagate the sharper finite cutoff to survival and first-stopping periodicity. +The proofs reuse existing residue results; no universal crossing is assumed. -/ +namespace Collatz.Exploration.SharpFirstLightEventual +open CoefficientGapThreshold FirstLightDescent FirstLightConsequences FirstLightCounting + +/-- Any light prefix in the window guarantees a descent for starts above the threshold. -/ +theorem descent_by_light_above_threshold {H n k : Nat} (hk : k≤H) + (hn : H*2^H<3*n) (hl : 3^oddCount n k<2^k) : + ∃ j, j≤k ∧ acceleratedOrbit j n survives H n=true) N := + NaturalDensity.predicateCount_eventual_mono (cutoff H) N + (fun n hn => (actual_iff_periodic_eventually H n hn).mp) + +/-- The reverse bound controls the count discrepancy in both directions. -/ +theorem periodic_count_upper (H N : Nat) : + NaturalDensity.predicateCount (fun n => survives H n=true) N ≤ + cutoff H + NaturalDensity.predicateCount (ActualSurvival H) N := + NaturalDensity.predicateCount_eventual_mono (cutoff H) N + (fun n hn => (actual_iff_periodic_eventually H n hn).mpr) + +/-- Actual finite-horizon survival has an all-cutoff upper bound at every H, +combining a finite exceptional interval and the existing heavy-residue estimate. -/ +theorem actual_count_heavy_bound (H N : Nat) : + NaturalDensity.predicateCount (ActualSurvival H) N ≤ + cutoff H + (N/2^H+1)*Density.heavyCount H := by + have h := actual_count_upper H N + rw [NaturalDensity.predicateCount_bool] at h + exact Nat.le_trans h (Nat.add_le_add_left (survival_count_cutoff_bound H N) _) + +end Collatz.Exploration.SharpSurvivalCounts diff --git a/README.md b/README.md index ad73fa39..ca2ac218 100644 --- a/README.md +++ b/README.md @@ -216,3 +216,39 @@ the thresholds are exact for this test, not optimal for actual descent. Audit: eight theorem footprints, 12,006 threshold checks, 1,893 matching odd-count descent cases, two false controls rejected. The method remains a specialization of known product bounds, with no established frontier novelty. + +### Scalar gap criterion and improved finite first-light cutoff + +`CoefficientGapThreshold.lean` proves that `a D < (D-C) w(n)` suffices +for descent by j when C=3^a≤D=2^j. The scalar margin implies the full +product test by the classical Bernoulli comparison. +A separate corollary uses the existing first-light accumulator bound to +improve the coarse repository cutoff n>H*3^H to 3*n>H*2^H: +if a first coefficient crossing occurs by H, descent occurs at that crossing. +It proves no existence of a crossing and no universal convergence. +No frontier novelty has been established for this elementary improvement. +Audit: four theorem footprints, 53,361 scalar cases, 16,043 valid scalar +certificates, 179,303 descent cases, 2,924 first-light cutoff cases, +and two false controls rejected. + +### Survival classification at the sharper cutoff + +`SharpFirstLightEventual.lean` propagates 3*n>H*2^H to exact finite-horizon +no-descent/heavy-prefix equivalence, first-descent/first-light equivalence, +and first-stopping-time agreement for equal residues modulo 2^H above the +cutoff. It reuses existing residue and accumulator theory and improves the +sufficient source interval; it proves no eventual crossing for every source. +Audit: four theorem footprints, 2,050 paired residue checks through horizon +40, and two false controls rejected. Frontier novelty is not established. + +### Smaller finite survival-count exceptional interval + +`SharpSurvivalCounts.lean` uses natural cutoff `H*2^H/3-1` (truncated +at zero), accounting for shifted sources n+2. Actual survival equals the +periodic coefficient test above this cutoff. Both directions of count +comparison have this additive error, and the actual count is at most this +error plus `(N/2^H+1)*heavyCount H`. This improves the finite exceptional +interval from H*3^H; it neither strengthens the asymptotic density conclusion +nor proves universal crossing. Audit: four theorem footprints, 39,013 count +cutoffs through H=12 and N=3000, and two false rounding controls rejected. +Frontier novelty remains unestablished. diff --git a/RESEARCH.md b/RESEARCH.md index 323945a3..18374c99 100644 --- a/RESEARCH.md +++ b/RESEARCH.md @@ -16058,3 +16058,39 @@ the thresholds are exact for this test, not optimal for actual descent. Audit: eight theorem footprints, 12,006 threshold checks, 1,893 matching odd-count descent cases, two false controls rejected. The method remains a specialization of known product bounds, with no established frontier novelty. + +### Scalar gap criterion and improved finite first-light cutoff + +`CoefficientGapThreshold.lean` proves that `a D < (D-C) w(n)` suffices +for descent by j when C=3^a≤D=2^j. The scalar margin implies the full +product test by the classical Bernoulli comparison. +A separate corollary uses the existing first-light accumulator bound to +improve the coarse repository cutoff n>H*3^H to 3*n>H*2^H: +if a first coefficient crossing occurs by H, descent occurs at that crossing. +It proves no existence of a crossing and no universal convergence. +No frontier novelty has been established for this elementary improvement. +Audit: four theorem footprints, 53,361 scalar cases, 16,043 valid scalar +certificates, 179,303 descent cases, 2,924 first-light cutoff cases, +and two false controls rejected. + +### Survival classification at the sharper cutoff + +`SharpFirstLightEventual.lean` propagates 3*n>H*2^H to exact finite-horizon +no-descent/heavy-prefix equivalence, first-descent/first-light equivalence, +and first-stopping-time agreement for equal residues modulo 2^H above the +cutoff. It reuses existing residue and accumulator theory and improves the +sufficient source interval; it proves no eventual crossing for every source. +Audit: four theorem footprints, 2,050 paired residue checks through horizon +40, and two false controls rejected. Frontier novelty is not established. + +### Smaller finite survival-count exceptional interval + +`SharpSurvivalCounts.lean` uses natural cutoff `H*2^H/3-1` (truncated +at zero), accounting for shifted sources n+2. Actual survival equals the +periodic coefficient test above this cutoff. Both directions of count +comparison have this additive error, and the actual count is at most this +error plus `(N/2^H+1)*heavyCount H`. This improves the finite exceptional +interval from H*3^H; it neither strengthens the asymptotic density conclusion +nor proves universal crossing. Audit: four theorem footprints, 39,013 count +cutoffs through H=12 and N=3000, and two false rounding controls rejected. +Frontier novelty remains unestablished. diff --git a/scripts/audit_coefficient_gap_threshold.py b/scripts/audit_coefficient_gap_threshold.py new file mode 100644 index 00000000..1c85fbee --- /dev/null +++ b/scripts/audit_coefficient_gap_threshold.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 +"""Exact scalar-to-product and conditional descent audit.""" +import subprocess +from audit_barrier_kernel import ROOT,check_axioms,check_false_certificates +from check_proof_escapes import violations + +def main(): + name='Collatz.Exploration.CoefficientGapThreshold' + source=ROOT/'Collatz/Exploration/CoefficientGapThreshold.lean' + assert not violations(source.read_text()) + subprocess.run(['lake','build',name],cwd=ROOT,check=True) + tested=certified=0 + for C in range(11): + for D in range(11): + for k in range(21): + for b in range(21): + v=3*(b+1 if b%2==0 else b);w=v+1 + if C*w=n;heavy &= C>=D + return actual,heavy + +def main(): + name='Collatz.Exploration.SharpSurvivalCounts' + source=ROOT/'Collatz/Exploration/SharpSurvivalCounts.lean' + assert not violations(source.read_text()) + subprocess.run(['lake','build',name],cwd=ROOT,check=True) + checks=0 + for H in range(13): + cutoff=max(H*2**H//3-1,0) + heavy_count=sum(flags(r,H)[1] for r in range(2**H)) + actual=periodic=0 + for N in range(3001): + if N: + a,p=flags(N+1,H);actual+=a;periodic+=p + assert actual<=cutoff+periodic + assert periodic<=cutoff+actual + assert actual<=cutoff+(N//2**H+1)*heavy_count + checks+=1 + for n in range(cutoff,cutoff+20): + assert H*2**H<3*(n+2) + a,p=flags(n+2,H);assert a==p + axioms=check_axioms(source,name) + bad=check_false_certificates(name,[ + 'example : Collatz.Exploration.SharpSurvivalCounts.cutoff 3 = 8 := by decide\n', + 'example : Collatz.Exploration.SharpSurvivalCounts.cutoff 8 = 682 := by decide\n', + ]) + print(f'{checks} count cutoffs; {axioms} theorem footprints; {bad} false rounding controls') + +if __name__=='__main__':main()