Aether Catalog definitions — Speculative_BerggrenTrees_BerggrenPellComplete
DefinitionSpeculative_BerggrenTrees_BerggrenPellCompleteaether-catalogspeculative
Definition bundle for the Aether Catalog module Speculative.BerggrenTrees.BerggrenPellComplete, transplanted by skeleton subtraction; supplies the types and constants the catalog's theorems import.
Definition code
-- Def bundle generated from Speculative/BerggrenTrees/BerggrenPellComplete.lean by skeleton subtraction
import Mathlib
/-! # CatalogBuild.Speculative.BerggrenPellComplete
Auto-generated from theorem catalog database.
Domain: Speculative
Declarations: 40
-/
/-- Berggren matrix B₂ -/
def B2 : Matrix (Fin 3) (Fin 3) ℤ := !![1, 2, 2; 2, 1, 2; 2, 2, 3]
/-- Iteratively apply B₂ starting from (3,4,5) -/
def B2iter : ℕ → ℤ × ℤ × ℤ
| 0 => (3, 4, 5)
| n + 1 =>
let prev := B2iter n
(prev.1 + 2 * prev.2.1 + 2 * prev.2.2,
2 * prev.1 + prev.2.1 + 2 * prev.2.2,
2 * prev.1 + 2 * prev.2.1 + 3 * prev.2.2)
/-- Extract hypotenuse -/
def B2hyp (n : ℕ) : ℤ := (B2iter n).2.2
/-- The Pell numbers P_n satisfy x² - 2y² = 1 -/
def pellSeq : ℕ → ℤ × ℤ
| 0 => (1, 0)
| n + 1 => (3 * (pellSeq n).1 + 4 * (pellSeq n).2,
2 * (pellSeq n).1 + 3 * (pellSeq n).2)
-- Verify Pell equation x² - 2y² = 1