Theorems · Theorem · number theory
GenContFract.compExactValue_correctness_of_stream_eq_some
∀ {K : Type u_1} [inst : Field K] [inst_1 : LinearOrder K] {v : K} {n : ℕ} [inst_2 : FloorRing K]
{ifp_n : GenContFract.IntFractPair K},
GenContFract.IntFractPair.stream v n = some ifp_n →
v = GenContFract.compExactValue ((GenContFract.of v).contsAux n) ((GenContFract.of v).contsAux (n + 1)) ifp_n.frShows the correctness of compExactValue in case the continued fraction
GenContFract.of v did not terminate at position n. That is, we obtain the
value v if we pass the two successive (auxiliary) continuants at positions n and n + 1 as well
as the fractional part at IntFractPair.stream n to compExactValue.
The correctness might be seen more readily if one uses convs' to evaluate the continued
fraction. Here is an example to illustrate the idea:
Let (v : ℚ) := 3.4. We have
- GenContFract.IntFractPair.stream v 0 = some ⟨3, 0.4⟩, and
- GenContFract.IntFractPair.stream v 1 = some ⟨2, 0.5⟩.
Now (GenContFract.of v).convs' 1 = 3 + 1/2, and our fractional term at position 2 is 0.5.
We hence have v = 3 + 1/(2 + 0.5) = 3 + 1/2.5 = 3.4.
This computation corresponds exactly to the one using the recurrence equation in compExactValue.
- Cited by
- 2 results in Mathlib
- Foundations
- Depth 66 from the axioms · uses propext, Classical.choice, Quot.sound
- Assumes
- FieldLinearOrderFloorRing
Around this declaration
Dashed lines are statement dependencies; solid lines are citations in proofs.
Cites35
Mathlib declarations this one mentions in its statement or cites explicitly in its proof. Plumbing is filtered out.
- LinearOrderstatement and proof · cited by 8,572
- Fieldstatement and proof · cited by 7,404
- mul_oneproof · cited by 3,885
- one_mulproof · cited by 2,841
- add_zeroproof · cited by 2,707
- zero_addproof · cited by 2,366
- MulZeroClass.mul_zeroproof · cited by 2,091
- eq_or_neproof · cited by 1,117
- one_ne_zeroproof · cited by 885
- div_oneproof · cited by 629
- FloorRingstatement and proof · cited by 405
- Int.floorproof · cited by 225
Cited by2
Results whose statement or proof uses this declaration.
- GenContFract.of_correctness_of_nth_stream_eq_noneproof · cited by 1
- GenContFract.sub_convs_eqproof · cited by 0