Skip to content

C9.4: Catalog +1 injection boundary effects and prove O(1/n) decorrelation bias bound#27

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/analyze-boundary-effects
Draft

C9.4: Catalog +1 injection boundary effects and prove O(1/n) decorrelation bias bound#27
Copilot wants to merge 2 commits into
mainfrom
copilot/analyze-boundary-effects

Conversation

Copilot AI commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

The decorrelation lemma's validity near window boundaries and in the small-n regime was unverified — specifically, whether the "+1" in 3n+1 introduces systematic bias. This adds the analysis infrastructure to answer that question rigorously.

New: scripts/collatz_c9_4_boundary.py

Core analysis module establishing:

  • +1 injection bias Δ(n) = 1/(3n+1) for odd n — the fractional contribution of the additive correction to T(n)
  • O(1/n) bound (proven + computationally verified for n ∈ [1, 1024]):
    Δ(n) · n = n/(3n+1)  <  1/3  for all odd n
    
  • Per-window average bound: avg Δ(n) ≤ 1/(3·n_min + 1) — ratio always ≤ 1, verified via average_bias_in_window()
  • Small-n catalog: 6/32 odd values in [1, 64] exit the window (18.75%), all at n ≡ 3 (mod 4) with v₂(3n+1) = 1 where T(n) ≈ 3n/2
  • Boundary window detection (identify_boundary_windows) and exclusion-aware bias estimation (decorrelation_bias_estimate): excluding the low-n boundary raises n_min, reducing avg_bias
from scripts.collatz_c9_4_boundary import decorrelation_bias_estimate, catalog_small_n_exceptions

# Show bias drops after excluding boundary windows
full = decorrelation_bias_estimate(1, 1024, exclude_boundary_windows=False)
excl = decorrelation_bias_estimate(1, 1024, exclude_boundary_windows=True, window_size=32)
# excl['avg_bias'] < full['avg_bias'], excl['n_min'] > full['n_min']

# Enumerate small-n exceptions
rows = catalog_small_n_exceptions(64)  # exit_dir in {'none','above','below'}

New: docs/analysis_ns/c9_4_boundary_analysis.md

Documents definitions, the full small-n table, both propositions (per-step and per-window O(1/n)), and a checklist for invoking the decorrelation lemma safely — including when to apply uniform vs. adaptive boundary exclusion.

New: scripts/tests/test_c9_4_boundary.py

43 unit tests covering all public functions, including edge cases (n=0, empty windows, exact known values of T(n)).

Copilot AI changed the title [WIP] Analyze and document boundary effects from +1 injections C9.4: Catalog +1 injection boundary effects and prove O(1/n) decorrelation bias bound Apr 3, 2026
Copilot AI requested a review from TOTOGT April 3, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C9.4 — Control boundary perturbations from +1 injections and small‑n edge cases

2 participants