Equations
- n.nextPowerOfTwo = Nat.nextPowerOfTwo.go n 1 Nat.nextPowerOfTwo.proof_1
Instances For
@[irreducible]
Equations
- Nat.nextPowerOfTwo.go n power h = if power < n then Nat.nextPowerOfTwo.go n (power * 2) ⋯ else power
Instances For
@[irreducible]
theorem
Nat.isPowerOfTwo_nextPowerOfTwo.isPowerOfTwo_go
(n power : Nat)
(h₁ : power > 0)
(h₂ : power.isPowerOfTwo)
:
(Nat.nextPowerOfTwo.go n power h₁).isPowerOfTwo