Euclidean remainder of a negated dividend
Provedburau_cf_emod_neg_of_posarithmeticcontinued-fractionseuclidean-algorithm
Euclidean remainder of a negated dividend. For positive integers ,
the companion of the quotient formula . Together they give the one-step recursion of the standard Euclidean continued fraction of in terms of that of , i.e. the negative reciprocal transformation of continued fractions.
Preamble
import Mathlib set_option autoImplicit false
Formal statement
theorem burau_cf_emod_neg_of_pos (a b : ℤ) (ha : 0 < a) (hb : 0 < b) :
(-a) % b = b * ((a + b - 1) / b) - a := by sorry
Source
Euclidean algorithm on Z; cf. A. Ya. Khinchin, *Continued Fractions* (1964), Ch. II.