Documentation

Mathlib.Algebra.ContinuedFractions.Translations

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 : } :
g.TerminatedAt n g.s.TerminatedAt n
theorem GeneralizedContinuedFraction.terminatedAt_iff_s_none {α : Type u_1} {g : GeneralizedContinuedFraction α} {n : } :
g.TerminatedAt n g.s.get? n = none
theorem GeneralizedContinuedFraction.part_num_none_iff_s_none {α : Type u_1} {g : GeneralizedContinuedFraction α} {n : } :
g.partialNumerators.get? n = none g.s.get? n = none
theorem GeneralizedContinuedFraction.terminatedAt_iff_part_num_none {α : Type u_1} {g : GeneralizedContinuedFraction α} {n : } :
g.TerminatedAt n g.partialNumerators.get? n = none
theorem GeneralizedContinuedFraction.part_denom_none_iff_s_none {α : Type u_1} {g : GeneralizedContinuedFraction α} {n : } :
g.partialDenominators.get? n = none g.s.get? n = none
theorem GeneralizedContinuedFraction.terminatedAt_iff_part_denom_none {α : Type u_1} {g : GeneralizedContinuedFraction α} {n : } :
g.TerminatedAt n g.partialDenominators.get? n = none
theorem GeneralizedContinuedFraction.part_num_eq_s_a {α : Type u_1} {g : GeneralizedContinuedFraction α} {n : } {gp : GeneralizedContinuedFraction.Pair α} (s_nth_eq : g.s.get? n = some gp) :
g.partialNumerators.get? n = some gp.a
theorem GeneralizedContinuedFraction.part_denom_eq_s_b {α : Type u_1} {g : GeneralizedContinuedFraction α} {n : } {gp : GeneralizedContinuedFraction.Pair α} (s_nth_eq : g.s.get? n = some gp) :
g.partialDenominators.get? n = some gp.b
theorem GeneralizedContinuedFraction.exists_s_a_of_part_num {α : Type u_1} {g : GeneralizedContinuedFraction α} {n : } {a : α} (nth_part_num_eq : g.partialNumerators.get? n = some a) :
∃ (gp : GeneralizedContinuedFraction.Pair α), g.s.get? 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 : g.partialDenominators.get? n = some b) :
∃ (gp : GeneralizedContinuedFraction.Pair α), g.s.get? 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] :
g.continuants n = g.continuantsAux (n + 1)
theorem GeneralizedContinuedFraction.num_eq_conts_a {K : Type u_1} {g : GeneralizedContinuedFraction K} {n : } [DivisionRing K] :
g.numerators n = (g.continuants n).a
theorem GeneralizedContinuedFraction.denom_eq_conts_b {K : Type u_1} {g : GeneralizedContinuedFraction K} {n : } [DivisionRing K] :
g.denominators n = (g.continuants n).b
theorem GeneralizedContinuedFraction.convergent_eq_num_div_denom {K : Type u_1} {g : GeneralizedContinuedFraction K} {n : } [DivisionRing K] :
g.convergents n = g.numerators n / g.denominators n
theorem GeneralizedContinuedFraction.convergent_eq_conts_a_div_conts_b {K : Type u_1} {g : GeneralizedContinuedFraction K} {n : } [DivisionRing K] :
g.convergents n = (g.continuants n).a / (g.continuants n).b
theorem GeneralizedContinuedFraction.exists_conts_a_of_num {K : Type u_1} {g : GeneralizedContinuedFraction K} {n : } [DivisionRing K] {A : K} (nth_num_eq : g.numerators n = A) :
∃ (conts : GeneralizedContinuedFraction.Pair K), g.continuants 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 : g.denominators n = B) :
∃ (conts : GeneralizedContinuedFraction.Pair K), g.continuants n = conts conts.b = B
@[simp]
theorem GeneralizedContinuedFraction.zeroth_continuant_aux_eq_one_zero {K : Type u_1} {g : GeneralizedContinuedFraction K} [DivisionRing K] :
g.continuantsAux 0 = { a := 1, b := 0 }
@[simp]
theorem GeneralizedContinuedFraction.first_continuant_aux_eq_h_one {K : Type u_1} {g : GeneralizedContinuedFraction K} [DivisionRing K] :
g.continuantsAux 1 = { a := g.h, b := 1 }
@[simp]
theorem GeneralizedContinuedFraction.zeroth_continuant_eq_h_one {K : Type u_1} {g : GeneralizedContinuedFraction K} [DivisionRing K] :
g.continuants 0 = { a := g.h, b := 1 }
theorem GeneralizedContinuedFraction.second_continuant_aux_eq {K : Type u_1} {g : GeneralizedContinuedFraction K} [DivisionRing K] {gp : GeneralizedContinuedFraction.Pair K} (zeroth_s_eq : g.s.get? 0 = some gp) :
g.continuantsAux 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 : g.s.get? 0 = some gp) :
g.continuants 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 : g.s.get? 0 = some gp) :
g.numerators 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 : g.s.get? 0 = some gp) :
g.denominators 1 = gp.b