l3lab/ntp-mathlib huggingface dataset:
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> 

Proof state:
case h.e'_3
b : Bool
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
b' : Bool
m : ℕ
hm' :
  ∀ (i : ℕ),
    testBit (bit b n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit b n) j = testBit m j) → bit b n < m
hnm : ∀ (j : ℕ), 0 < j → testBit (bit b n) j = testBit (bit b' m) j
hn : b = false
hm : b' = true
i : ℕ
⊢ testBit m i = testBit (bit b' m) (i + 1)

Next tactic:
rw [testBit_succ]
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> rw [testBit_succ]
    

Proof state:
case pos
b : Bool
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
b' : Bool
m : ℕ
hm' :
  ∀ (i : ℕ),
    testBit (bit b n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit b n) j = testBit m j) → bit b n < m
hnm : ∀ (j : ℕ), 0 < j → testBit (bit b n) j = testBit (bit b' m) j
hn : b = false
hm : b' = true
this : n = m
⊢ bit b n < bit b' m

Next tactic:
rw [hn, hm, this, bit_false, bit_true, bit0_val, bit1_val]
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> rw [testBit_succ]
    rw [hn, hm, this, bit_false, bit_true, bit0_val, bit1_val]
    

Proof state:
case pos
b : Bool
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
b' : Bool
m : ℕ
hm' :
  ∀ (i : ℕ),
    testBit (bit b n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit b n) j = testBit m j) → bit b n < m
hnm : ∀ (j : ℕ), 0 < j → testBit (bit b n) j = testBit (bit b' m) j
hn : b = false
hm : b' = true
this : n = m
⊢ 2 * m < 2 * m + 1

Next tactic:
exact lt_add_one _
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> rw [testBit_succ]
    rw [hn, hm, this, bit_false, bit_true, bit0_val, bit1_val]
    exact lt_add_one _
  · 

Proof state:
case neg
b : Bool
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
b' : Bool
m : ℕ
hm' :
  ∀ (i : ℕ),
    testBit (bit b n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit b n) j = testBit m j) → bit b n < m
i : ℕ
hn : testBit (bit b n) i = false
hm : testBit (bit b' m) i = true
hnm : ∀ (j : ℕ), i < j → testBit (bit b n) j = testBit (bit b' m) j
hi : ¬i = 0
⊢ bit b n < bit b' m

Next tactic:
obtain ⟨i', rfl⟩ := exists_eq_succ_of_ne_zero hi
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> rw [testBit_succ]
    rw [hn, hm, this, bit_false, bit_true, bit0_val, bit1_val]
    exact lt_add_one _
  · obtain ⟨i', rfl⟩ := exists_eq_succ_of_ne_zero hi
    

Proof state:
case neg.intro
b : Bool
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
b' : Bool
m : ℕ
hm' :
  ∀ (i : ℕ),
    testBit (bit b n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit b n) j = testBit m j) → bit b n < m
i' : ℕ
hn : testBit (bit b n) (succ i') = false
hm : testBit (bit b' m) (succ i') = true
hnm : ∀ (j : ℕ), succ i' < j → testBit (bit b n) j = testBit (bit b' m) j
hi : ¬succ i' = 0
⊢ bit b n < bit b' m

Next tactic:
simp only [testBit_succ] at hn hm
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> rw [testBit_succ]
    rw [hn, hm, this, bit_false, bit_true, bit0_val, bit1_val]
    exact lt_add_one _
  · obtain ⟨i', rfl⟩ := exists_eq_succ_of_ne_zero hi
    simp only [testBit_succ] at hn hm
    

Proof state:
case neg.intro
b : Bool
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
b' : Bool
m : ℕ
hm' :
  ∀ (i : ℕ),
    testBit (bit b n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit b n) j = testBit m j) → bit b n < m
i' : ℕ
hnm : ∀ (j : ℕ), succ i' < j → testBit (bit b n) j = testBit (bit b' m) j
hi : ¬succ i' = 0
hn : testBit n i' = false
hm : testBit m i' = true
⊢ bit b n < bit b' m

