English
The head of the head sequence for (of v) is given by the bound: the first head equals the bind of Some with a constructed pair depending on the head of IntFractPair.stream v 1.
Русский
Головной элемент головы последовательности для (of v) задаётся через приведение и head IntFractPair.stream v 1.
LaTeX
$$$\text{(of v)}.s.get? 0 = (\operatorname{IntFractPair}.stream(v,1)).bind(\mathrm{Some}\circ(\lambda p -> \{a := 1, b := p.b\}))$$$
Lean4
/-- This gives the first pair of coefficients of the continued fraction of a non-integer `v`.
-/
theorem of_s_head (h : fract v ≠ 0) : (of v).s.head = some ⟨1, ⌊(fract v)⁻¹⌋⟩ :=
by
change (of v).s.get? 0 = _
rw [of_s_head_aux, stream_succ_of_some (stream_zero v) h, Option.bind]
rfl