Lean / Reader
Lean readerHarmonicStatement.lean
Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports HarmonicRatio, FibonacciHarmonic, which it does not have: you can read it there, but it will not check. Build the project itself to check it.
import HarmonicRatioimport FibonacciHarmonicopen Filteropen scoped Topology goldenRationamespace HarmonicGroups/-- The length of the nth group, with the first group indexed by 1 as inthe OEIS entry. Index 0 has the harmless value zero. -/noncomputable def groupLength (R : ℝ) (hR : 0 < R) (n : ℕ) : ℕ :=greedy R hR n - greedy R hR (n-1)theorem groupLength_ratio {R : ℝ} (hR : 0 < R) :Tendsto (fun n : ℕ => (groupLength R hR (n+2) : ℝ) / groupLength R hR (n+1))atTop (𝓝 (Real.exp R)) := bysimpa [groupLength] using ratio_tendsto hR (greedy_spec R hR)private theorem golden_valid :IsGreedy (Real.log φ) (fun n => Nat.fib (n+2) - 1) wherestart := by decidestrict := byapply strictMono_nat_of_lt_succintro nhave h := Nat.fib_add_two_strictMono (Nat.lt_succ_self n)have hpos : 0 < Nat.fib (n+2) := Nat.fib_pos.mpr (by omega)dsimp at homegareached n := (golden_fib_threshold (n+2) (by omega)).1before n := (golden_fib_threshold (n+2) (by omega)).2theorem golden_endpoints (n : ℕ) :greedy (Real.log φ) (Real.log_pos Real.one_lt_goldenRatio) n = Nat.fib (n+2) - 1 :=congrFun (greedy_unique golden_valid).symm ntheorem golden_groupLength (n : ℕ) :groupLength (Real.log φ) (Real.log_pos Real.one_lt_goldenRatio) n = Nat.fib n := bycases n with| zero => simp [groupLength]| succ n =>simp only [groupLength, Nat.add_one_sub_one, golden_endpoints]have sum : Nat.fib ((n+1)+2) = Nat.fib (n+1) + Nat.fib (n+2) := Nat.fib_add_twohave hpos : 0 < Nat.fib (n+2) := Nat.fib_pos.mpr (by omega)omega/-- Both conjectures stated in OEIS A245800. -/theorem A245800 :(∀ (R : ℝ) (hR : 0 < R),Tendsto (fun n : ℕ => (groupLength R hR (n+2) : ℝ) / groupLength R hR (n+1))atTop (𝓝 (Real.exp R))) ∧(∀ n : ℕ, groupLength (Real.log φ) (Real.log_pos Real.one_lt_goldenRatio) n = Nat.fib n) :=⟨fun _ hR => groupLength_ratio hR, golden_groupLength⟩#print axioms A245800end HarmonicGroups