Next tactic:
have :=
      hn' _ hn hm fun j hj => by convert hnm j.succ (succ_lt_succ hj) using 1 <;> rw [testBit_succ]
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> rw [testBit_succ]
    rw [hn, hm, this, bit_false, bit_true, bit0_val, bit1_val]
    exact lt_add_one _
  · obtain ⟨i', rfl⟩ := exists_eq_succ_of_ne_zero hi
    simp only [testBit_succ] at hn hm
    have :=
      hn' _ hn hm fun j hj => by 

Proof state:
b : Bool
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
b' : Bool
m : ℕ
hm' :
  ∀ (i : ℕ),
    testBit (bit b n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit b n) j = testBit m j) → bit b n < m
i' : ℕ
hnm : ∀ (j : ℕ), succ i' < j → testBit (bit b n) j = testBit (bit b' m) j
hi : ¬succ i' = 0
hn : testBit n i' = false
hm : testBit m i' = true
j : ℕ
hj : i' < j
⊢ testBit n j = testBit m j

Next tactic:
convert hnm j.succ (succ_lt_succ hj) using 1
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> rw [testBit_succ]
    rw [hn, hm, this, bit_false, bit_true, bit0_val, bit1_val]
    exact lt_add_one _
  · obtain ⟨i', rfl⟩ := exists_eq_succ_of_ne_zero hi
    simp only [testBit_succ] at hn hm
    have :=
      hn' _ hn hm fun j hj => by convert hnm j.succ (succ_lt_succ hj) using 1 <;> 

Proof state:
case h.e'_2
b : Bool
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
b' : Bool
m : ℕ
hm' :
  ∀ (i : ℕ),
    testBit (bit b n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit b n) j = testBit m j) → bit b n < m
i' : ℕ
hnm : ∀ (j : ℕ), succ i' < j → testBit (bit b n) j = testBit (bit b' m) j
hi : ¬succ i' = 0
hn : testBit n i' = false
hm : testBit m i' = true
j : ℕ
hj : i' < j
⊢ testBit n j = testBit (bit b n) (succ j)

Next tactic:
rw [testBit_succ]
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> rw [testBit_succ]
    rw [hn, hm, this, bit_false, bit_true, bit0_val, bit1_val]
    exact lt_add_one _
  · obtain ⟨i', rfl⟩ := exists_eq_succ_of_ne_zero hi
    simp only [testBit_succ] at hn hm
    have :=
      hn' _ hn hm fun j hj => by convert hnm j.succ (succ_lt_succ hj) using 1 <;> 

Proof state:
case h.e'_3
b : Bool
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
b' : Bool
m : ℕ
hm' :
  ∀ (i : ℕ),
    testBit (bit b n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit b n) j = testBit m j) → bit b n < m
i' : ℕ
hnm : ∀ (j : ℕ), succ i' < j → testBit (bit b n) j = testBit (bit b' m) j
hi : ¬succ i' = 0
hn : testBit n i' = false
hm : testBit m i' = true
j : ℕ
hj : i' < j
⊢ testBit m j = testBit (bit b' m) (succ j)

Next tactic:
rw [testBit_succ]
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> rw [testBit_succ]
    rw [hn, hm, this, bit_false, bit_true, bit0_val, bit1_val]
    exact lt_add_one _
  · obtain ⟨i', rfl⟩ := exists_eq_succ_of_ne_zero hi
    simp only [testBit_succ] at hn hm
    have :=
      hn' _ hn hm fun j hj => by convert hnm j.succ (succ_lt_succ hj) using 1 <;> rw [testBit_succ]
    

Proof state:
case neg.intro
b : Bool
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
b' : Bool
m : ℕ
hm' :
  ∀ (i : ℕ),
    testBit (bit b n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit b n) j = testBit m j) → bit b n < m
i' : ℕ
hnm : ∀ (j : ℕ), succ i' < j → testBit (bit b n) j = testBit (bit b' m) j
hi : ¬succ i' = 0
hn : testBit n i' = false
hm : testBit m i' = true
this : n < m
⊢ bit b n < bit b' m

