💎 Reusable layer
← all 82R0066

Flynn-Connolly's theorem

showcase

Use this theorem

  1. Create a project

    Shell
    lake +leanprover/lean4:v4.35.0 new myproject std.toml
    cd myproject

    Standard template, not math: the math template adds its own Mathlib requirement pinned to the Lean release tag, not to the Mathlib commit this package is built and tested with, so you would get a second, different Mathlib. Mathlib comes in through this package. Skip this step in an existing project with the same Lean and Mathlib.

  2. Add the dependency to lakefile.toml

    TOML
    [[require]]
    name = "formalizations"
    git = "https://github.com/karlesmarin/formalizations"
    rev = "v0.15.0"
  3. Import the minimal module

    Lean 4
    import Formalizations.Reusable.NumberTheory

    In a file of the project, e.g. Example.lean.

  4. Paste the example

    Lean 4
    open Formalizations.Reusable
    
    /-- The odd indices which divide their associated Fibonacci sums form an infinite set. -/
    example : {k : ℕ | Odd k ∧ k ∣ (∑ i ∈ Finset.Icc 1 k, Nat.fib i)}.Infinite :=
      flynn_connolly.2

    Steps 3 and 4 together are a complete Lean file:FormalizationsTest/ReusableNumberTheoryExample.lean at v0.15.0, compiled by the CI.

  5. Fetch and check

    Shell
    lake update
    lake lean Example.lean

    lake update fetches this package and Mathlib, and Mathlib's update hook downloads the compiled Mathlib (lake exe cache get). lake lean Example.lean builds the imports of the file (steps 3 and 4) and checks it. If the file belongs to a lean_lib of your project, lake build <lib> does the same. Avoid a bare lake build in a project from the standard template: its default target is the executable, whose link compiles every imported Mathlib module to native code. Same versions required: Lean v4.35.0, Mathlib f0b4c81.

Alternative: import Formalizations.Reusable imports the whole layer (all areas).

Infinitely many odd k divide the sum F₁ + ⋯ + Fₖ. For odd primes p ≡ 2 modulo 3 and p ≡ ±2 modulo 5, both k = F_(2p) and k = F_(4p) are odd and satisfy F_(k+2) ≡ 1 modulo k.

Lean statement

Lean 4
theorem flynn_connolly :
    (∀ p n : ℕ, p.Prime → p % 2 = 1 → p % 3 = 2 → (p % 5 = 2 ∨ p % 5 = 3) →
      (n = 2 * p ∨ n = 4 * p) →
      Nat.fib n % 2 = 1 ∧ Nat.fib (Nat.fib n + 2) % Nat.fib n = 1) ∧
    {k : ℕ | Odd k ∧ k ∣ (∑ i ∈ Finset.Icc 1 k, Nat.fib i)}.Infinite
Name
Formalizations.Reusable.flynn_connolly
Import
import Formalizations.Reusable.NumberTheory
Version
formalizations 0.15.0Lean v4.35.0Mathlib f0b4c81
Role
showcase a classical theorem, to consult
Provenance
FibonacciSumDivisibility.flynn_connolly in Formalizations.NumberTheory.Fibonacci.SumDivisibility
Paper: none by the archive author
Classical reference
O. Flynn-Connolly, On the divisibility of sums of Fibonacci numbers, INTEGERS 25 (2025), A87, Theorem 2 and Corollary 2; arXiv:2504.09938v3
Trust
standard axioms only propext, Classical.choice, Quot.sound
#print axioms in FormalizationsTest/Axioms.lean, audited by scripts/check_axioms.sh (2758 results), which the CI build workflow runs and passed at this commit.
Status
reusable not an upstream candidate
Area
Number Theory

Links

Lean docstring

Flynn-Connolly's theorem. For each odd prime p with p ≡ 2 (mod 3) and p ≡ ±2 (mod 5), both F_(2p) and F_(4p) are odd and satisfy F_(k+2) ≡ 1 (mod k) when substituted for k. Infinitely many odd k divide F₁ + ⋯ + Fₖ.

  • Archive: FibonacciSumDivisibility.flynn_connolly (Formalizations.NumberTheory.Fibonacci.SumDivisibility).
  • Reference: O. Flynn-Connolly, On the divisibility of sums of Fibonacci numbers, INTEGERS 25 (2025), A87, Theorem 2 and Corollary 2.

Upstream

A specific theorem about Fibonacci sums with an explicit prime-index construction and an infinitude conclusion.

Depends on, in this repository

Formalizations.NumberTheory.Fibonacci.Pisano, Formalizations.NumberTheory.Fibonacci.FibLegendre