case ofNat.ofNat
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match bif f false false then -[Nat.bitwise' (fun x y => !f x y) a✝¹ a✝+1] else ↑(Nat.bitwise' f a✝¹ a✝), k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (Nat.testBit a✝¹ k) (Nat.testBit a✝ k)

case ofNat.negSucc
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f false !false then -[Nat.bitwise' (fun x y => !f x !y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f x !y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (Nat.testBit a✝¹ k) !Nat.testBit a✝ k

case negSucc.ofNat
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) false then -[Nat.bitwise' (fun x y => !f (!x) y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) (Nat.testBit a✝ k)

case negSucc.negSucc
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) !false then -[Nat.bitwise' (fun x y => !f (!x) !y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) !y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) !Nat.testBit a✝ k
f : Bool → Bool → Bool
m n : ℤ
k : ℕ
⊢ testBit (bitwise f m n) k = f (testBit m k) (testBit n k)
cases m <;> cases n <;> simp only [testBit, bitwise, natBitwise]
case ofNat.negSucc
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f false !false then -[Nat.bitwise' (fun x y => !f x !y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f x !y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (Nat.testBit a✝¹ k) !Nat.testBit a✝ k

case negSucc.ofNat
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) false then -[Nat.bitwise' (fun x y => !f (!x) y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) (Nat.testBit a✝ k)

case negSucc.negSucc
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) !false then -[Nat.bitwise' (fun x y => !f (!x) !y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) !y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) !Nat.testBit a✝ k
case ofNat.ofNat
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match bif f false false then -[Nat.bitwise' (fun x y => !f x y) a✝¹ a✝+1] else ↑(Nat.bitwise' f a✝¹ a✝), k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (Nat.testBit a✝¹ k) (Nat.testBit a✝ k)

case ofNat.negSucc
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f false !false then -[Nat.bitwise' (fun x y => !f x !y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f x !y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (Nat.testBit a✝¹ k) !Nat.testBit a✝ k

case negSucc.ofNat
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) false then -[Nat.bitwise' (fun x y => !f (!x) y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) (Nat.testBit a✝ k)

case negSucc.negSucc
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) !false then -[Nat.bitwise' (fun x y => !f (!x) !y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) !y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) !Nat.testBit a✝ k
. by_cases h : f false false <;> simp [h]
case negSucc.ofNat
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) false then -[Nat.bitwise' (fun x y => !f (!x) y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) (Nat.testBit a✝ k)

case negSucc.negSucc
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) !false then -[Nat.bitwise' (fun x y => !f (!x) !y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) !y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) !Nat.testBit a✝ k
case ofNat.negSucc
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f false !false then -[Nat.bitwise' (fun x y => !f x !y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f x !y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (Nat.testBit a✝¹ k) !Nat.testBit a✝ k

case negSucc.ofNat
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) false then -[Nat.bitwise' (fun x y => !f (!x) y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) (Nat.testBit a✝ k)

case negSucc.negSucc
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) !false then -[Nat.bitwise' (fun x y => !f (!x) !y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) !y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) !Nat.testBit a✝ k
. by_cases h : f false true <;> simp [h]
case negSucc.negSucc
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) !false then -[Nat.bitwise' (fun x y => !f (!x) !y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) !y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) !Nat.testBit a✝ k
case negSucc.ofNat
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) false then -[Nat.bitwise' (fun x y => !f (!x) y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) (Nat.testBit a✝ k)

case negSucc.negSucc
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) !false then -[Nat.bitwise' (fun x y => !f (!x) !y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) !y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) !Nat.testBit a✝ k
. by_cases h : f true false <;> simp [h]
no goals
case negSucc.negSucc
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) !false then -[Nat.bitwise' (fun x y => !f (!x) !y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) !y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) !Nat.testBit a✝ k
. by_cases h : f true true <;> simp [h]
no goals
case ofNat.ofNat
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match bif f false false then -[Nat.bitwise' (fun x y => !f x y) a✝¹ a✝+1] else ↑(Nat.bitwise' f a✝¹ a✝), k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (Nat.testBit a✝¹ k) (Nat.testBit a✝ k)
by_cases h : f false false <;> simp [h]
no goals
case ofNat.negSucc
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f false !false then -[Nat.bitwise' (fun x y => !f x !y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f x !y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (Nat.testBit a✝¹ k) !Nat.testBit a✝ k
by_cases h : f false true <;> simp [h]
no goals
case negSucc.ofNat
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) false then -[Nat.bitwise' (fun x y => !f (!x) y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) (Nat.testBit a✝ k)
by_cases h : f true false <;> simp [h]
no goals
case negSucc.negSucc
f : Bool → Bool → Bool
k a✝¹ a✝ : ℕ
⊢ (match
      bif f (!false) !false then -[Nat.bitwise' (fun x y => !f (!x) !y) a✝¹ a✝+1]
      else ↑(Nat.bitwise' (fun x y => f (!x) !y) a✝¹ a✝),
      k with
    | ofNat m, n => Nat.testBit m n
    | -[m+1], n => !Nat.testBit m n) =
    f (!Nat.testBit a✝¹ k) !Nat.testBit a✝ k
by_cases h : f true true <;> simp [h]