Next tactic:
have this' : 2 * n < 2 * m := Nat.mul_lt_mul' (le_refl _) this two_pos
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> rw [testBit_succ]
    rw [hn, hm, this, bit_false, bit_true, bit0_val, bit1_val]
    exact lt_add_one _
  · obtain ⟨i', rfl⟩ := exists_eq_succ_of_ne_zero hi
    simp only [testBit_succ] at hn hm
    have :=
      hn' _ hn hm fun j hj => by convert hnm j.succ (succ_lt_succ hj) using 1 <;> rw [testBit_succ]
    have this' : 2 * n < 2 * m := Nat.mul_lt_mul' (le_refl _) this two_pos
    

Proof state:
case neg.intro
b : Bool
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
b' : Bool
m : ℕ
hm' :
  ∀ (i : ℕ),
    testBit (bit b n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit b n) j = testBit m j) → bit b n < m
i' : ℕ
hnm : ∀ (j : ℕ), succ i' < j → testBit (bit b n) j = testBit (bit b' m) j
hi : ¬succ i' = 0
hn : testBit n i' = false
hm : testBit m i' = true
this : n < m
this' : 2 * n < 2 * m
⊢ bit b n < bit b' m

Next tactic:
cases b
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> rw [testBit_succ]
    rw [hn, hm, this, bit_false, bit_true, bit0_val, bit1_val]
    exact lt_add_one _
  · obtain ⟨i', rfl⟩ := exists_eq_succ_of_ne_zero hi
    simp only [testBit_succ] at hn hm
    have :=
      hn' _ hn hm fun j hj => by convert hnm j.succ (succ_lt_succ hj) using 1 <;> rw [testBit_succ]
    have this' : 2 * n < 2 * m := Nat.mul_lt_mul' (le_refl _) this two_pos
    cases b <;> 

Proof state:
case neg.intro.false
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
b' : Bool
m i' : ℕ
hi : ¬succ i' = 0
hn : testBit n i' = false
hm : testBit m i' = true
this : n < m
this' : 2 * n < 2 * m
hm' :
  ∀ (i : ℕ),
    testBit (bit false n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit false n) j = testBit m j) → bit false n < m
hnm : ∀ (j : ℕ), succ i' < j → testBit (bit false n) j = testBit (bit b' m) j
⊢ bit false n < bit b' m

Next tactic:
cases b'
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> rw [testBit_succ]
    rw [hn, hm, this, bit_false, bit_true, bit0_val, bit1_val]
    exact lt_add_one _
  · obtain ⟨i', rfl⟩ := exists_eq_succ_of_ne_zero hi
    simp only [testBit_succ] at hn hm
    have :=
      hn' _ hn hm fun j hj => by convert hnm j.succ (succ_lt_succ hj) using 1 <;> rw [testBit_succ]
    have this' : 2 * n < 2 * m := Nat.mul_lt_mul' (le_refl _) this two_pos
    cases b <;> 

Proof state:
case neg.intro.true
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
b' : Bool
m i' : ℕ
hi : ¬succ i' = 0
hn : testBit n i' = false
hm : testBit m i' = true
this : n < m
this' : 2 * n < 2 * m
hm' :
  ∀ (i : ℕ),
    testBit (bit true n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit true n) j = testBit m j) → bit true n < m
hnm : ∀ (j : ℕ), succ i' < j → testBit (bit true n) j = testBit (bit b' m) j
⊢ bit true n < bit b' m

Next tactic:
cases b'
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> rw [testBit_succ]
    rw [hn, hm, this, bit_false, bit_true, bit0_val, bit1_val]
    exact lt_add_one _
  · obtain ⟨i', rfl⟩ := exists_eq_succ_of_ne_zero hi
    simp only [testBit_succ] at hn hm
    have :=
      hn' _ hn hm fun j hj => by convert hnm j.succ (succ_lt_succ hj) using 1 <;> rw [testBit_succ]
    have this' : 2 * n < 2 * m := Nat.mul_lt_mul' (le_refl _) this two_pos
    cases b <;> cases b'
    <;> 

