l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem bodd_add (m n : ℤ) : bodd (m + n) = xor (bodd m) (bodd n) := by
  cases' m with m m <;>
  cases' n with n n <;>
  simp only [ofNat_eq_coe, ofNat_add_negSucc, negSucc_add_ofNat,
             negSucc_add_negSucc, bodd_subNatNat] <;>
  

Proof state:
case ofNat.ofNat
m n : ℕ
⊢ bodd (↑m + ↑n) = xor (bodd ↑m) (bodd ↑n)

Next tactic:
simp only [negSucc_coe, bodd_neg, bodd_coe, ← Nat.bodd_add, Bool.xor_comm, ← Nat.cast_add]
@[simp]
theorem bodd_add (m n : ℤ) : bodd (m + n) = xor (bodd m) (bodd n) := by
  cases' m with m m <;>
  cases' n with n n <;>
  simp only [ofNat_eq_coe, ofNat_add_negSucc, negSucc_add_ofNat,
             negSucc_add_negSucc, bodd_subNatNat] <;>
  

Proof state:
case ofNat.negSucc
m n : ℕ
⊢ xor (Nat.bodd m) (Nat.bodd (Nat.succ n)) = xor (bodd ↑m) (bodd -[n+1])

Next tactic:
simp only [negSucc_coe, bodd_neg, bodd_coe, ← Nat.bodd_add, Bool.xor_comm, ← Nat.cast_add]
@[simp]
theorem bodd_add (m n : ℤ) : bodd (m + n) = xor (bodd m) (bodd n) := by
  cases' m with m m <;>
  cases' n with n n <;>
  simp only [ofNat_eq_coe, ofNat_add_negSucc, negSucc_add_ofNat,
             negSucc_add_negSucc, bodd_subNatNat] <;>
  

Proof state:
case negSucc.ofNat
m n : ℕ
⊢ xor (Nat.bodd n) (Nat.bodd (Nat.succ m)) = xor (bodd -[m+1]) (bodd ↑n)

Next tactic:
simp only [negSucc_coe, bodd_neg, bodd_coe, ← Nat.bodd_add, Bool.xor_comm, ← Nat.cast_add]
@[simp]
theorem bodd_add (m n : ℤ) : bodd (m + n) = xor (bodd m) (bodd n) := by
  cases' m with m m <;>
  cases' n with n n <;>
  simp only [ofNat_eq_coe, ofNat_add_negSucc, negSucc_add_ofNat,
             negSucc_add_negSucc, bodd_subNatNat] <;>
  

Proof state:
case negSucc.negSucc
m n : ℕ
⊢ bodd -[Nat.succ (m + n)+1] = xor (bodd -[m+1]) (bodd -[n+1])

Next tactic:
simp only [negSucc_coe, bodd_neg, bodd_coe, ← Nat.bodd_add, Bool.xor_comm, ← Nat.cast_add]
@[simp]
theorem bodd_add (m n : ℤ) : bodd (m + n) = xor (bodd m) (bodd n) := by
  cases' m with m m <;>
  cases' n with n n <;>
  simp only [ofNat_eq_coe, ofNat_add_negSucc, negSucc_add_ofNat,
             negSucc_add_negSucc, bodd_subNatNat] <;>
  simp only [negSucc_coe, bodd_neg, bodd_coe, ← Nat.bodd_add, Bool.xor_comm, ← Nat.cast_add]
  

Proof state:
case negSucc.negSucc
m n : ℕ
⊢ Nat.bodd (Nat.succ (m + n) + 1) = Nat.bodd (m + 1 + (n + 1))

Next tactic:
rw [← Nat.succ_add, add_assoc]
@[simp]
theorem bodd_mul (m n : ℤ) : bodd (m * n) = (bodd m && bodd n) := by
  

Proof state:
m n : ℤ
⊢ bodd (m * n) = (bodd m && bodd n)

Next tactic:
cases' m with m m
@[simp]
theorem bodd_mul (m n : ℤ) : bodd (m * n) = (bodd m && bodd n) := by
  cases' m with m m <;> 

Proof state:
case ofNat
n : ℤ
m : ℕ
⊢ bodd (ofNat m * n) = (bodd (ofNat m) && bodd n)

Next tactic:
cases' n with n n
@[simp]
theorem bodd_mul (m n : ℤ) : bodd (m * n) = (bodd m && bodd n) := by
  cases' m with m m <;> 

Proof state:
case negSucc
n : ℤ
m : ℕ
⊢ bodd (-[m+1] * n) = (bodd -[m+1] && bodd n)

