Equations
Instances For
Equations
- Nat.nextPowerOfTwo.go n power h = if power < n then Nat.nextPowerOfTwo.go n (power * 2) (_ : power * 2 > 0) else power
Instances For
Equations
- Nat.isPowerOfTwo n = ∃ (k : Nat), n = 2 ^ k
Instances For
theorem
Nat.mul2_isPowerOfTwo_of_isPowerOfTwo
{n : Nat}
(h : Nat.isPowerOfTwo n)
:
Nat.isPowerOfTwo (n * 2)
theorem
Nat.isPowerOfTwo_nextPowerOfTwo.isPowerOfTwo_go
(n : Nat)
(power : Nat)
(h₁ : power > 0)
(h₂ : Nat.isPowerOfTwo power)
:
Nat.isPowerOfTwo (Nat.nextPowerOfTwo.go n power h₁)