Theorem: add_eq_propagate (Lean4bits/lemmas.lean)

State before:
α β α' β' : Type
γ : β → Type
x y : ℕ → Bool
⊢ addSeq x y =
    propagate (fun x => false)
      (fun carry bits =>
        (fun x => bits true && bits false || bits false && carry () || bits true && carry (),
          _root_.xor (bits true) (_root_.xor (bits false) (carry ()))))
      fun b => bif b then x else y
Tactic:
ext n
State after:
case h
α β α' β' : Type
γ : β → Type
x y : ℕ → Bool
n : ℕ
⊢ addSeq x y n =
    propagate (fun x => false)
      (fun carry bits =>
        (fun x => bits true && bits false || bits false && carry () || bits true && carry (),
          _root_.xor (bits true) (_root_.xor (bits false) (carry ()))))
      (fun b => bif b then x else y) n

State before:
case h
α β α' β' : Type
γ : β → Type
x y : ℕ → Bool
n : ℕ
⊢ addSeq x y n =
    propagate (fun x => false)
      (fun carry bits =>
        (fun x => bits true && bits false || bits false && carry () || bits true && carry (),
          _root_.xor (bits true) (_root_.xor (bits false) (carry ()))))
      (fun b => bif b then x else y) n
Tactic:
match n with
| 0 => simp [addSeq, addSeqAux]
| 1 => simp [addSeq, addSeqAux, propagate, propagateAux]
| n+2 => simp [addSeq, addSeqAux, addSeqAux_eq_propagateCarry, propagate_succ]
State after:
no goals

State before:
α β α' β' : Type
γ : β → Type
x y : ℕ → Bool
n : ℕ
⊢ addSeq x y 0 =
    propagate (fun x => false)
      (fun carry bits =>
        (fun x => bits true && bits false || bits false && carry () || bits true && carry (),
          _root_.xor (bits true) (_root_.xor (bits false) (carry ()))))
      (fun b => bif b then x else y) 0
Tactic:
simp [addSeq, addSeqAux]
State after:
no goals

State before:
α β α' β' : Type
γ : β → Type
x y : ℕ → Bool
n : ℕ
⊢ addSeq x y 1 =
    propagate (fun x => false)
      (fun carry bits =>
        (fun x => bits true && bits false || bits false && carry () || bits true && carry (),
          _root_.xor (bits true) (_root_.xor (bits false) (carry ()))))
      (fun b => bif b then x else y) 1
Tactic:
simp [addSeq, addSeqAux, propagate, propagateAux]
State after:
no goals

State before:
α β α' β' : Type
γ : β → Type
x y : ℕ → Bool
n✝ n : ℕ
⊢ addSeq x y (n + 2) =
    propagate (fun x => false)
      (fun carry bits =>
        (fun x => bits true && bits false || bits false && carry () || bits true && carry (),
          _root_.xor (bits true) (_root_.xor (bits false) (carry ()))))
      (fun b => bif b then x else y) (n + 2)
Tactic:
simp [addSeq, addSeqAux, addSeqAux_eq_propagateCarry, propagate_succ]
State after:
no goals