-- Lean 4 proof step from Mathlib.Data.Nat.Bitwise (goal)
Goal:
f : Bool → Bool → Bool
h : f Bool.false Bool.false = Bool.false
a : Bool
m : ℕ
b : Bool
n : ℕ
h4 : ∀ (x : ℕ), (x + x + 1) / 2 = x
false :
  (if (if Bool.false = true then 2 * m + 1 else 2 * m) = 0 then
      if f Bool.false true = true then if b = true then 2 * n + 1 else 2 * n else 0
    else
      if (if b = true then 2 * n + 1 else 2 * n) = 0 then
        if f true Bool.false = true then if Bool.false = true then 2 * m + 1 else 2 * m else 0
      else
        if
            f (decide ((if Bool.false = true then 2 * m + 1 else 2 * m) % 2 = 1))
                (decide ((if b = true then 2 * n + 1 else 2 * n) % 2 = 1)) =
              true then
          bitwise f ((if Bool.false = true then 2 * m + 1 else 2 * m) / 2)
                ((if b = true then 2 * n + 1 else 2 * n) / 2) +
              bitwise f ((if Bool.false = true then 2 * m + 1 else 2 * m) / 2)
                ((if b = true then 2 * n + 1 else 2 * n) / 2) +
            1
        else
          bitwise f ((if Bool.false = true then 2 * m + 1 else 2 * m) / 2)
              ((if b = true then 2 * n + 1 else 2 * n) / 2) +
            bitwise f ((if Bool.false = true then 2 * m + 1 else 2 * m) / 2)
              ((if b = true then 2 * n + 1 else 2 * n) / 2)) =
    if f Bool.false b = true then 2 * bitwise f m n + 1 else 2 * bitwise f m n
⊢ (if (if a = true then 2 * m + 1 else 2 * m) = 0 then
      if f Bool.false true = true then if b = true then 2 * n + 1 else 2 * n else 0
    else
      if (if b = true then 2 * n + 1 else 2 * n) = 0 then
        if f true Bool.false = true then if a = true then 2 * m + 1 else 2 * m else 0
      else
        if
            f (decide ((if a = true then 2 * m + 1 else 2 * m) % 2 = 1))
                (decide ((if b = true then 2 * n + 1 else 2 * n) % 2 = 1)) =
              true then
          bitwise f ((if a = true then 2 * m + 1 else 2 * m) / 2) ((if b = true then 2 * n + 1 else 2 * n) / 2) +
              bitwise f ((if a = true then 2 * m + 1 else 2 * m) / 2) ((if b = true then 2 * n + 1 else 2 * n) / 2) +
            1
        else
          bitwise f ((if a = true then 2 * m + 1 else 2 * m) / 2) ((if b = true then 2 * n + 1 else 2 * n) / 2) +
            bitwise f ((if a = true then 2 * m + 1 else 2 * m) / 2) ((if b = true then 2 * n + 1 else 2 * n) / 2)) =
    if f a b = true then 2 * bitwise f m n + 1 else 2 * bitwise f m n
have true : (if (if true = true then 2 * m + 1 else 2 * m) = 0 then
    if f Bool.false true = true then if b = true then 2 * n + 1 else 2 * n else 0
  else
    if (if b = true then 2 * n + 1 else 2 * n) = 0 then
      if f true Bool.false = true then if true = true then 2 * m + 1 else 2 * m else 0
    else
      if
          f (decide ((if true = true then 2 * m + 1 else 2 * m) % 2 = 1))
              (decide ((if b = true then 2 * n + 1 else 2 * n) % 2 = 1)) =
            true then
        bitwise f ((if true = true then 2 * m + 1 else 2 * m) / 2) ((if b = true then 2 * n + 1 else 2 * n) / 2) +
            bitwise f ((if true = true then 2 * m + 1 else 2 * m) / 2) ((if b = true then 2 * n + 1 else 2 * n) / 2) +
          1
      else
        bitwise f ((if true = true then 2 * m + 1 else 2 * m) / 2) ((if b = true then 2 * n + 1 else 2 * n) / 2) +
          bitwise f ((if true = true then 2 * m + 1 else 2 * m) / 2) ((if b = true then 2 * n + 1 else 2 * n) / 2)) =
  if f true b = true then 2 * bitwise f m n + 1 else 2 * bitwise f m n
Tactic: cases a
Cleared hypotheses: a