case z
n m✝ : ℕ
h✝ : ∀ (i : ℕ), testBit n i = testBit m✝ i
m : ℕ
h : ∀ (i : ℕ), testBit 0 i = testBit m i
⊢ 0 = m

case f
n✝ m✝ : ℕ
h✝ : ∀ (i : ℕ), testBit n✝ i = testBit m✝ i
b : Bool
n : ℕ
hn : ∀ {m : ℕ}, (∀ (i : ℕ), testBit n i = testBit m i) → n = m
m : ℕ
h : ∀ (i : ℕ), testBit (bit b n) i = testBit m i
⊢ bit b n = m
n m : ℕ
h : ∀ (i : ℕ), testBit n i = testBit m i
⊢ n = m
induction' n using Nat.binaryRec with b n hn generalizing m
case f.z
n✝ m✝ : ℕ
h✝¹ : ∀ (i : ℕ), testBit n✝ i = testBit m✝ i
b : Bool
n : ℕ
hn : ∀ {m : ℕ}, (∀ (i : ℕ), testBit n i = testBit m i) → n = m
m : ℕ
h✝ : ∀ (i : ℕ), testBit (bit b n) i = testBit m i
h : ∀ (i : ℕ), testBit (bit b n) i = testBit 0 i
⊢ bit b n = 0