Next tactic:
cases' n with n n
@[simp]
theorem bodd_mul (m n : ℤ) : bodd (m * n) = (bodd m && bodd n) := by
  cases' m with m m <;> cases' n with n n <;>
  

Proof state:
case ofNat.ofNat
m n : ℕ
⊢ bodd (ofNat m * ofNat n) = (bodd (ofNat m) && bodd (ofNat n))

Next tactic:
simp only [ofNat_eq_coe, ofNat_mul_negSucc, negSucc_mul_ofNat, ofNat_mul_ofNat,
             negSucc_mul_negSucc]
@[simp]
theorem bodd_mul (m n : ℤ) : bodd (m * n) = (bodd m && bodd n) := by
  cases' m with m m <;> cases' n with n n <;>
  

Proof state:
case ofNat.negSucc
m n : ℕ
⊢ bodd (ofNat m * -[n+1]) = (bodd (ofNat m) && bodd -[n+1])

Next tactic:
simp only [ofNat_eq_coe, ofNat_mul_negSucc, negSucc_mul_ofNat, ofNat_mul_ofNat,
             negSucc_mul_negSucc]
@[simp]
theorem bodd_mul (m n : ℤ) : bodd (m * n) = (bodd m && bodd n) := by
  cases' m with m m <;> cases' n with n n <;>
  

Proof state:
case negSucc.ofNat
m n : ℕ
⊢ bodd (-[m+1] * ofNat n) = (bodd -[m+1] && bodd (ofNat n))

Next tactic:
simp only [ofNat_eq_coe, ofNat_mul_negSucc, negSucc_mul_ofNat, ofNat_mul_ofNat,
             negSucc_mul_negSucc]
@[simp]
theorem bodd_mul (m n : ℤ) : bodd (m * n) = (bodd m && bodd n) := by
  cases' m with m m <;> cases' n with n n <;>
  

Proof state:
case negSucc.negSucc
m n : ℕ
⊢ bodd (-[m+1] * -[n+1]) = (bodd -[m+1] && bodd -[n+1])

Next tactic:
simp only [ofNat_eq_coe, ofNat_mul_negSucc, negSucc_mul_ofNat, ofNat_mul_ofNat,
             negSucc_mul_negSucc]
@[simp]
theorem bodd_mul (m n : ℤ) : bodd (m * n) = (bodd m && bodd n) := by
  cases' m with m m <;> cases' n with n n <;>
  simp only [ofNat_eq_coe, ofNat_mul_negSucc, negSucc_mul_ofNat, ofNat_mul_ofNat,
             negSucc_mul_negSucc] <;>
  

Proof state:
case ofNat.ofNat
m n : ℕ
⊢ bodd ↑(m * n) = (bodd ↑m && bodd ↑n)

Next tactic:
simp only [negSucc_coe, bodd_neg, bodd_coe, ← Nat.bodd_mul]
@[simp]
theorem bodd_mul (m n : ℤ) : bodd (m * n) = (bodd m && bodd n) := by
  cases' m with m m <;> cases' n with n n <;>
  simp only [ofNat_eq_coe, ofNat_mul_negSucc, negSucc_mul_ofNat, ofNat_mul_ofNat,
             negSucc_mul_negSucc] <;>
  

Proof state:
case ofNat.negSucc
m n : ℕ
⊢ bodd (-↑(m * Nat.succ n)) = (bodd ↑m && bodd -[n+1])

Next tactic:
simp only [negSucc_coe, bodd_neg, bodd_coe, ← Nat.bodd_mul]
@[simp]
theorem bodd_mul (m n : ℤ) : bodd (m * n) = (bodd m && bodd n) := by
  cases' m with m m <;> cases' n with n n <;>
  simp only [ofNat_eq_coe, ofNat_mul_negSucc, negSucc_mul_ofNat, ofNat_mul_ofNat,
             negSucc_mul_negSucc] <;>
  

Proof state:
case negSucc.ofNat
m n : ℕ
⊢ bodd (-↑(Nat.succ m * n)) = (bodd -[m+1] && bodd ↑n)

Next tactic:
simp only [negSucc_coe, bodd_neg, bodd_coe, ← Nat.bodd_mul]
@[simp]
theorem bodd_mul (m n : ℤ) : bodd (m * n) = (bodd m && bodd n) := by
  cases' m with m m <;> cases' n with n n <;>
  simp only [ofNat_eq_coe, ofNat_mul_negSucc, negSucc_mul_ofNat, ofNat_mul_ofNat,
             negSucc_mul_negSucc] <;>
  

