Theorems · Definition · number theory
GenContFract.IntFractPair.stream
{K : Type u_1} →
[inst : DivisionRing K] →
[inst_1 : LinearOrder K] → [FloorRing K] → K → Stream' (Option (GenContFract.IntFractPair K))Creates the stream of integer and fractional parts of a value v needed to obtain the continued
fraction representation of v in GenContFract.of. More precisely, given a value v : K, it
recursively computes a stream of option ℤ × K pairs as follows:
- stream v 0 = some ⟨⌊v⌋, v - ⌊v⌋⟩
- stream v (n + 1) = some ⟨⌊frₙ⁻¹⌋, frₙ⁻¹ - ⌊frₙ⁻¹⌋⟩,
if stream v n = some ⟨_, frₙ⟩ and frₙ ≠ 0
- stream v (n + 1) = none, otherwise
For example, let (v : ℚ) := 3.4. The process goes as follows:
- stream v 0 = some ⟨⌊v⌋, v - ⌊v⌋⟩ = some ⟨3, 0.4⟩
- stream v 1 = some ⟨⌊0.4⁻¹⌋, 0.4⁻¹ - ⌊0.4⁻¹⌋⟩ = some ⟨⌊2.5⌋, 2.5 - ⌊2.5⌋⟩ = some ⟨2, 0.5⟩
- stream v 2 = some ⟨⌊0.5⁻¹⌋, 0.5⁻¹ - ⌊0.5⁻¹⌋⟩ = some ⟨⌊2⌋, 2 - ⌊2⌋⟩ = some ⟨2, 0⟩
- stream v n = none, for n ≥ 3
- Cited by
- 37 results in Mathlib
- Foundations
- Depth 46 from the axioms · uses propext, Classical.choice, Quot.sound
Around this declaration
Dashed lines are statement dependencies; solid lines are citations in proofs.
Cites5
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
- DivisionRingstatement and proof · cited by 1,062
- FloorRingstatement and proof · cited by 405
- Stream'statement · cited by 205
- GenContFract.IntFractPairstatement · cited by 45
Cited by38
Results whose statement or proof uses this declaration.
- GenContFract.IntFractPair.succ_nth_stream_eq_some_iffstatement and proof · cited by 8
- GenContFract.IntFractPair.seq1proof · cited by 5
- GenContFract.IntFractPair.stream_isSeqstatement and proof · cited by 5
- GenContFract.of_terminatedAt_n_iff_succ_nth_intFractPair_stream_eq_nonestatement and proof · cited by 5
- GenContFract.IntFractPair.exists_succ_get?_stream_of_gcf_of_get?_eq_somestatement and proof · cited by 4
- GenContFract.IntFractPair.nth_stream_fr_nonneg_lt_onestatement and proof · cited by 4
- GenContFract.of_one_le_get?_partDenproof · cited by 4
- GenContFract.IntFractPair.nth_stream_fr_nonnegstatement and proof · cited by 3
- GenContFract.IntFractPair.stream_succ_of_somestatement and proof · cited by 3
- GenContFract.IntFractPair.stream_zerostatement · cited by 3
- GenContFract.IntFractPair.succ_nth_stream_eq_none_iffstatement and proof · cited by 3
- GenContFract.get?_of_eq_some_of_succ_get?_intFractPair_streamstatement and proof · cited by 3