Theorem: Nat.bit1_bitwise_bit0 (Extra/Nat/Bitwise.lean)

State before:
f : Bool → Bool → Bool
x y : Nat
⊢ bitwise f (2 * x + 1) (2 * y) = 2 * bitwise f x y + bif f true false then 1 else 0
Tactic:
if y = 0 then
  have : 2 * y = 0 := by simp [*]
  simp [*]; cases (f true false) <;> simp [*]
else
  have hy : 2 * y ≠ 0 := by intro h; simp [Nat.mul_eq_zero] at h; contradiction
  simp [pos_bitwise_pos _ _ hy]
State after:
no goals

State before:
f : Bool → Bool → Bool
x y : Nat
h✝ : y = 0
⊢ bitwise f (2 * x + 1) (2 * y) = 2 * bitwise f x y + bif f true false then 1 else 0
Tactic:
have : 2 * y = 0 := by simp [*]
State after:
f : Bool → Bool → Bool
x y : Nat
h✝ : y = 0
this : 2 * y = 0
⊢ bitwise f (2 * x + 1) (2 * y) = 2 * bitwise f x y + bif f true false then 1 else 0

State before:
f : Bool → Bool → Bool
x y : Nat
h✝ : y = 0
this : 2 * y = 0
⊢ bitwise f (2 * x + 1) (2 * y) = 2 * bitwise f x y + bif f true false then 1 else 0
Tactic:
simp [*]
State after:
f : Bool → Bool → Bool
x y : Nat
h✝ : y = 0
this : 2 * y = 0
⊢ (bif f true false then 2 * x + 1 else 0) = (2 * bif f true false then x else 0) + bif f true false then 1 else 0

State before:
f : Bool → Bool → Bool
x y : Nat
h✝ : y = 0
this : 2 * y = 0
⊢ (bif f true false then 2 * x + 1 else 0) = (2 * bif f true false then x else 0) + bif f true false then 1 else 0
Tactic:
cases (f true false) <;> simp [*]
State after:
no goals

State before:
f : Bool → Bool → Bool
x y : Nat
h✝ : y = 0
⊢ 2 * y = 0
Tactic:
simp [*]
State after:
no goals

State before:
f : Bool → Bool → Bool
x y : Nat
h✝ : ¬y = 0
⊢ bitwise f (2 * x + 1) (2 * y) = 2 * bitwise f x y + bif f true false then 1 else 0
Tactic:
have hy : 2 * y ≠ 0 := by intro h; simp [Nat.mul_eq_zero] at h; contradiction
State after:
f : Bool → Bool → Bool
x y : Nat
h✝ : ¬y = 0
hy : 2 * y ≠ 0
⊢ bitwise f (2 * x + 1) (2 * y) = 2 * bitwise f x y + bif f true false then 1 else 0

State before:
f : Bool → Bool → Bool
x y : Nat
h✝ : ¬y = 0
hy : 2 * y ≠ 0
⊢ bitwise f (2 * x + 1) (2 * y) = 2 * bitwise f x y + bif f true false then 1 else 0
Tactic:
simp [pos_bitwise_pos _ _ hy]
State after:
no goals

State before:
f : Bool → Bool → Bool
x y : Nat
h✝ : ¬y = 0
⊢ 2 * y ≠ 0
Tactic:
intro h
State after:
f : Bool → Bool → Bool
x y : Nat
h✝ : ¬y = 0
h : 2 * y = 0
⊢ False

State before:
f : Bool → Bool → Bool
x y : Nat
h✝ : ¬y = 0
h : 2 * y = 0
⊢ False
Tactic:
simp [Nat.mul_eq_zero] at h
State after:
f : Bool → Bool → Bool
x y : Nat
h✝ : ¬y = 0
h : y = 0
⊢ False

State before:
f : Bool → Bool → Bool
x y : Nat
h✝ : ¬y = 0
h : y = 0
⊢ False
Tactic:
contradiction
State after:
no goals