Theorem: Nat.bitwise'_bit_aux
File: Mathlib/Init/Data/Nat/Bitwise.lean

tactic: funext n
state_before: f : Bool → Bool → Bool
h : f false false = false
⊢ (binaryRec (bif f true false then bit false 0 else 0) fun b n x => bit (f false b) (bif f false true then n else 0)) =
    fun n => bif f false true then n else 0

tactic: apply bitCasesOn n
state_before: case h
f : Bool → Bool → Bool
h : f false false = false
n : ℕ
⊢ binaryRec (bif f true false then bit false 0 else 0) (fun b n x => bit (f false b) (bif f false true then n else 0))
      n =
    bif f false true then n else 0

tactic: intro b n
state_before: case h
f : Bool → Bool → Bool
h : f false false = false
n : ℕ
⊢ ∀ (b : Bool) (n : ℕ),
    binaryRec (bif f true false then bit false 0 else 0) (fun b n x => bit (f false b) (bif f false true then n else 0))
        (bit b n) =
      bif f false true then bit b n else 0

tactic: rw [binaryRec_eq]
state_before: case h
f : Bool → Bool → Bool
h : f false false = false
n✝ : ℕ
b : Bool
n : ℕ
⊢ binaryRec (bif f true false then bit false 0 else 0) (fun b n x => bit (f false b) (bif f false true then n else 0))
      (bit b n) =
    bif f false true then bit b n else 0

tactic: cases b
<;> try rw [h]
<;> induction' fft : f false true
<;> simp [cond]
state_before: case h
f : Bool → Bool → Bool
h : f false false = false
n✝ : ℕ
b : Bool
n : ℕ
⊢ bit (f false b) (bif f false true then n else 0) = bif f false true then bit b n else 0

tactic: cases f false true
state_before: case h.true
f : Bool → Bool → Bool
h : f false false = false
n✝ n : ℕ
⊢ bit (f false true) (bif f false true then n else 0) = bif f false true then bit true n else 0

tactic: case h.true.false => simp
state_before: case h.true.false
f : Bool → Bool → Bool
h : f false false = false
n✝ n : ℕ
⊢ bit false (bif false then n else 0) = bif false then bit true n else 0

case h.true.true
f : Bool → Bool → Bool
h : f false false = false
n✝ n : ℕ
⊢ bit true (bif true then n else 0) = bif true then bit true n else 0

tactic: case h.true.true => simp
state_before: case h.true.true
f : Bool → Bool → Bool
h : f false false = false
n✝ n : ℕ
⊢ bit true (bif true then n else 0) = bif true then bit true n else 0

tactic: rw [h]
<;> induction' fft : f false true
<;> simp [cond]
state_before: case h.true
f : Bool → Bool → Bool
h : f false false = false
n✝ n : ℕ
⊢ bit (f false true) (bif f false true then n else 0) = bif f false true then bit true n else 0

tactic: simp
state_before: f : Bool → Bool → Bool
h : f false false = false
n✝ n : ℕ
⊢ bit false (bif false then n else 0) = bif false then bit true n else 0

tactic: simp
state_before: f : Bool → Bool → Bool
h : f false false = false
n✝ n : ℕ
⊢ bit true (bif true then n else 0) = bif true then bit true n else 0

tactic: rw [h, show cond (f false true) 0 0 = 0 by cases f false true <;> rfl,
    show cond (f true false) (bit false 0) 0 = 0 by cases f true false <;> rfl]
state_before: case h.h
f : Bool → Bool → Bool
h : f false false = false
n✝ : ℕ
b : Bool
n : ℕ
⊢ bit (f false false) (bif f false true then 0 else 0) = bif f true false then bit false 0 else 0

tactic: rfl
state_before: case h.h
f : Bool → Bool → Bool
h : f false false = false
n✝ : ℕ
b : Bool
n : ℕ
⊢ bit false 0 = 0

tactic: cases f false true <;> rfl
state_before: f : Bool → Bool → Bool
h : f false false = false
n✝ : ℕ
b : Bool
n : ℕ
⊢ (bif f false true then 0 else 0) = 0

tactic: cases f true false <;> rfl
state_before: f : Bool → Bool → Bool
h : f false false = false
n✝ : ℕ
b : Bool
n : ℕ
⊢ (bif f true false then bit false 0 else 0) = 0