Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
E626 GitHub - shuanat/collatz-lean4: Lean 4 formalization of ord_{2^t}(3) = 2^{t-2} and supporting lemmas for Collatz analysis
Nothing Special   »   [go: up one dir, main page]

Skip to content

shuanat/collatz-lean4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Collatz Conjecture β€” Lean 4 Formalization

Formal verification of critical theorems for the epoch-based deterministic framework presented in the Collatz conjecture paper.

πŸ“Š Overview

This repository contains Lean 4 formalizations of key mathematical results related to the Collatz conjecture (3x+1 problem). The formalization focuses on three core components:

  1. Ord‑Fact: Multiplicative order of 3 modulo powers of 2
  2. Semigroup βŸ¨Ξ”βŸ©: Junction shift generation of cyclic groups
  3. SEDT: Scaled Epoch Drift Theorem (negative drift envelope)

🎯 Formalized Theorems

Theorem File Status Description
Ord‑Fact Collatz/OrdFact.lean βœ… Proven ord_{2^t}(3) = 2^{t-2} for t β‰₯ 3
βŸ¨Ξ”βŸ© generates Z/Q_t Z Collatz/Semigroup.lean βœ… Proven Junction shifts additively generate full group
SEDT envelope Collatz/SEDT.lean βœ… Statement formalized Negative drift Ξ”V ≀ -Ρ·L + Ξ²Β·C for long epochs

Formalization Status Legend

  • βœ… Proven: No sorry placeholders, all steps verified
  • 🟑 Structured: Logical structure complete, some steps documented as sorry
  • πŸ“ Statement only: Theorem formalized, proof deferred as future work

πŸ—οΈ Project Structure

collatz-lean4/
β”œβ”€β”€ Collatz/
β”‚   β”œβ”€β”€ Basic.lean              # Core Collatz definitions (T_odd, e, depth_minus)
β”‚   β”œβ”€β”€ Arithmetic.lean         # Foundational arithmetic lemmas (20/23 proven)
β”‚   β”œβ”€β”€ OrdFact.lean            # Ord‑Fact theorem + examples t=3,4,5 (proven!)
β”‚   β”œβ”€β”€ Epoch.lean              # Epoch and Phase type definitions
β”‚   β”œβ”€β”€ Semigroup.lean          # Junction shift semigroup βŸ¨Ξ”βŸ©
β”‚   β”œβ”€β”€ SEDT.lean               # SEDT envelope theorem
β”‚   └── Examples.lean           # Worked examples (15 examples)
β”‚
β”œβ”€β”€ lakefile.lean               # Lake build configuration
β”œβ”€β”€ lean-toolchain              # Lean version (v4.24.0-rc1)
└── README.md                   # This file

πŸš€ Quick Start

Prerequisites

  • Lean 4 (v4.24.0-rc1 or later)
  • elan (Lean version manager)

Building

# Clone the repository
git clone <repository-url>
cd collatz-lean4

# Build the project
lake build

# Build examples module (optional)
lake build Collatz.Examples

If everything is configured, lake build should complete successfully.

πŸ“š Key Results

1. Ord‑Fact (Multiplicative Order)

Theorem (OrdFact.lean):
For t β‰₯ 3, the multiplicative order of 3 modulo 2^t equals 2^{t-2}.

theorem ord_three_mod_pow_two (t : β„•) (ht : t β‰₯ 3) :
  orderOf (3 : ZMod (2^t)) = Q_t t

Examples (all proven with decide):

example : orderOf (3 : ZMod 8) = 2 := by decide   -- t=3 βœ…
example : orderOf (3 : ZMod 16) = 4 := by decide  -- t=4 βœ…
example : orderOf (3 : ZMod 32) = 8 := by decide  -- t=5 βœ…

Proof Strategy:

  1. Upper bound: 3^{2^{t-2}} ≑ 1 (mod 2^t) via induction + lifting lemma
  2. Lower bound: Minimality via 2-adic valuation
  3. Main theorem: Combine using orderOf_dvd_iff + Nat.dvd_prime_pow

2. Semigroup βŸ¨Ξ”βŸ© Generation

Theorem (Semigroup.lean):
The additive subgroup generated by junction shifts equals Z/Q_t Z.

