Basic Translation Lemmas Between Functions Defined for Continued Fractions #
Summary #
Some simple translation lemmas between the different definitions of functions defined in
Algebra.ContinuedFractions.Basic
.
Translations Between General Access Functions #
Here we give some basic translations that hold by definition between the various methods that allow us to access the numerators and denominators of a continued fraction.
theorem
GeneralizedContinuedFraction.terminatedAt_iff_s_terminatedAt
{α : Type u_1}
{g : GeneralizedContinuedFraction α}
{n : ℕ}
:
theorem
GeneralizedContinuedFraction.terminatedAt_iff_s_none
{α : Type u_1}
{g : GeneralizedContinuedFraction α}
{n : ℕ}
:
GeneralizedContinuedFraction.TerminatedAt g n ↔ Stream'.Seq.get? g.s n = none
theorem
GeneralizedContinuedFraction.part_num_none_iff_s_none
{α : Type u_1}
{g : GeneralizedContinuedFraction α}
{n : ℕ}
:
Stream'.Seq.get? (GeneralizedContinuedFraction.partialNumerators g) n = none ↔ Stream'.Seq.get? g.s n = none
theorem
GeneralizedContinuedFraction.terminatedAt_iff_part_num_none
{α : Type u_1}
{g : GeneralizedContinuedFraction α}
{n : ℕ}
:
theorem
GeneralizedContinuedFraction.part_denom_none_iff_s_none
{α : Type u_1}
{g : GeneralizedContinuedFraction α}
{n : ℕ}
:
Stream'.Seq.get? (GeneralizedContinuedFraction.partialDenominators g) n = none ↔ Stream'.Seq.get? g.s n = none
theorem
GeneralizedContinuedFraction.terminatedAt_iff_part_denom_none
{α : Type u_1}
{g : GeneralizedContinuedFraction α}
{n : ℕ}
:
theorem
GeneralizedContinuedFraction.part_num_eq_s_a
{α : Type u_1}
{g : GeneralizedContinuedFraction α}
{n : ℕ}
{gp : GeneralizedContinuedFraction.Pair α}
(s_nth_eq : Stream'.Seq.get? g.s n = some gp)
:
theorem
GeneralizedContinuedFraction.part_denom_eq_s_b
{α : Type u_1}
{g : GeneralizedContinuedFraction α}
{n : ℕ}
{gp : GeneralizedContinuedFraction.Pair α}
(s_nth_eq : Stream'.Seq.get? g.s n = some gp)
:
theorem
GeneralizedContinuedFraction.exists_s_a_of_part_num
{α : Type u_1}
{g : GeneralizedContinuedFraction α}
{n : ℕ}
{a : α}
(nth_part_num_eq : Stream'.Seq.get? (GeneralizedContinuedFraction.partialNumerators g) n = some a)
:
∃ (gp : GeneralizedContinuedFraction.Pair α), Stream'.Seq.get? g.s n = some gp ∧ gp.a = a
theorem
GeneralizedContinuedFraction.exists_s_b_of_part_denom
{α : Type u_1}
{g : GeneralizedContinuedFraction α}
{n : ℕ}
{b : α}
(nth_part_denom_eq : Stream'.Seq.get? (GeneralizedContinuedFraction.partialDenominators g) n = some b)
:
∃ (gp : GeneralizedContinuedFraction.Pair α), Stream'.Seq.get? g.s n = some gp ∧ gp.b = b
Translations Between Computational Functions #
Here we give some basic translations that hold by definition for the computational methods of a continued fraction.
theorem
GeneralizedContinuedFraction.nth_cont_eq_succ_nth_cont_aux
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
{n : ℕ}
[DivisionRing K]
:
theorem
GeneralizedContinuedFraction.num_eq_conts_a
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
{n : ℕ}
[DivisionRing K]
:
theorem
GeneralizedContinuedFraction.denom_eq_conts_b
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
{n : ℕ}
[DivisionRing K]
:
theorem
GeneralizedContinuedFraction.convergent_eq_num_div_denom
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
{n : ℕ}
[DivisionRing K]
:
theorem
GeneralizedContinuedFraction.convergent_eq_conts_a_div_conts_b
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
{n : ℕ}
[DivisionRing K]
:
theorem
GeneralizedContinuedFraction.exists_conts_a_of_num
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
{n : ℕ}
[DivisionRing K]
{A : K}
(nth_num_eq : GeneralizedContinuedFraction.numerators g n = A)
:
∃ (conts : GeneralizedContinuedFraction.Pair K), GeneralizedContinuedFraction.continuants g n = conts ∧ conts.a = A
theorem
GeneralizedContinuedFraction.exists_conts_b_of_denom
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
{n : ℕ}
[DivisionRing K]
{B : K}
(nth_denom_eq : GeneralizedContinuedFraction.denominators g n = B)
:
∃ (conts : GeneralizedContinuedFraction.Pair K), GeneralizedContinuedFraction.continuants g n = conts ∧ conts.b = B
@[simp]
theorem
GeneralizedContinuedFraction.zeroth_continuant_aux_eq_one_zero
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
[DivisionRing K]
:
GeneralizedContinuedFraction.continuantsAux g 0 = { a := 1, b := 0 }
@[simp]
theorem
GeneralizedContinuedFraction.first_continuant_aux_eq_h_one
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
[DivisionRing K]
:
GeneralizedContinuedFraction.continuantsAux g 1 = { a := g.h, b := 1 }
@[simp]
theorem
GeneralizedContinuedFraction.zeroth_continuant_eq_h_one
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
[DivisionRing K]
:
GeneralizedContinuedFraction.continuants g 0 = { a := g.h, b := 1 }
@[simp]
theorem
GeneralizedContinuedFraction.zeroth_numerator_eq_h
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
[DivisionRing K]
:
@[simp]
theorem
GeneralizedContinuedFraction.zeroth_denominator_eq_one
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
[DivisionRing K]
:
@[simp]
theorem
GeneralizedContinuedFraction.zeroth_convergent_eq_h
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
[DivisionRing K]
:
theorem
GeneralizedContinuedFraction.second_continuant_aux_eq
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
[DivisionRing K]
{gp : GeneralizedContinuedFraction.Pair K}
(zeroth_s_eq : Stream'.Seq.get? g.s 0 = some gp)
:
GeneralizedContinuedFraction.continuantsAux g 2 = { a := gp.b * g.h + gp.a, b := gp.b }
theorem
GeneralizedContinuedFraction.first_continuant_eq
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
[DivisionRing K]
{gp : GeneralizedContinuedFraction.Pair K}
(zeroth_s_eq : Stream'.Seq.get? g.s 0 = some gp)
:
GeneralizedContinuedFraction.continuants g 1 = { a := gp.b * g.h + gp.a, b := gp.b }
theorem
GeneralizedContinuedFraction.first_numerator_eq
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
[DivisionRing K]
{gp : GeneralizedContinuedFraction.Pair K}
(zeroth_s_eq : Stream'.Seq.get? g.s 0 = some gp)
:
GeneralizedContinuedFraction.numerators g 1 = gp.b * g.h + gp.a
theorem
GeneralizedContinuedFraction.first_denominator_eq
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
[DivisionRing K]
{gp : GeneralizedContinuedFraction.Pair K}
(zeroth_s_eq : Stream'.Seq.get? g.s 0 = some gp)
:
@[simp]
theorem
GeneralizedContinuedFraction.zeroth_convergent'_aux_eq_zero
{K : Type u_1}
[DivisionRing K]
{s : Stream'.Seq (GeneralizedContinuedFraction.Pair K)}
:
@[simp]
theorem
GeneralizedContinuedFraction.zeroth_convergent'_eq_h
{K : Type u_1}
{g : GeneralizedContinuedFraction K}
[DivisionRing K]
:
theorem
GeneralizedContinuedFraction.convergents'Aux_succ_none
{K : Type u_1}
[DivisionRing K]
{s : Stream'.Seq (GeneralizedContinuedFraction.Pair K)}
(h : Stream'.Seq.head s = none)
(n : ℕ)
:
GeneralizedContinuedFraction.convergents'Aux s (n + 1) = 0
theorem
GeneralizedContinuedFraction.convergents'Aux_succ_some
{K : Type u_1}
[DivisionRing K]
{s : Stream'.Seq (GeneralizedContinuedFraction.Pair K)}
{p : GeneralizedContinuedFraction.Pair K}
(h : Stream'.Seq.head s = some p)
(n : ℕ)
:
GeneralizedContinuedFraction.convergents'Aux s (n + 1) = p.a / (p.b + GeneralizedContinuedFraction.convergents'Aux (Stream'.Seq.tail s) n)