Dyadic numbers #
A dyadic (rational) number is a rational number whose denominator is a power of two. We provide
the CommRing structure, as well as proving some auxiliary theorems on them.
For Mathlib #
theorem
le_of_le_of_lt_of_lt
{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[Preorder β]
{x y : α}
{f : α → β}
(h : x < y → f x < f y)
(hxy : x ≤ y)
:
theorem
dvd_iff_le_of_mem_powers
{m n : ℕ}
(hm : m ∈ Submonoid.powers 2)
(hn : n ∈ Submonoid.powers 2)
:
Equations
- Dyadic.instInhabited_combinatorialGames = { default := 0 }
Constructor for the fraction m / n.
Equations
- Dyadic.mkRat m h = Dyadic.ofIntWithPrec m ↑(Submonoid.log ⟨n, h⟩)
Instances For
@[simp]
@[simp]
Equations
- One or more equations did not get rendered due to their size.
@[simp]
Equations
- One or more equations did not get rendered due to their size.
theorem
Dyadic.eq_mkRat_of_den_le
{x : Dyadic}
{n : ℕ}
(h : x.den ≤ n)
(hn : n ∈ Submonoid.powers 2)
:
∃ (m : ℤ), x = Dyadic.mkRat m hn
Coercion as a RingHom.
Equations
- Dyadic.coeRingHom = { toFun := Dyadic.toRat, map_one' := Dyadic.coeRingHom._proof_1, map_mul' := Dyadic.toRat_mul, map_zero' := Dyadic.coeRingHom._proof_2, map_add' := Dyadic.toRat_add }