theorem delta_generates {t : β„•} (ht : t β‰₯ 3) :
  AddSubgroup.closure (@DeltaSet t) = ⊀

Proof Strategy:

  1. DeltaSet contains 1 (trivial junction)
  2. 1 is odd β†’ primitive generator of Z/Q_t Z
  3. ⟨1⟩ = Z/Q_t Z βŠ† ⟨DeltaSet⟩ β†’ ⟨DeltaSet⟩ = Z/Q_t Z

3. SEDT Envelope Theorem

Theorem (SEDT.lean):
For long t-epochs (L β‰₯ Lβ‚€) with Ξ² > Ξ²β‚€(t,U):
Ξ”V ≀ -Ξ΅(t,U;Ξ²)Β·L + Ξ²Β·C(t,U), where Ξ΅ > 0

theorem sedt_envelope (t U : β„•) (e : SEDTEpoch) (Ξ² : ℝ)
  (ht : t β‰₯ 3) (hU : U β‰₯ 1) (hΞ² : Ξ² > Ξ²β‚€ t U) (h_long : e.length β‰₯ Lβ‚€ t U) :
  βˆƒ (Ξ”V : ℝ), Ξ”V ≀ -(Ξ΅ t U Ξ²) * (e.length : ℝ) + Ξ² * (C t U : ℝ) ∧ Ξ”V < 0

Constants defined:

  • Ξ±(t,U): Touch frequency parameter
  • Ξ²β‚€(t,U): Threshold for Ξ²
  • Ξ΅(t,U;Ξ²): Negative drift coefficient (Ξ²(2-Ξ±) - logβ‚‚(3/2))
  • C(t,U), Lβ‚€(t,U), K_glue(t): Overhead bounds

πŸ”§ Development

Running Specific Files

# Build a specific module
lake build Collatz.OrdFact

# Check a file for errors
lake env lean Collatz/Arithmetic.lean

sorry Status

  • Collatz/Arithmetic.lean: 0 sorry (complete)
  • Collatz/OrdFact.lean: 0 sorry (complete; main theorem proven)
  • Collatz/Semigroup.lean: 0 sorry (complete; junction shift generation proven)
  • Collatz/SEDT.lean: may contain remaining sorry items marked for future work

CI/CD

GitHub Actions automatically:

  • βœ… Builds the project on push/PR
  • βœ… Caches Lake dependencies
  • βœ… Runs examples
  • βœ… Generates build summaries

See .github/workflows/lean.yml for details.

πŸ“– References

Paper

See ../collatz-paper/ for the main mathematical paper and computational verification scripts.

Key Mappings

Lean Theorem Paper Reference
ord_three_mod_pow_two Lemma A.LOG.1 (Ord‑Fact)
delta_generates Theorem A.HMix(t) + A.MIX.4
sedt_envelope Theorem A.E4 (SEDT)

Dependencies

  • Lean 4: v4.24.0-rc1 or later
  • mathlib4: latest (resolved by Lake)

🀝 Contributing

Adding New Formalization

  1. Create a new .lean file in Collatz/
  2. Import required modules
  3. Add to Collatz.lean (main file)
  4. Build and test: lake build

Completing sorry Proofs

Priority areas for contributions:

  1. SEDT.lean: strengthening envelope bounds and completing deferred steps

πŸ“Š Status Snapshot

  • Ord‑Fact main theorem: proven
  • Semigroup generation: proven
  • Arithmetic lemmas: complete
  • CI: builds on push/PR via GitHub Actions

🎯 Future Work

Short-term

  • Complete SEDT envelope proof (~5-10 hours)
  • Add more worked examples for SEDT

Long-term

  • Full SEDT proof (multi-step induction)
  • Cycle exclusion formalization (Appendix B)
  • Coercivity proof (Appendix C)
  • Integration with computational verification results

πŸ“ License

MIT β€” see LICENSE.

πŸ™ Acknowledgments

  • Lean 4 community for mathlib and excellent documentation
  • Expert consultations on orderOf patterns and modular arithmetic
  • Paper reviewers for suggesting formal verification

Build Status: Lean 4 CI

Last Updated: October 2025
Maintainer: Anatolii Shumak
Paper: See ../collatz-paper/ for mathematical details

About

Lean 4 formalization of ord_{2^t}(3) = 2^{t-2} and supporting lemmas for Collatz analysis

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0