Theorem: Nat.bitwise_lt
File: Mathlib/Data/Nat/Bitwise.lean

tactic: induction x using Nat.binaryRec' generalizing n y with
| z =>
  simp only [bitwise_zero_left]
  split <;> assumption
| @f bx nx hnx ih =>
  cases y using Nat.binaryRec' with
  | z =>
    simp only [bitwise_zero_right]
    split <;> assumption
  | f «by» ny hny =>
    rw [bitwise_bit' _ _ _ _ hnx hny]
    cases n <;> simp_all
state_before: f : Bool → Bool → Bool
x y n : ℕ
hx : x < 2 ^ n
hy : y < 2 ^ n
⊢ bitwise f x y < 2 ^ n
state_after: no goals

tactic: simp only [bitwise_zero_left]
state_before: case z
f : Bool → Bool → Bool
y n : ℕ
hx : 0 < 2 ^ n
hy : y < 2 ^ n
⊢ bitwise f 0 y < 2 ^ n
state_after: case z
f : Bool → Bool → Bool
y n : ℕ
hx : 0 < 2 ^ n
hy : y < 2 ^ n
⊢ (if f false true = true then y else 0) < 2 ^ n

tactic: split <;> assumption
state_before: case z
f : Bool → Bool → Bool
y n : ℕ
hx : 0 < 2 ^ n
hy : y < 2 ^ n
⊢ (if f false true = true then y else 0) < 2 ^ n
state_after: no goals

tactic: cases y using Nat.binaryRec' with
| z =>
  simp only [bitwise_zero_right]
  split <;> assumption
| f «by» ny hny =>
  rw [bitwise_bit' _ _ _ _ hnx hny]
  cases n <;> simp_all
state_before: case f
f : Bool → Bool → Bool
bx : Bool
nx : ℕ
hnx : nx = 0 → bx = true
ih : ∀ {y n : ℕ}, nx < 2 ^ n → y < 2 ^ n → bitwise f nx y < 2 ^ n
y n : ℕ
hx : bit bx nx < 2 ^ n
hy : y < 2 ^ n
⊢ bitwise f (bit bx nx) y < 2 ^ n
state_after: no goals

tactic: simp only [bitwise_zero_right]
state_before: case f.z
f : Bool → Bool → Bool
bx : Bool
nx : ℕ
hnx : nx = 0 → bx = true
ih : ∀ {y n : ℕ}, nx < 2 ^ n → y < 2 ^ n → bitwise f nx y < 2 ^ n
n : ℕ
hx : bit bx nx < 2 ^ n
hy : 0 < 2 ^ n
⊢ bitwise f (bit bx nx) 0 < 2 ^ n
state_after: case f.z
f : Bool → Bool → Bool
bx : Bool
nx : ℕ
hnx : nx = 0 → bx = true
ih : ∀ {y n : ℕ}, nx < 2 ^ n → y < 2 ^ n → bitwise f nx y < 2 ^ n
n : ℕ
hx : bit bx nx < 2 ^ n
hy : 0 < 2 ^ n
⊢ (if f true false = true then bit bx nx else 0) < 2 ^ n

tactic: split <;> assumption
state_before: case f.z
f : Bool → Bool → Bool
bx : Bool
nx : ℕ
hnx : nx = 0 → bx = true
ih : ∀ {y n : ℕ}, nx < 2 ^ n → y < 2 ^ n → bitwise f nx y < 2 ^ n
n : ℕ
hx : bit bx nx < 2 ^ n
hy : 0 < 2 ^ n
⊢ (if f true false = true then bit bx nx else 0) < 2 ^ n
state_after: no goals

tactic: rw [bitwise_bit' _ _ _ _ hnx hny]
state_before: case f.f
f : Bool → Bool → Bool
bx : Bool
nx : ℕ
hnx : nx = 0 → bx = true
ih : ∀ {y n : ℕ}, nx < 2 ^ n → y < 2 ^ n → bitwise f nx y < 2 ^ n
n : ℕ
hx : bit bx nx < 2 ^ n
by : Bool
ny : ℕ
hny : ny = 0 → by = true
hy : bit by ny < 2 ^ n
a✝ : bit by ny = ny → bitwise f (bit bx nx) (bit by ny) < 2 ^ n
⊢ bitwise f (bit bx nx) (bit by ny) < 2 ^ n
state_after: case f.f
f : Bool → Bool → Bool
bx : Bool
nx : ℕ
hnx : nx = 0 → bx = true
ih : ∀ {y n : ℕ}, nx < 2 ^ n → y < 2 ^ n → bitwise f nx y < 2 ^ n
n : ℕ
hx : bit bx nx < 2 ^ n
by : Bool
ny : ℕ
hny : ny = 0 → by = true
hy : bit by ny < 2 ^ n
a✝ : bit by ny = ny → bitwise f (bit bx nx) (bit by ny) < 2 ^ n
⊢ bit (f bx by) (bitwise f nx ny) < 2 ^ n

tactic: cases n <;> simp_all
state_before: case f.f
f : Bool → Bool → Bool
bx : Bool
nx : ℕ
hnx : nx = 0 → bx = true
ih : ∀ {y n : ℕ}, nx < 2 ^ n → y < 2 ^ n → bitwise f nx y < 2 ^ n
n : ℕ
hx : bit bx nx < 2 ^ n
by : Bool
ny : ℕ
hny : ny = 0 → by = true
hy : bit by ny < 2 ^ n
a✝ : bit by ny = ny → bitwise f (bit bx nx) (bit by ny) < 2 ^ n
⊢ bit (f bx by) (bitwise f nx ny) < 2 ^ n
state_after: no goals