Dyadic games #
A combinatorial game that is both Short
and Numeric
is called dyadic. We show that the dyadic
games are in correspondence with the Dyadic
rationals, in the sense that there exists a map
Dyadic.toIGame
such that:
Dyadic.toIGame x
is always a dyadic game.- For any dyadic game
y
, there existsx
withDyadic.toIGame x ≈ y
. - The map
Dyadic.toGame
(defined in the obvious way) is a ring homomorphism.
Todo #
Show the latter two bullet points.
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 #
This material belongs in Mathlib, though we do need to consider if the definition of Dyadic
used
here is the best one.
instance
instDecidableMemNatSubmonoidPowers_combinatorialGames
{m n : ℕ}
:
Decidable (m ∈ Submonoid.powers n)
Equations
- instDecidableMemNatSubmonoidPowers_combinatorialGames = decidable_of_iff (m ∈ Set.range fun (x : ℕ) => n ^ x) ⋯
Equations
The dyadic number ½.
Equations
Instances For
@[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
Dyadic games #
For a dyadic number m / n
, returns (m - 1) / n
.
Equations
- x.lower = Dyadic.mkRat (x.num - 1) ⋯
Instances For
For a dyadic number m / n
, returns (m + 1) / n
.
Equations
- x.upper = Dyadic.mkRat (x.num + 1) ⋯
Instances For
An auxiliary tactic for inducting on the denominator of a Dyadic
.
Equations
- Dyadic.tacticDyadic_wf = Lean.ParserDescr.node `Dyadic.tacticDyadic_wf 1024 (Lean.ParserDescr.nonReservedSymbol "dyadic_wf" false)