The areas / V06. Rings, fields and ordered algebra
Mathlib.Algebra.ContinuedFractions.Translations
38 declarations. Mathlib docs · Source
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.
Translations Between Computational Functions
Here we give some basic translations that hold by definition for the computational methods of a continued fraction.
theorem GenContFract.contsAux.match_1.congr_eq_1 E1 #
∀ {K : Type u_1} (motive : Option (GenContFract.Pair K) → Sort u_2) (x : Option (GenContFract.Pair K))
(h_1 : Unit → motive none) (h_2 : (gp : GenContFract.Pair K) → motive (some gp)),
x = none →
(match x with
| none => h_1 ()
| some gp => h_2 gp) ≍
h_1 ()
theorem GenContFract.contsAux.match_1.congr_eq_2 E1 #
∀ {K : Type u_1} (motive : Option (GenContFract.Pair K) → Sort u_2) (x : Option (GenContFract.Pair K))
(h_1 : Unit → motive none) (h_2 : (gp : GenContFract.Pair K) → motive (some gp)) (gp : GenContFract.Pair K),
x = some gp →
(match x with
| none => h_1 ()
| some gp => h_2 gp) ≍
h_2 gp
theorem GenContFract.contsAux.match_3.congr_eq_1 E1 #
∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : Unit → motive 1) (h_3 : (n : ℕ) → motive n.succ.succ),
x = 0 →
(match x with
| 0 => h_1 ()
| 1 => h_2 ()
| n.succ.succ => h_3 n) ≍
h_1 ()
theorem GenContFract.convs'Aux.match_1.congr_eq_2 E1 #
∀ {K : Type u_1} (motive : Stream'.Seq (GenContFract.Pair K) → ℕ → Sort u_2) (x : Stream'.Seq (GenContFract.Pair K))
(x_1 : ℕ) (h_1 : (x : Stream'.Seq (GenContFract.Pair K)) → motive x 0)
(h_2 : (s : Stream'.Seq (GenContFract.Pair K)) → (n : ℕ) → motive s n.succ) (s : Stream'.Seq (GenContFract.Pair K))
(n : ℕ),
x = s →
x_1 = n.succ →
(match x, x_1 with
| x, 0 => h_1 x
| s, n.succ => h_2 s n) ≍
h_2 s n
theorem GenContFract.convs'Aux.match_1.congr_eq_1 E1 #
∀ {K : Type u_1} (motive : Stream'.Seq (GenContFract.Pair K) → ℕ → Sort u_2) (x : Stream'.Seq (GenContFract.Pair K))
(x_1 : ℕ) (h_1 : (x : Stream'.Seq (GenContFract.Pair K)) → motive x 0)
(h_2 : (s : Stream'.Seq (GenContFract.Pair K)) → (n : ℕ) → motive s n.succ) (x_2 : Stream'.Seq (GenContFract.Pair K)),
x = x_2 →
x_1 = 0 →
(match x, x_1 with
| x, 0 => h_1 x
| s, n.succ => h_2 s n) ≍
h_1 x_2
theorem GenContFract.contsAux.match_3.congr_eq_3 E1 #
∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : Unit → motive 1) (h_3 : (n : ℕ) → motive n.succ.succ)
(n : ℕ),
x = n.succ.succ →
(match x with
| 0 => h_1 ()
| 1 => h_2 ()
| n.succ.succ => h_3 n) ≍
h_3 n
theorem GenContFract.contsAux.match_3.congr_eq_2 E1 #
∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : Unit → motive 1) (h_3 : (n : ℕ) → motive n.succ.succ),
x = 1 →
(match x with
| 0 => h_1 ()
| 1 => h_2 ()
| n.succ.succ => h_3 n) ≍
h_2 ()
theorem GenContFract.terminatedAt_iff_s_terminatedAt E1 #
∀ {α : Type u_1} {g : GenContFract α} {n : ℕ}, g.TerminatedAt n ↔ g.s.TerminatedAt n
theorem GenContFract.terminatedAt_iff_s_none E1 #
∀ {α : Type u_1} {g : GenContFract α} {n : ℕ}, g.TerminatedAt n ↔ g.s.get? n = none
theorem GenContFract.partNum_none_iff_s_none E1 #
∀ {α : Type u_1} {g : GenContFract α} {n : ℕ}, g.partNums.get? n = none ↔ g.s.get? n = none
theorem GenContFract.terminatedAt_iff_partNum_none E1 #
∀ {α : Type u_1} {g : GenContFract α} {n : ℕ}, g.TerminatedAt n ↔ g.partNums.get? n = none
theorem GenContFract.partDen_none_iff_s_none E1 #
∀ {α : Type u_1} {g : GenContFract α} {n : ℕ}, g.partDens.get? n = none ↔ g.s.get? n = none
theorem GenContFract.terminatedAt_iff_partDen_none E1 #
∀ {α : Type u_1} {g : GenContFract α} {n : ℕ}, g.TerminatedAt n ↔ g.partDens.get? n = none
theorem GenContFract.partNum_eq_s_a E1 #
∀ {α : Type u_1} {g : GenContFract α} {n : ℕ} {gp : GenContFract.Pair α},
g.s.get? n = some gp → g.partNums.get? n = some gp.a
theorem GenContFract.partDen_eq_s_b E1 #
∀ {α : Type u_1} {g : GenContFract α} {n : ℕ} {gp : GenContFract.Pair α},
g.s.get? n = some gp → g.partDens.get? n = some gp.b
theorem GenContFract.exists_s_a_of_partNum E1 #
∀ {α : Type u_1} {g : GenContFract α} {n : ℕ} {a : α},
g.partNums.get? n = some a → ∃ gp, g.s.get? n = some gp ∧ gp.a = a
theorem GenContFract.exists_s_b_of_partDen E1 #
∀ {α : Type u_1} {g : GenContFract α} {n : ℕ} {b : α},
g.partDens.get? n = some b → ∃ gp, g.s.get? n = some gp ∧ gp.b = b
theorem GenContFract.nth_cont_eq_succ_nth_contAux E0 #
∀ {K : Type u_1} {g : GenContFract K} {n : ℕ} [inst : DivisionRing K], g.conts n = g.contsAux (n + 1)
theorem GenContFract.num_eq_conts_a E1 #
∀ {K : Type u_1} {g : GenContFract K} {n : ℕ} [inst : DivisionRing K], g.nums n = (g.conts n).a
theorem GenContFract.den_eq_conts_b E1 #
∀ {K : Type u_1} {g : GenContFract K} {n : ℕ} [inst : DivisionRing K], g.dens n = (g.conts n).b
theorem GenContFract.conv_eq_num_div_den E1 #
∀ {K : Type u_1} {g : GenContFract K} {n : ℕ} [inst : DivisionRing K], g.convs n = g.nums n / g.dens n
theorem GenContFract.conv_eq_conts_a_div_conts_b E1 #
∀ {K : Type u_1} {g : GenContFract K} {n : ℕ} [inst : DivisionRing K], g.convs n = (g.conts n).a / (g.conts n).b
theorem GenContFract.exists_conts_a_of_num E1 #
∀ {K : Type u_1} {g : GenContFract K} {n : ℕ} [inst : DivisionRing K] {A : K},
g.nums n = A → ∃ conts, g.conts n = conts ∧ conts.a = A
theorem GenContFract.exists_conts_b_of_den E1 #
∀ {K : Type u_1} {g : GenContFract K} {n : ℕ} [inst : DivisionRing K] {B : K},
g.dens n = B → ∃ conts, g.conts n = conts ∧ conts.b = B
theorem GenContFract.zeroth_contAux_eq_one_zero E0 #
∀ {K : Type u_1} {g : GenContFract K} [inst : DivisionRing K], g.contsAux 0 = { a := 1, b := 0 }
theorem GenContFract.first_contAux_eq_h_one E0 #
∀ {K : Type u_1} {g : GenContFract K} [inst : DivisionRing K], g.contsAux 1 = { a := g.h, b := 1 }
theorem GenContFract.zeroth_cont_eq_h_one E0 #
∀ {K : Type u_1} {g : GenContFract K} [inst : DivisionRing K], g.conts 0 = { a := g.h, b := 1 }
theorem GenContFract.zeroth_num_eq_h E0 #
∀ {K : Type u_1} {g : GenContFract K} [inst : DivisionRing K], g.nums 0 = g.h
theorem GenContFract.zeroth_den_eq_one E0 #
∀ {K : Type u_1} {g : GenContFract K} [inst : DivisionRing K], g.dens 0 = 1
theorem GenContFract.zeroth_conv_eq_h E0 #
∀ {K : Type u_1} {g : GenContFract K} [inst : DivisionRing K], g.convs 0 = g.h
theorem GenContFract.second_contAux_eq E0 #
∀ {K : Type u_1} {g : GenContFract K} [inst : DivisionRing K] {gp : GenContFract.Pair K},
g.s.get? 0 = some gp → g.contsAux 2 = { a := gp.b * g.h + gp.a, b := gp.b }
theorem GenContFract.first_cont_eq E0 #
∀ {K : Type u_1} {g : GenContFract K} [inst : DivisionRing K] {gp : GenContFract.Pair K},
g.s.get? 0 = some gp → g.conts 1 = { a := gp.b * g.h + gp.a, b := gp.b }
theorem GenContFract.first_num_eq E0 #
∀ {K : Type u_1} {g : GenContFract K} [inst : DivisionRing K] {gp : GenContFract.Pair K},
g.s.get? 0 = some gp → g.nums 1 = gp.b * g.h + gp.a
theorem GenContFract.first_den_eq E0 #
∀ {K : Type u_1} {g : GenContFract K} [inst : DivisionRing K] {gp : GenContFract.Pair K},
g.s.get? 0 = some gp → g.dens 1 = gp.b
theorem GenContFract.zeroth_conv'Aux_eq_zero E0 #
∀ {K : Type u_1} [inst : DivisionRing K] {s : Stream'.Seq (GenContFract.Pair K)}, GenContFract.convs'Aux s 0 = 0
theorem GenContFract.zeroth_conv'_eq_h E0 #
∀ {K : Type u_1} {g : GenContFract K} [inst : DivisionRing K], g.convs' 0 = g.h
theorem GenContFract.convs'Aux_succ_none E1 #
∀ {K : Type u_1} [inst : DivisionRing K] {s : Stream'.Seq (GenContFract.Pair K)},
s.head = none → ∀ (n : ℕ), GenContFract.convs'Aux s (n + 1) = 0
theorem GenContFract.convs'Aux_succ_some E1 #
∀ {K : Type u_1} [inst : DivisionRing K] {s : Stream'.Seq (GenContFract.Pair K)} {p : GenContFract.Pair K},
s.head = some p → ∀ (n : ℕ), GenContFract.convs'Aux s (n + 1) = p.a / (p.b + GenContFract.convs'Aux s.tail n)