Proof state:
case neg.intro.false.false
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
m i' : ℕ
hi : ¬succ i' = 0
hn : testBit n i' = false
hm : testBit m i' = true
this : n < m
this' : 2 * n < 2 * m
hm' :
  ∀ (i : ℕ),
    testBit (bit false n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit false n) j = testBit m j) → bit false n < m
hnm : ∀ (j : ℕ), succ i' < j → testBit (bit false n) j = testBit (bit false m) j
⊢ bit false n < bit false m

Next tactic:
simp only [bit_false, bit_true, bit0_val n, bit1_val n, bit0_val m, bit1_val m]
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> rw [testBit_succ]
    rw [hn, hm, this, bit_false, bit_true, bit0_val, bit1_val]
    exact lt_add_one _
  · obtain ⟨i', rfl⟩ := exists_eq_succ_of_ne_zero hi
    simp only [testBit_succ] at hn hm
    have :=
      hn' _ hn hm fun j hj => by convert hnm j.succ (succ_lt_succ hj) using 1 <;> rw [testBit_succ]
    have this' : 2 * n < 2 * m := Nat.mul_lt_mul' (le_refl _) this two_pos
    cases b <;> cases b'
    <;> 

Proof state:
case neg.intro.false.true
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
m i' : ℕ
hi : ¬succ i' = 0
hn : testBit n i' = false
hm : testBit m i' = true
this : n < m
this' : 2 * n < 2 * m
hm' :
  ∀ (i : ℕ),
    testBit (bit false n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit false n) j = testBit m j) → bit false n < m
hnm : ∀ (j : ℕ), succ i' < j → testBit (bit false n) j = testBit (bit true m) j
⊢ bit false n < bit true m

Next tactic:
simp only [bit_false, bit_true, bit0_val n, bit1_val n, bit0_val m, bit1_val m]
theorem lt_of_testBit {n m : ℕ} (i : ℕ) (hn : testBit n i = false) (hm : testBit m i = true)
    (hnm : ∀ j, i < j → testBit n j = testBit m j) : n < m := by
  induction' n using Nat.binaryRec with b n hn' generalizing i m
  · contrapose! hm
    rw [le_zero_iff] at hm
    simp [hm]
  induction' m using Nat.binaryRec with b' m hm' generalizing i
  · exact False.elim (Bool.false_ne_true ((zero_testBit i).symm.trans hm))
  by_cases hi : i = 0
  · subst hi
    simp only [testBit_zero] at hn hm
    have : n = m :=
      eq_of_testBit_eq fun i => by convert hnm (i + 1) (Nat.zero_lt_succ _) using 1
      <;> rw [testBit_succ]
    rw [hn, hm, this, bit_false, bit_true, bit0_val, bit1_val]
    exact lt_add_one _
  · obtain ⟨i', rfl⟩ := exists_eq_succ_of_ne_zero hi
    simp only [testBit_succ] at hn hm
    have :=
      hn' _ hn hm fun j hj => by convert hnm j.succ (succ_lt_succ hj) using 1 <;> rw [testBit_succ]
    have this' : 2 * n < 2 * m := Nat.mul_lt_mul' (le_refl _) this two_pos
    cases b <;> cases b'
    <;> 

Proof state:
case neg.intro.true.false
n : ℕ
hn' :
  ∀ {m : ℕ} (i : ℕ), testBit n i = false → testBit m i = true → (∀ (j : ℕ), i < j → testBit n j = testBit m j) → n < m
m i' : ℕ
hi : ¬succ i' = 0
hn : testBit n i' = false
hm : testBit m i' = true
this : n < m
this' : 2 * n < 2 * m
hm' :
  ∀ (i : ℕ),
    testBit (bit true n) i = false →
      testBit m i = true → (∀ (j : ℕ), i < j → testBit (bit true n) j = testBit m j) → bit true n < m
hnm : ∀ (j : ℕ), succ i' < j → testBit (bit true n) j = testBit (bit false m) j
⊢ bit true n < bit false m

Next tactic:
simp only [bit_false, bit_true, bit0_val n, bit1_val n, bit0_val m, bit1_val m]