FormalConjectures/Wikipedia/CollatzConjecture.lean

GitHub source file

Explanation legend Lean4 Domain Explanation Language (L4DEL)

L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.

L4DEL
Lean4 Domain Explanation Language

Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.

Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1

2 declarations, 1 contain sorry, 0 declared as axioms

Collatz conjecture

References:

Imports (1)
Imported by 1 file
  1. def CollatzConjecture.collatzStep One step of the Collatz map line 43 source

    Source documentation

    Consider the following operation on the natural numbers: If the number is even, divide it by two. If the number is odd, triple it and add one.

    L4DEL explanation

    Halve an even number, and triple an odd number then add one.

    1. If n is even the result is n / 2 (natural-number division).
    2. Otherwise the result is 3 * n + 1.

    Sources and attribution: Pinned Lean source (1646ca16afd6)

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat

    Proof uses: ite, Even, HDiv.hDiv, OfNat.ofNat, HAdd.hAdd, HMul.hMul

    8 instances, coercions and auxiliary constants left out.

    def collatzStep (n : ℕ) : ℕ :=
    …
  2. theorem CollatzConjecture.collatz_conjecture The Collatz conjecture sorry line 53 source

    Source documentation

    Now form a sequence beginning with any positive integer, where each subsequent term is obtained by applying the operation defined above to the previous term. The Collatz conjecture states that for any positive integer $n$, there exists a natural number $m$ such that the $m$-th term of the sequence is 1.

    L4DEL explanation

    Starting from any positive integer and repeating the Collatz step, you eventually reach 1; the file marks this as open.

    1. The attribute reads category research open, so the proof body is sorry.
    2. The statement quantifies over every n greater than 0 and asserts some m with collatzStep iterated m times on n equal to 1.

    Prerequisites: CollatzConjecture.collatzStep

    Sources and attribution: Pinned Lean source (1646ca16afd6)

    depends on sorry what this means

    Statement uses: Nat, GT.gt, OfNat.ofNat, Exists, Eq, Nat.iterate, CollatzConjecture.collatzStep

    Proof uses: sorryAx, Lean.Name, Bool.false, Lean.Name.num, Lean.Name.str, Lean.Name.anonymous

    4 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

    theorem collatz_conjecture (n : ℕ) (hn : n > 0) : ∃ m, collatzStep^[m] n = 1 := by
    …

    Mentions: CollatzConjecture.collatzStep