Mathlib Map

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

Defined in
Mathlib.Algebra.ContinuedFractions.Computation.Basic
Cited by
37 results in Mathlib
Foundations
Depth 46 from the axioms · uses propext, Classical.choice, Quot.sound
Assumes
DivisionRingLinearOrderFloorRing

Around this declaration

Dashed lines are statement dependencies; solid lines are citations in proofs.

GenContFract.IntFractPair.succ_nth_stream_eq_some_iff · cited by 8IntFractPair.succ_nth_str…GenContFract.IntFractPair.seq1 · cited by 5IntFractPair.seq1GenContFract.IntFractPair.stream_isSeq · cited by 5IntFractPair.stream_isSeqGenContFract.of_terminatedAt_n_iff_succ_nth_intFractPair_stream_eq_none · cited by 5GenContFract.of_terminate…GenContFract.IntFractPair.exists_succ_get?_stream_of_gcf_of_get?_eq_some · cited by 4IntFractPair.exists_succ_…GenContFract.IntFractPair.nth_stream_fr_nonneg_lt_one · cited by 4IntFractPair.nth_stream_f…GenContFract.of_one_le_get?_partDen · cited by 4GenContFract.of_one_le_ge…GenContFract.IntFractPair.nth_stream_fr_nonneg · cited by 3IntFractPair.nth_stream_f…GenContFract.IntFractPair.stream_succ_of_some · cited by 3IntFractPair.stream_succ_…GenContFract.IntFractPair.stream_zero · cited by 3IntFractPair.stream_zeroGenContFract.IntFractPair.succ_nth_stream_eq_none_iff · cited by 3IntFractPair.succ_nth_str…GenContFract.get?_of_eq_some_of_succ_get?_intFractPair_stream · cited by 3GenContFract.get?_of_eq_s…GenContFract.of_correctness_of_terminatedAt · cited by 3GenContFract.of_correctne…GenContFract.of_partNum_eq_one_and_exists_int_partDen_eq · cited by 3GenContFract.of_partNum_e…GenContFract.abs_sub_convs_le · cited by 2GenContFract.abs_sub_conv…LinearOrder · cited by 8572LinearOrderDivisionRing · cited by 1062DivisionRingFloorRing · cited by 405FloorRingStream' · cited by 205Stream'GenContFract.IntFractPair · cited by 45GenContFract.IntFractPairIntFractPair.streamCITED BYCITES

Cites5

Mathlib declarations this one mentions in its statement or cites explicitly in its proof. Plumbing is filtered out.

Cited by38

Results whose statement or proof uses this declaration.