case f.f
n✝ m✝¹ : ℕ
h✝¹ : ∀ (i : ℕ), testBit n✝ i = testBit m✝¹ i
b : Bool
n : ℕ
hn : ∀ {m : ℕ}, (∀ (i : ℕ), testBit n i = testBit m i) → n = m
m✝ : ℕ
h✝ : ∀ (i : ℕ), testBit (bit b n) i = testBit m✝ i
b' : Bool
m : ℕ
a✝ : (∀ (i : ℕ), testBit (bit b n) i = testBit m i) → bit b n = m
h : ∀ (i : ℕ), testBit (bit b n) i = testBit (bit b' m) i
⊢ bit b n = bit b' m
case f
n✝ m✝ : ℕ
h✝ : ∀ (i : ℕ), testBit n✝ i = testBit m✝ i
b : Bool
n : ℕ
hn : ∀ {m : ℕ}, (∀ (i : ℕ), testBit n i = testBit m i) → n = m
m : ℕ
h : ∀ (i : ℕ), testBit (bit b n) i = testBit m i
⊢ bit b n = m
induction' m using Nat.binaryRec with b' m
case f.f
n✝ m✝¹ : ℕ
h✝¹ : ∀ (i : ℕ), testBit n✝ i = testBit m✝¹ i
b : Bool
n : ℕ
hn : ∀ {m : ℕ}, (∀ (i : ℕ), testBit n i = testBit m i) → n = m
m✝ : ℕ
h✝ : ∀ (i : ℕ), testBit (bit b n) i = testBit m✝ i
b' : Bool
m : ℕ
a✝ : (∀ (i : ℕ), testBit (bit b n) i = testBit m i) → bit b n = m
h : ∀ (i : ℕ), testBit (bit b n) i = testBit (bit b' m) i
h' : n = m
⊢ bit b n = bit b' m

case h'
n✝ m✝¹ : ℕ
h✝¹ : ∀ (i : ℕ), testBit n✝ i = testBit m✝¹ i
b : Bool
n : ℕ
hn : ∀ {m : ℕ}, (∀ (i : ℕ), testBit n i = testBit m i) → n = m
m✝ : ℕ
h✝ : ∀ (i : ℕ), testBit (bit b n) i = testBit m✝ i
b' : Bool
m : ℕ
a✝ : (∀ (i : ℕ), testBit (bit b n) i = testBit m i) → bit b n = m
h : ∀ (i : ℕ), testBit (bit b n) i = testBit (bit b' m) i
⊢ n = m
case f.f
n✝ m✝¹ : ℕ
h✝¹ : ∀ (i : ℕ), testBit n✝ i = testBit m✝¹ i
b : Bool
n : ℕ
hn : ∀ {m : ℕ}, (∀ (i : ℕ), testBit n i = testBit m i) → n = m
m✝ : ℕ
h✝ : ∀ (i : ℕ), testBit (bit b n) i = testBit m✝ i
b' : Bool
m : ℕ
a✝ : (∀ (i : ℕ), testBit (bit b n) i = testBit m i) → bit b n = m
h : ∀ (i : ℕ), testBit (bit b n) i = testBit (bit b' m) i
⊢ bit b n = bit b' m
suffices h' : n = m
no goals
case h'
n✝ m✝¹ : ℕ
h✝¹ : ∀ (i : ℕ), testBit n✝ i = testBit m✝¹ i
b : Bool
n : ℕ
hn : ∀ {m : ℕ}, (∀ (i : ℕ), testBit n i = testBit m i) → n = m
m✝ : ℕ
h✝ : ∀ (i : ℕ), testBit (bit b n) i = testBit m✝ i
b' : Bool
m : ℕ
a✝ : (∀ (i : ℕ), testBit (bit b n) i = testBit m i) → bit b n = m
h : ∀ (i : ℕ), testBit (bit b n) i = testBit (bit b' m) i
⊢ n = m
exact hn fun i => by convert h (i + 1) using 1 <;> rw [testBit_succ]
case z
n m✝ : ℕ
h✝ : ∀ (i : ℕ), testBit n i = testBit m✝ i
m : ℕ
h : ∀ (i : ℕ), false = testBit m i
⊢ 0 = m
case z
n m✝ : ℕ
h✝ : ∀ (i : ℕ), testBit n i = testBit m✝ i
m : ℕ
h : ∀ (i : ℕ), testBit 0 i = testBit m i
⊢ 0 = m
simp only [zero_testBit] at h
no goals
case z
n m✝ : ℕ
h✝ : ∀ (i : ℕ), testBit n i = testBit m✝ i
m : ℕ
h : ∀ (i : ℕ), false = testBit m i
⊢ 0 = m
exact (zero_of_testBit_eq_false fun i => (h i).symm).symm
case f.z
n✝ m✝ : ℕ
h✝¹ : ∀ (i : ℕ), testBit n✝ i = testBit m✝ i
b : Bool
n : ℕ
hn : ∀ {m : ℕ}, (∀ (i : ℕ), testBit n i = testBit m i) → n = m
m : ℕ
h✝ : ∀ (i : ℕ), testBit (bit b n) i = testBit m i
h : ∀ (i : ℕ), testBit (bit b n) i = false
⊢ bit b n = 0
case f.z
n✝ m✝ : ℕ
h✝¹ : ∀ (i : ℕ), testBit n✝ i = testBit m✝ i
b : Bool
n : ℕ
hn : ∀ {m : ℕ}, (∀ (i : ℕ), testBit n i = testBit m i) → n = m
m : ℕ
h✝ : ∀ (i : ℕ), testBit (bit b n) i = testBit m i
h : ∀ (i : ℕ), testBit (bit b n) i = testBit 0 i
⊢ bit b n = 0
simp only [zero_testBit] at h
no goals
case f.z
n✝ m✝ : ℕ
h✝¹ : ∀ (i : ℕ), testBit n✝ i = testBit m✝ i
b : Bool
n : ℕ
hn : ∀ {m : ℕ}, (∀ (i : ℕ), testBit n i = testBit m i) → n = m
m : ℕ
h✝ : ∀ (i : ℕ), testBit (bit b n) i = testBit m i
h : ∀ (i : ℕ), testBit (bit b n) i = false
⊢ bit b n = 0
exact zero_of_testBit_eq_false h
no goals
case f.f
n✝ m✝¹ : ℕ
h✝¹ : ∀ (i : ℕ), testBit n✝ i = testBit m✝¹ i
b : Bool
n : ℕ
hn : ∀ {m : ℕ}, (∀ (i : ℕ), testBit n i = testBit m i) → n = m
m✝ : ℕ
h✝ : ∀ (i : ℕ), testBit (bit b n) i = testBit m✝ i
b' : Bool
m : ℕ
a✝ : (∀ (i : ℕ), testBit (bit b n) i = testBit m i) → bit b n = m
h : ∀ (i : ℕ), testBit (bit b n) i = testBit (bit b' m) i
h' : n = m
⊢ bit b n = bit b' m
rw [h', show b = b' by simpa using h 0]
no goals
n✝ m✝¹ : ℕ
h✝¹ : ∀ (i : ℕ), testBit n✝ i = testBit m✝¹ i
b : Bool
n : ℕ
hn : ∀ {m : ℕ}, (∀ (i : ℕ), testBit n i = testBit m i) → n = m
m✝ : ℕ
h✝ : ∀ (i : ℕ), testBit (bit b n) i = testBit m✝ i
b' : Bool
m : ℕ
a✝ : (∀ (i : ℕ), testBit (bit b n) i = testBit m i) → bit b n = m
h : ∀ (i : ℕ), testBit (bit b n) i = testBit (bit b' m) i
h' : n = m
⊢ b = b'
simpa using h 0
no goals
n✝ m✝¹ : ℕ
h✝¹ : ∀ (i : ℕ), testBit n✝ i = testBit m✝¹ i
b : Bool
n : ℕ
hn : ∀ {m : ℕ}, (∀ (i : ℕ), testBit n i = testBit m i) → n = m
m✝ : ℕ
h✝ : ∀ (i : ℕ), testBit (bit b n) i = testBit m✝ i
b' : Bool
m : ℕ
a✝ : (∀ (i : ℕ), testBit (bit b n) i = testBit m i) → bit b n = m
h : ∀ (i : ℕ), testBit (bit b n) i = testBit (bit b' m) i
i : ℕ
⊢ testBit n i = testBit m i
convert h (i + 1) using 1 <;> rw [testBit_succ]