Proof state:
case negSucc.negSucc
m n : ℕ
⊢ bodd ↑(Nat.succ m * Nat.succ n) = (bodd -[m+1] && bodd -[n+1])

Next tactic:
simp only [negSucc_coe, bodd_neg, bodd_coe, ← Nat.bodd_mul]
theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
  | (n : ℕ) => by
    

Proof state:
n : ℕ
⊢ (bif bodd ↑n then 1 else 0) + 2 * div2 ↑n = ↑n

Next tactic:
rw [show (cond (bodd n) 1 0 : ℤ) = (cond (bodd n) 1 0 : ℕ) by cases bodd n <;> rfl]
theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
  | (n : ℕ) => by
    rw [show (cond (bodd n) 1 0 : ℤ) = (cond (bodd n) 1 0 : ℕ) by 

Proof state:
n : ℕ
⊢ (bif bodd ↑n then 1 else 0) = ↑(bif bodd ↑n then 1 else 0)

Next tactic:
cases bodd n
theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
  | (n : ℕ) => by
    rw [show (cond (bodd n) 1 0 : ℤ) = (cond (bodd n) 1 0 : ℕ) by cases bodd n <;> 

Proof state:
case false
n : ℕ
⊢ (bif false then 1 else 0) = ↑(bif false then 1 else 0)

Next tactic:
rfl
theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
  | (n : ℕ) => by
    rw [show (cond (bodd n) 1 0 : ℤ) = (cond (bodd n) 1 0 : ℕ) by cases bodd n <;> 

Proof state:
case true
n : ℕ
⊢ (bif true then 1 else 0) = ↑(bif true then 1 else 0)

Next tactic:
rfl
theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
  | (n : ℕ) => by
    rw [show (cond (bodd n) 1 0 : ℤ) = (cond (bodd n) 1 0 : ℕ) by cases bodd n <;> rfl]
    

Proof state:
n : ℕ
⊢ ↑(bif bodd ↑n then 1 else 0) + 2 * div2 ↑n = ↑n

Next tactic:
exact congr_arg ofNat n.bodd_add_div2
theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
  | (n : ℕ) => by
    rw [show (cond (bodd n) 1 0 : ℤ) = (cond (bodd n) 1 0 : ℕ) by cases bodd n <;> rfl]
    exact congr_arg ofNat n.bodd_add_div2
  | -[n+1] => by
    

Proof state:
n : ℕ
⊢ (bif bodd -[n+1] then 1 else 0) + 2 * div2 -[n+1] = -[n+1]

Next tactic:
refine' Eq.trans _ (congr_arg negSucc n.bodd_add_div2)
theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
  | (n : ℕ) => by
    rw [show (cond (bodd n) 1 0 : ℤ) = (cond (bodd n) 1 0 : ℕ) by cases bodd n <;> rfl]
    exact congr_arg ofNat n.bodd_add_div2
  | -[n+1] => by
    refine' Eq.trans _ (congr_arg negSucc n.bodd_add_div2)
    

Proof state:
n : ℕ
⊢ (bif bodd -[n+1] then 1 else 0) + 2 * div2 -[n+1] = -[(bif Nat.bodd n then 1 else 0) + 2 * Nat.div2 n+1]

Next tactic:
dsimp [bodd]
theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
  | (n : ℕ) => by
    rw [show (cond (bodd n) 1 0 : ℤ) = (cond (bodd n) 1 0 : ℕ) by cases bodd n <;> rfl]
    exact congr_arg ofNat n.bodd_add_div2
  | -[n+1] => by
    refine' Eq.trans _ (congr_arg negSucc n.bodd_add_div2)
    dsimp [bodd]; 

Proof state:
n : ℕ
⊢ (bif !Nat.bodd n then 1 else 0) + 2 * div2 -[n+1] = -[(bif Nat.bodd n then 1 else 0) + 2 * Nat.div2 n+1]

Next tactic:
cases Nat.bodd n
theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
  | (n : ℕ) => by
    rw [show (cond (bodd n) 1 0 : ℤ) = (cond (bodd n) 1 0 : ℕ) by cases bodd n <;> rfl]
    exact congr_arg ofNat n.bodd_add_div2
  | -[n+1] => by
    refine' Eq.trans _ (congr_arg negSucc n.bodd_add_div2)
    dsimp [bodd]; cases Nat.bodd n <;> 

Proof state:
case false
n : ℕ
⊢ (bif !false then 1 else 0) + 2 * div2 -[n+1] = -[(bif false then 1 else 0) + 2 * Nat.div2 n+1]

Next tactic:
dsimp [cond, not, div2, Int.mul]
theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
  | (n : ℕ) => by
    rw [show (cond (bodd n) 1 0 : ℤ) = (cond (bodd n) 1 0 : ℕ) by cases bodd n <;> rfl]
    exact congr_arg ofNat n.bodd_add_div2
  | -[n+1] => by
    refine' Eq.trans _ (congr_arg negSucc n.bodd_add_div2)
    dsimp [bodd]; cases Nat.bodd n <;> 

Proof state:
case true
n : ℕ
⊢ (bif !true then 1 else 0) + 2 * div2 -[n+1] = -[(bif true then 1 else 0) + 2 * Nat.div2 n+1]

Next tactic:
dsimp [cond, not, div2, Int.mul]
theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
  | (n : ℕ) => by
    rw [show (cond (bodd n) 1 0 : ℤ) = (cond (bodd n) 1 0 : ℕ) by cases bodd n <;> rfl]
    exact congr_arg ofNat n.bodd_add_div2
  | -[n+1] => by
    refine' Eq.trans _ (congr_arg negSucc n.bodd_add_div2)
    dsimp [bodd]; cases Nat.bodd n <;> dsimp [cond, not, div2, Int.mul]
    · 

Proof state:
case false
n : ℕ
⊢ 1 + 2 * -[Nat.div2 n+1] = -[0 + 2 * Nat.div2 n+1]

Next tactic:
change -[2 * Nat.div2 n+1] = _
theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
  | (n : ℕ) => by
    rw [show (cond (bodd n) 1 0 : ℤ) = (cond (bodd n) 1 0 : ℕ) by cases bodd n <;> rfl]
    exact congr_arg ofNat n.bodd_add_div2
  | -[n+1] => by
    refine' Eq.trans _ (congr_arg negSucc n.bodd_add_div2)
    dsimp [bodd]; cases Nat.bodd n <;> dsimp [cond, not, div2, Int.mul]
    · change -[2 * Nat.div2 n+1] = _
      

Proof state:
case false
n : ℕ
⊢ -[2 * Nat.div2 n+1] = -[0 + 2 * Nat.div2 n+1]

Next tactic:
rw [zero_add]
theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
  | (n : ℕ) => by
    rw [show (cond (bodd n) 1 0 : ℤ) = (cond (bodd n) 1 0 : ℕ) by cases bodd n <;> rfl]
    exact congr_arg ofNat n.bodd_add_div2
  | -[n+1] => by
    refine' Eq.trans _ (congr_arg negSucc n.bodd_add_div2)
    dsimp [bodd]; cases Nat.bodd n <;> dsimp [cond, not, div2, Int.mul]
    · change -[2 * Nat.div2 n+1] = _
      rw [zero_add]
    · 

Proof state:
case true
n : ℕ
⊢ 0 + 2 * -[Nat.div2 n+1] = -[1 + 2 * Nat.div2 n+1]

Next tactic:
rw [zero_add, add_comm]
theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
  | (n : ℕ) => by
    rw [show (cond (bodd n) 1 0 : ℤ) = (cond (bodd n) 1 0 : ℕ) by cases bodd n <;> rfl]
    exact congr_arg ofNat n.bodd_add_div2
  | -[n+1] => by
    refine' Eq.trans _ (congr_arg negSucc n.bodd_add_div2)
    dsimp [bodd]; cases Nat.bodd n <;> dsimp [cond, not, div2, Int.mul]
    · change -[2 * Nat.div2 n+1] = _
      rw [zero_add]
    · rw [zero_add, add_comm]
      

Proof state:
case true
n : ℕ
⊢ 2 * -[Nat.div2 n+1] = -[2 * Nat.div2 n + 1+1]

Next tactic:
rfl
theorem bit_val (b n) : bit b n = 2 * n + cond b 1 0 := by
  

Proof state:
b : Bool
n : ℤ
⊢ bit b n = 2 * n + bif b then 1 else 0

Next tactic:
cases b
theorem bit_val (b n) : bit b n = 2 * n + cond b 1 0 := by
  cases b
  

Proof state:
case false
n : ℤ
⊢ bit false n = 2 * n + bif false then 1 else 0
case true n : ℤ ⊢ bit true n = 2 * n + bif true then 1 else 0

Next tactic:
apply (bit0_val n).trans (add_zero _).symm
theorem bit_val (b n) : bit b n = 2 * n + cond b 1 0 := by
  cases b
  apply (bit0_val n).trans (add_zero _).symm
  

Proof state:
case true
n : ℤ
⊢ bit true n = 2 * n + bif true then 1 else 0

Next tactic:
apply bit1_val
/-- Defines a function from `ℤ` conditionally, if it is defined for odd and even integers separately
  using `bit`. -/
def bitCasesOn.{u} {C : ℤ → Sort u} (n) (h : ∀ b n, C (bit b n)) : C n := by
  

Proof state:
C : ℤ → Sort u
n : ℤ
h : (b : Bool) → (n : ℤ) → C (bit b n)
⊢ C n

Next tactic:
rw [← bit_decomp n]
/-- Defines a function from `ℤ` conditionally, if it is defined for odd and even integers separately
  using `bit`. -/
def bitCasesOn.{u} {C : ℤ → Sort u} (n) (h : ∀ b n, C (bit b n)) : C n := by
  rw [← bit_decomp n]
  

Proof state:
C : ℤ → Sort u
n : ℤ
h : (b : Bool) → (n : ℤ) → C (bit b n)
⊢ C (bit (bodd n) (div2 n))

Next tactic:
apply h
@[simp]
theorem bit_coe_nat (b) (n : ℕ) : bit b n = Nat.bit b n := by
  

Proof state:
b : Bool
n : ℕ
⊢ bit b ↑n = ↑(Nat.bit b n)

Next tactic:
rw [bit_val, Nat.bit_val]
@[simp]
theorem bit_coe_nat (b) (n : ℕ) : bit b n = Nat.bit b n := by
  rw [bit_val, Nat.bit_val]
  

Proof state:
b : Bool
n : ℕ
⊢ (2 * ↑n + bif b then 1 else 0) = ↑(2 * n + bif b then 1 else 0)

Next tactic:
cases b
@[simp]
theorem bit_coe_nat (b) (n : ℕ) : bit b n = Nat.bit b n := by
  rw [bit_val, Nat.bit_val]
  cases b <;> 

Proof state:
case false
n : ℕ
⊢ (2 * ↑n + bif false then 1 else 0) = ↑(2 * n + bif false then 1 else 0)

Next tactic:
rfl
@[simp]
theorem bit_coe_nat (b) (n : ℕ) : bit b n = Nat.bit b n := by
  rw [bit_val, Nat.bit_val]
  cases b <;> 

Proof state:
case true
n : ℕ
⊢ (2 * ↑n + bif true then 1 else 0) = ↑(2 * n + bif true then 1 else 0)

Next tactic:
rfl
@[simp]
theorem bit_negSucc (b) (n : ℕ) : bit b -[n+1] = -[Nat.bit (not b) n+1] := by
  

Proof state:
b : Bool
n : ℕ
⊢ bit b -[n+1] = -[Nat.bit (!b) n+1]

Next tactic:
rw [bit_val, Nat.bit_val]
@[simp]
theorem bit_negSucc (b) (n : ℕ) : bit b -[n+1] = -[Nat.bit (not b) n+1] := by
  rw [bit_val, Nat.bit_val]
  

Proof state:
b : Bool
n : ℕ
⊢ (2 * -[n+1] + bif b then 1 else 0) = -[2 * n + bif !b then 1 else 0+1]

Next tactic:
cases b
@[simp]
theorem bit_negSucc (b) (n : ℕ) : bit b -[n+1] = -[Nat.bit (not b) n+1] := by
  rw [bit_val, Nat.bit_val]
  cases b <;> 

Proof state:
case false
n : ℕ
⊢ (2 * -[n+1] + bif false then 1 else 0) = -[2 * n + bif !false then 1 else 0+1]

Next tactic:
rfl
@[simp]
theorem bit_negSucc (b) (n : ℕ) : bit b -[n+1] = -[Nat.bit (not b) n+1] := by
  rw [bit_val, Nat.bit_val]
  cases b <;> 

Proof state:
case true
n : ℕ
⊢ (2 * -[n+1] + bif true then 1 else 0) = -[2 * n + bif !true then 1 else 0+1]

Next tactic:
rfl
@[simp]
theorem bodd_bit (b n) : bodd (bit b n) = b := by
  

Proof state:
b : Bool
n : ℤ
⊢ bodd (bit b n) = b

Next tactic:
rw [bit_val]
@[simp]
theorem bodd_bit (b n) : bodd (bit b n) = b := by
  rw [bit_val]
  

Proof state:
b : Bool
n : ℤ
⊢ bodd (2 * n + bif b then 1 else 0) = b

Next tactic:
cases b
@[simp]
theorem bodd_bit (b n) : bodd (bit b n) = b := by
  rw [bit_val]
  cases b <;> 

Proof state:
case false
n : ℤ
⊢ bodd (2 * n + bif false then 1 else 0) = false

Next tactic:
cases bodd n
@[simp]
theorem bodd_bit (b n) : bodd (bit b n) = b := by
  rw [bit_val]
  cases b <;> 

Proof state:
case true
n : ℤ
⊢ bodd (2 * n + bif true then 1 else 0) = true

Next tactic:
cases bodd n
@[simp]
theorem bodd_bit (b n) : bodd (bit b n) = b := by
  rw [bit_val]
  cases b <;> cases bodd n <;> 

Proof state:
case false.false
n : ℤ
⊢ bodd (2 * n + bif false then 1 else 0) = false

Next tactic:
simp [(show bodd 2 = false by rfl)]
@[simp]
theorem bodd_bit (b n) : bodd (bit b n) = b := by
  rw [bit_val]
  cases b <;> cases bodd n <;> simp [(show bodd 2 = false by 

Proof state:
n : ℤ
⊢ bodd 2 = false

Next tactic:
rfl
@[simp]
theorem bodd_bit (b n) : bodd (bit b n) = b := by
  rw [bit_val]
  cases b <;> cases bodd n <;> 

Proof state:
case false.true
n : ℤ
⊢ bodd (2 * n + bif false then 1 else 0) = false

Next tactic:
simp [(show bodd 2 = false by rfl)]
@[simp]
theorem bodd_bit (b n) : bodd (bit b n) = b := by
  rw [bit_val]
  cases b <;> cases bodd n <;> 

Proof state:
case true.false
n : ℤ
⊢ bodd (2 * n + bif true then 1 else 0) = true

Next tactic:
simp [(show bodd 2 = false by rfl)]
@[simp]
theorem bodd_bit (b n) : bodd (bit b n) = b := by
  rw [bit_val]
  cases b <;> cases bodd n <;> 

Proof state:
case true.true
n : ℤ
⊢ bodd (2 * n + bif true then 1 else 0) = true

Next tactic:
simp [(show bodd 2 = false by rfl)]
@[deprecated]
theorem bit0_ne_bit1 (m n : ℤ) : bit0 m ≠ bit1 n :=
  mt (congr_arg bodd) <| by 

Proof state:
m n : ℤ
⊢ ¬bodd (bit0 m) = bodd (bit1 n)

Next tactic:
simp
@[deprecated]
theorem bit1_ne_zero (m : ℤ) : bit1 m ≠ 0 := by 

Proof state:
m : ℤ
⊢ bit1 m ≠ 0

Next tactic:
simpa only [bit0_zero] using bit1_ne_bit0 m 0
@[simp]
theorem testBit_zero (b) : ∀ n, testBit (bit b n) 0 = b
  | (n : ℕ) => by 

Proof state:
b : Bool
n : ℕ
⊢ testBit (bit b ↑n) 0 = b

Next tactic:
rw [bit_coe_nat]
@[simp]
theorem testBit_zero (b) : ∀ n, testBit (bit b n) 0 = b
  | (n : ℕ) => by rw [bit_coe_nat]; 

Proof state:
b : Bool
n : ℕ
⊢ testBit (↑(Nat.bit b n)) 0 = b

Next tactic:
apply Nat.testBit_zero
@[simp]
theorem testBit_zero (b) : ∀ n, testBit (bit b n) 0 = b
  | (n : ℕ) => by rw [bit_coe_nat]; apply Nat.testBit_zero
  | -[n+1] => by
    

Proof state:
b : Bool
n : ℕ
⊢ testBit (bit b -[n+1]) 0 = b

Next tactic:
rw [bit_negSucc]
@[simp]
theorem testBit_zero (b) : ∀ n, testBit (bit b n) 0 = b
  | (n : ℕ) => by rw [bit_coe_nat]; apply Nat.testBit_zero
  | -[n+1] => by
    rw [bit_negSucc]; 

Proof state:
b : Bool
n : ℕ
⊢ testBit -[Nat.bit (!b) n+1] 0 = b

Next tactic:
dsimp [testBit]
@[simp]
theorem testBit_zero (b) : ∀ n, testBit (bit b n) 0 = b
  | (n : ℕ) => by rw [bit_coe_nat]; apply Nat.testBit_zero
  | -[n+1] => by
    rw [bit_negSucc]; dsimp [testBit]; 

Proof state:
b : Bool
n : ℕ
⊢ (!Nat.testBit (Nat.bit (!b) n) 0) = b

Next tactic:
rw [Nat.testBit_zero]
@[simp]
theorem testBit_zero (b) : ∀ n, testBit (bit b n) 0 = b
  | (n : ℕ) => by rw [bit_coe_nat]; apply Nat.testBit_zero
  | -[n+1] => by
    rw [bit_negSucc]; dsimp [testBit]; rw [Nat.testBit_zero]; 

Proof state:
b : Bool
n : ℕ
⊢ (!!b) = b

Next tactic:
clear testBit_zero
@[simp]
theorem testBit_zero (b) : ∀ n, testBit (bit b n) 0 = b
  | (n : ℕ) => by rw [bit_coe_nat]; apply Nat.testBit_zero
  | -[n+1] => by
    rw [bit_negSucc]; dsimp [testBit]; rw [Nat.testBit_zero]; clear testBit_zero;
        

Proof state:
b : Bool
n : ℕ
⊢ (!!b) = b

Next tactic:
cases b
@[simp]
theorem testBit_zero (b) : ∀ n, testBit (bit b n) 0 = b
  | (n : ℕ) => by rw [bit_coe_nat]; apply Nat.testBit_zero
  | -[n+1] => by
    rw [bit_negSucc]; dsimp [testBit]; rw [Nat.testBit_zero]; clear testBit_zero;
        cases b <;>
      

Proof state:
case false
n : ℕ
⊢ (!!false) = false

Next tactic:
rfl
@[simp]
theorem testBit_zero (b) : ∀ n, testBit (bit b n) 0 = b
  | (n : ℕ) => by rw [bit_coe_nat]; apply Nat.testBit_zero
  | -[n+1] => by
    rw [bit_negSucc]; dsimp [testBit]; rw [Nat.testBit_zero]; clear testBit_zero;
        cases b <;>
      

Proof state:
case true
n : ℕ
⊢ (!!true) = true

Next tactic:
rfl
@[simp]
theorem testBit_succ (m b) : ∀ n, testBit (bit b n) (Nat.succ m) = testBit n m
  | (n : ℕ) => by 

Proof state:
m : ℕ
b : Bool
n : ℕ
⊢ testBit (bit b ↑n) (Nat.succ m) = testBit (↑n) m

Next tactic:
rw [bit_coe_nat]
@[simp]
theorem testBit_succ (m b) : ∀ n, testBit (bit b n) (Nat.succ m) = testBit n m
  | (n : ℕ) => by rw [bit_coe_nat]; 

Proof state:
m : ℕ
b : Bool
n : ℕ
⊢ testBit (↑(Nat.bit b n)) (Nat.succ m) = testBit (↑n) m

Next tactic:
apply Nat.testBit_succ
@[simp]
theorem testBit_succ (m b) : ∀ n, testBit (bit b n) (Nat.succ m) = testBit n m
  | (n : ℕ) => by rw [bit_coe_nat]; apply Nat.testBit_succ
  | -[n+1] => by
    

Proof state:
m : ℕ
b : Bool
n : ℕ
⊢ testBit (bit b -[n+1]) (Nat.succ m) = testBit -[n+1] m

Next tactic:
dsimp only [testBit]
@[simp]
theorem testBit_succ (m b) : ∀ n, testBit (bit b n) (Nat.succ m) = testBit n m
  | (n : ℕ) => by rw [bit_coe_nat]; apply Nat.testBit_succ
  | -[n+1] => by
    dsimp only [testBit]
    

Proof state:
m : ℕ
b : Bool
n : ℕ
⊢ (match bit b -[n+1], Nat.succ m with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    !Nat.testBit n m

Next tactic:
simp only [bit_negSucc]
@[simp]
theorem testBit_succ (m b) : ∀ n, testBit (bit b n) (Nat.succ m) = testBit n m
  | (n : ℕ) => by rw [bit_coe_nat]; apply Nat.testBit_succ
  | -[n+1] => by
    dsimp only [testBit]
    simp only [bit_negSucc]
    

Proof state:
m : ℕ
b : Bool
n : ℕ
⊢ (!Nat.testBit (Nat.bit (!b) n) (Nat.succ m)) = !Nat.testBit n m

Next tactic:
cases b
@[simp]
theorem testBit_succ (m b) : ∀ n, testBit (bit b n) (Nat.succ m) = testBit n m
  | (n : ℕ) => by rw [bit_coe_nat]; apply Nat.testBit_succ
  | -[n+1] => by
    dsimp only [testBit]
    simp only [bit_negSucc]
    cases b <;> 

Proof state:
case false
m n : ℕ
⊢ (!Nat.testBit (Nat.bit (!false) n) (Nat.succ m)) = !Nat.testBit n m

Next tactic:
simp only [Bool.not_false, Bool.not_true, Nat.testBit_succ]
@[simp]
theorem testBit_succ (m b) : ∀ n, testBit (bit b n) (Nat.succ m) = testBit n m
  | (n : ℕ) => by rw [bit_coe_nat]; apply Nat.testBit_succ
  | -[n+1] => by
    dsimp only [testBit]
    simp only [bit_negSucc]
    cases b <;> 

Proof state:
case true
m n : ℕ
⊢ (!Nat.testBit (Nat.bit (!true) n) (Nat.succ m)) = !Nat.testBit n m

Next tactic:
simp only [Bool.not_false, Bool.not_true, Nat.testBit_succ]
theorem bitwise_or : bitwise or = lor := by
  

Proof state:
⊢ bitwise or = lor

Next tactic:
funext m n
theorem bitwise_or : bitwise or = lor := by
  funext m n
  

Proof state:
case h.h
m n : ℤ
⊢ bitwise or m n = lor m n

Next tactic:
cases' m with m m
theorem bitwise_or : bitwise or = lor := by
  funext m n
  cases' m with m m <;> 

Proof state:
case h.h.ofNat
n : ℤ
m : ℕ
⊢ bitwise or (ofNat m) n = lor (ofNat m) n

Next tactic:
cases' n with n n
theorem bitwise_or : bitwise or = lor := by
  funext m n
  cases' m with m m <;> 

Proof state:
case h.h.negSucc
n : ℤ
m : ℕ
⊢ bitwise or -[m+1] n = lor -[m+1] n

Next tactic:
cases' n with n n
theorem bitwise_or : bitwise or = lor := by
  funext m n
  cases' m with m m <;> cases' n with n n <;> 

Proof state:
case h.h.ofNat.ofNat
m n : ℕ
⊢ bitwise or (ofNat m) (ofNat n) = lor (ofNat m) (ofNat n)

Next tactic:
try {rfl}
theorem bitwise_or : bitwise or = lor := by
  funext m n
  cases' m with m m <;> cases' n with n n <;> try 

Proof state:
case h.h.ofNat.ofNat
m n : ℕ
⊢ bitwise or (ofNat m) (ofNat n) = lor (ofNat m) (ofNat n)

Next tactic:
{rfl}
theorem bitwise_or : bitwise or = lor := by
  funext m n
  cases' m with m m <;> cases' n with n n <;> try {

Proof state:
case h.h.ofNat.ofNat
m n : ℕ
⊢ bitwise or (ofNat m) (ofNat n) = lor (ofNat m) (ofNat n)

Next tactic:
rfl
theorem bitwise_or : bitwise or = lor := by
  funext m n
  cases' m with m m <;> cases' n with n n <;> 

Proof state:
case h.h.ofNat.negSucc
m n : ℕ
⊢ bitwise or (ofNat m) -[n+1] = lor (ofNat m) -[n+1]

Next tactic:
try {rfl}
theorem bitwise_or : bitwise or = lor := by
  funext m n
  cases' m with m m <;> cases' n with n n <;> try 

Proof state:
case h.h.ofNat.negSucc
m n : ℕ
⊢ bitwise or (ofNat m) -[n+1] = lor (ofNat m) -[n+1]

Next tactic:
{rfl}
theorem bitwise_or : bitwise or = lor := by
  funext m n
  cases' m with m m <;> cases' n with n n <;> try {

Proof state:
case h.h.ofNat.negSucc
m n : ℕ
⊢ bitwise or (ofNat m) -[n+1] = lor (ofNat m) -[n+1]

Next tactic:
rfl
theorem bitwise_or : bitwise or = lor := by
  funext m n
  cases' m with m m <;> cases' n with n n <;> 

Proof state:
case h.h.negSucc.ofNat
m n : ℕ
⊢ bitwise or -[m+1] (ofNat n) = lor -[m+1] (ofNat n)

Next tactic:
try {rfl}
theorem bitwise_or : bitwise or = lor := by
  funext m n
  cases' m with m m <;> cases' n with n n <;> try 

Proof state:
case h.h.negSucc.ofNat
m n : ℕ
⊢ bitwise or -[m+1] (ofNat n) = lor -[m+1] (ofNat n)

Next tactic:
{rfl}
theorem bitwise_or : bitwise or = lor := by
  funext m n
  cases' m with m m <;> cases' n with n n <;> try {

Proof state:
case h.h.negSucc.ofNat
m n : ℕ
⊢ bitwise or -[m+1] (ofNat n) = lor -[m+1] (ofNat n)

Next tactic:
rfl