Dyadic numbers #
A dyadic (rational) number is a rational number whose denominator is a power of two. We define them
as a subtype of ℚ, and build the CommRing structure, as well as proving some auxiliary theorems
on them.
Todo #
In the time since this file was created, Dyadic got added to Lean core. We've temporarily renamed
our implementation to Dyadic'. In the near future, these two implementations will be merged.
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)
:
Equations
- instDecidableMemNatSetRangeHPow_combinatorialGames 0 n = decidable_of_iff (n ∈ {1, 0}) ⋯
- instDecidableMemNatSetRangeHPow_combinatorialGames b_2.succ n = decidable_of_iff ((b_2 + 1) ^ Nat.log (b_2 + 1) n = n) ⋯
theorem
dvd_iff_le_of_mem_powers
{m n : ℕ}
(hm : m ∈ Submonoid.powers 2)
(hn : n ∈ Submonoid.powers 2)
:
Dyadic numbers #
instance
instDecidableMemNatSubmonoidPowers_combinatorialGames
{m n : ℕ}
:
Decidable (m ∈ Submonoid.powers n)
Equations
- instDecidableMemNatSubmonoidPowers_combinatorialGames = decidable_of_iff (m ∈ Set.range fun (x : ℕ) => n ^ x) ⋯
Equations
Equations
- Dyadic'.instInhabited = { default := 0 }
The dyadic number ½.
Equations
Instances For
@[simp]
@[simp]
@[simp]
@[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