internlm/Lean-Github huggingface dataset:
Theorem: Metamath.Provable.thm
Proof state before:
axs : Statement → Prop
Γ : Context
σ : VR → Expr
dj✝ : List (VR × VR)
hyps : List Formula
c : CN
s : Expr
pr : Provable axs (Context.mk' dj✝ hyps) (c, s)
hv : subst.ok axs Γ σ
dj : DJ.subst σ (DJ.mk' dj✝) Γ.dj
hh : ∀ (h : Formula), h ∈ hyps → Provable axs Γ (Formula.subst σ h)
e : Expr
inst : Subst σ s e
v : VR
⊢ Provable axs Γ (v.type, σ v)
Tactic:
exact hv v
Proof state after:
no goals
Theorem: Metamath.HH_cons
Proof state before:
axs : Statement → Prop
Γ : Context
σ : VR → Expr
c : CN
f : Expr
hyps : List (CN × Expr)
e : Expr
inst✝ : Subst σ f e
h₁ : Provable axs Γ (c, e)
h₂ : ∀ (h : Formula), h ∈ hyps → Provable axs Γ (Formula.subst σ h)
⊢ Provable axs Γ (Formula.subst σ (c, f))
Tactic:
rw [← @Subst.out σ f e] at h₁
Proof state after:
axs : Statement → Prop
Γ : Context
σ : VR → Expr
c : CN
f : Expr
hyps : List (CN × Expr)
e : Expr
inst✝ : Subst σ f e
h₁ : Provable axs Γ (c, Expr.subst σ f)
h₂ : ∀ (h : Formula), h ∈ hyps → Provable axs Γ (Formula.subst σ h)
⊢ Provable axs Γ (Formula.subst σ (c, f))
Theorem: Metamath.HH_cons
Proof state before:
axs : Statement → Prop
Γ : Context
σ : VR → Expr
c : CN
f : Expr
hyps : List (CN × Expr)
e : Expr
inst✝ : Subst σ f e
h₁ : Provable axs Γ (c, Expr.subst σ f)
h₂ : ∀ (h : Formula), h ∈ hyps → Provable axs Γ (Formula.subst σ h)
⊢ Provable axs Γ (Formula.subst σ (c, f))
Tactic:
exact h₁
Proof state after:
no goals
Theorem: propagateCarry2_succ
Proof state before:
α β α' β' : Type
γ : β → Type
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → α → Bool
x : β → ℕ → Bool
n : ℕ
⊢ propagateCarry2 init_carry next_bit x (n + 1 + 1) = propagateCarry init_carry next_bit x (n + 1)
Tactic:
rw [propagateCarry2, propagateCarry2_succ _ _ _ n, propagateCarry]
Proof state after:
no goals
Theorem: propagateAux_fst_eq_carry
Proof state before:
α β α' β' : Type
γ : β → Type
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
x : β → ℕ → Bool
n : ℕ
⊢ (propagateAux init_carry next_bit x (n + 1)).fst = propagateCarry init_carry (fun c b => (next_bit c b).fst) x (n + 1)
Tactic:
rw [propagateAux, propagateCarry, propagateAux_fst_eq_carry _ _ _ n]
Proof state after:
no goals
Theorem: propagate_succ
Proof state before:
α β α' β' : Type
γ : β → Type
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
x : β → ℕ → Bool
i : ℕ
⊢ propagate init_carry next_bit x (i + 1) =
    (next_bit (propagateCarry init_carry (fun c b => (next_bit c b).fst) x i) fun j => x j (i + 1)).snd
Tactic:
rw [← propagateAux_fst_eq_carry]
Proof state after:
α β α' β' : Type
γ : β → Type
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
x : β → ℕ → Bool
i : ℕ
⊢ propagate init_carry next_bit x (i + 1) =
    (next_bit (propagateAux init_carry (fun c b => next_bit c b) x i).fst fun j => x j (i + 1)).snd
Theorem: propagate_succ
Proof state before:
α β α' β' : Type
γ : β → Type
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
x : β → ℕ → Bool
i : ℕ
⊢ propagate init_carry next_bit x (i + 1) =
    (next_bit (propagateAux init_carry (fun c b => next_bit c b) x i).fst fun j => x j (i + 1)).snd
Tactic:
rfl
Proof state after:
no goals
Theorem: propagate_succ2
Proof state before:
α β α' β' : Type
γ : β → Type
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
x : β → ℕ → Bool
i : ℕ
⊢ propagate init_carry next_bit x (i + 1) =
    (next_bit (propagateCarry2 init_carry (fun c b => (next_bit c b).fst) x (i + 1)) fun j => x j (i + 1)).snd
Tactic:
rw [propagateCarry2_succ, ← propagateAux_fst_eq_carry]
Proof state after:
α β α' β' : Type
γ : β → Type
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
x : β → ℕ → Bool
i : ℕ
⊢ propagate init_carry next_bit x (i + 1) =
    (next_bit (propagateAux init_carry (fun c b => next_bit c b) x i).fst fun j => x j (i + 1)).snd
Theorem: propagate_succ2
Proof state before:
α β α' β' : Type
γ : β → Type
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
x : β → ℕ → Bool
i : ℕ
⊢ propagate init_carry next_bit x (i + 1) =
    (next_bit (propagateAux init_carry (fun c b => next_bit c b) x i).fst fun j => x j (i + 1)).snd
Tactic:
rfl
Proof state after:
no goals
Theorem: propagateCarry_propagate
Proof state before:
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
n : ℕ
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → α → Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
⊢ propagateCarry init_carry next_bit (fun a => propagate (init_carry_x a) (next_bit_x a) fun d => x (f a d)) (n + 1) =
    propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
        (fun carry bits =>
          let f := fun a => next_bit_x a (fun d => carry (inr { fst := a, snd := d })) fun d => bits (f a d);
          let g := next_bit (carry ∘ inl) fun a => (f a).snd;
          Sum.elim g fun x => Prod.fst (f x.fst) x.snd)
        x (n + 1) ∘
      inl
Tactic:
have := propagateCarry_propagate f n
Proof state after:
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
n : ℕ
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → α → Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
this :
  ∀ (init_carry : α → Bool) (next_bit : (α → Bool) → (β → Bool) → α → Bool) (init_carry_x : (a : β) → γ a → Bool)
    (next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool) (x : β' → ℕ → Bool),
    propagateCarry init_carry next_bit (fun a => propagate (init_carry_x a) (next_bit_x a) fun d => x (f a d)) n =
      propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
          (fun carry bits =>
            let f := fun a => next_bit_x a (fun d => carry (inr { fst := a, snd := d })) fun d => bits (f a d);
            let g := next_bit (carry ∘ inl) fun a => (f a).snd;
            Sum.elim g fun x => Prod.fst (f x.fst) x.snd)
          x n ∘
        inl
⊢ propagateCarry init_carry next_bit (fun a => propagate (init_carry_x a) (next_bit_x a) fun d => x (f a d)) (n + 1) =
    propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
        (fun carry bits =>
          let f := fun a => next_bit_x a (fun d => carry (inr { fst := a, snd := d })) fun d => bits (f a d);
          let g := next_bit (carry ∘ inl) fun a => (f a).snd;
          Sum.elim g fun x => Prod.fst (f x.fst) x.snd)
        x (n + 1) ∘
      inl
Theorem: propagateCarry_propagate
Proof state before:
case h.e__bits
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
n : ℕ
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → α → Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
a : α
⊢ (fun i =>
      (next_bit_x i (propagateCarry (init_carry_x i) (fun c b => (next_bit_x i c b).fst) (fun d => x (f i d)) n)
          fun j => x (f i j) (n + 1)).snd) =
    fun a =>
    (next_bit_x a
        (fun d =>
          propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
            (fun carry bits =>
              Sum.elim
                (next_bit (carry ∘ inl) fun a =>
                  (next_bit_x a (fun d => carry (inr { fst := a, snd := d })) fun d => bits (f a d)).snd)
                fun x =>
                Prod.fst (next_bit_x x.fst (fun d => carry (inr { fst := x.fst, snd := d })) fun d => bits (f x.fst d))
                  x.snd)
            x n (inr { fst := a, snd := d }))
        fun d => x (f a d) (n + 1)).snd
Tactic:
ext b
Proof state after:
case h.e__bits.h
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
n : ℕ
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → α → Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
a : α
b : β
⊢ (next_bit_x b (propagateCarry (init_carry_x b) (fun c b_1 => (next_bit_x b c b_1).fst) (fun d => x (f b d)) n)
        fun j => x (f b j) (n + 1)).snd =
    (next_bit_x b
        (fun d =>
          propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
            (fun carry bits =>
              Sum.elim
                (next_bit (carry ∘ inl) fun a =>
                  (next_bit_x a (fun d => carry (inr { fst := a, snd := d })) fun d => bits (f a d)).snd)
                fun x =>
                Prod.fst (next_bit_x x.fst (fun d => carry (inr { fst := x.fst, snd := d })) fun d => bits (f x.fst d))
                  x.snd)
            x n (inr { fst := b, snd := d }))
        fun d => x (f b d) (n + 1)).snd
Theorem: propagateCarry_propagate
Proof state before:
case h.e__bits.h
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
n : ℕ
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → α → Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
a : α
b : β
⊢ (next_bit_x b (propagateCarry (init_carry_x b) (fun c b_1 => (next_bit_x b c b_1).fst) (fun d => x (f b d)) n)
        fun j => x (f b j) (n + 1)).snd =
    (next_bit_x b
        (fun d =>
          propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
            (fun carry bits =>
              Sum.elim
                (next_bit (carry ∘ inl) fun a =>
                  (next_bit_x a (fun d => carry (inr { fst := a, snd := d })) fun d => bits (f a d)).snd)
                fun x =>
                Prod.fst (next_bit_x x.fst (fun d => carry (inr { fst := x.fst, snd := d })) fun d => bits (f x.fst d))
                  x.snd)
            x n (inr { fst := b, snd := d }))
        fun d => x (f b d) (n + 1)).snd
Tactic:
congr
Proof state after:
case h.e__bits.h.e_self.e__carry
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
n : ℕ
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → α → Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
a : α
b : β
⊢ propagateCarry (init_carry_x b) (fun c b_1 => (next_bit_x b c b_1).fst) (fun d => x (f b d)) n = fun d =>
    propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
      (fun carry bits =>
        Sum.elim
          (next_bit (carry ∘ inl) fun a =>
            (next_bit_x a (fun d => carry (inr { fst := a, snd := d })) fun d => bits (f a d)).snd)
          fun x =>
          Prod.fst (next_bit_x x.fst (fun d => carry (inr { fst := x.fst, snd := d })) fun d => bits (f x.fst d)) x.snd)
      x n (inr { fst := b, snd := d })
Theorem: propagateCarry_propagate
Proof state before:
case h.e__bits.h.e_self.e__carry.succ
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → α → Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
a : α
b : β
n : ℕ
ih :
  propagateCarry (init_carry_x b) (fun c b_1 => (next_bit_x b c b_1).fst) (fun d => x (f b d)) n = fun d =>
    propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
      (fun carry bits =>
        Sum.elim
          (next_bit (carry ∘ inl) fun a =>
            (next_bit_x a (fun d => carry (inr { fst := a, snd := d })) fun d => bits (f a d)).snd)
          fun x =>
          Prod.fst (next_bit_x x.fst (fun d => carry (inr { fst := x.fst, snd := d })) fun d => bits (f x.fst d)) x.snd)
      x n (inr { fst := b, snd := d })
⊢ propagateCarry (init_carry_x b) (fun c b_1 => (next_bit_x b c b_1).fst) (fun d => x (f b d)) (Nat.succ n) = fun d =>
    propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
      (fun carry bits =>
        Sum.elim
          (next_bit (carry ∘ inl) fun a =>
            (next_bit_x a (fun d => carry (inr { fst := a, snd := d })) fun d => bits (f a d)).snd)
          fun x =>
          Prod.fst (next_bit_x x.fst (fun d => carry (inr { fst := x.fst, snd := d })) fun d => bits (f x.fst d)) x.snd)
      x (Nat.succ n) (inr { fst := b, snd := d })
Tactic:
. simp [ih]
Proof state after:
no goals
Theorem: propagate_propagate
Proof state before:
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
n : ℕ
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
⊢ propagate init_carry next_bit (fun a => propagate (init_carry_x a) (next_bit_x a) fun d => x (f a d)) (n + 1) =
    propagate (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
      (fun carry bits =>
        let f := fun a => next_bit_x a (fun d => carry (inr { fst := a, snd := d })) fun d => bits (f a d);
        let g := next_bit (carry ∘ inl) fun a => (f a).snd;
        (Sum.elim g.fst fun x => Prod.fst (f x.fst) x.snd, g.snd))
      x (n + 1)
Tactic:
simp only [propagate_succ]
Proof state after:
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
n : ℕ
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
⊢ (next_bit
        (propagateCarry init_carry (fun c b => (next_bit c b).fst)
          (fun a => propagate (init_carry_x a) (next_bit_x a) fun d => x (f a d)) n)
        fun j =>
        (next_bit_x j (propagateCarry (init_carry_x j) (fun c b => (next_bit_x j c b).fst) (fun d => x (f j d)) n)
            fun j_1 => x (f j j_1) (n + 1)).snd).snd =
    (next_bit
        (propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
            (fun c b =>
              Sum.elim
                (next_bit (c ∘ inl) fun a =>
                    (next_bit_x a (fun d => c (inr { fst := a, snd := d })) fun d => b (f a d)).snd).fst
                fun x =>
                Prod.fst (next_bit_x x.fst (fun d => c (inr { fst := x.fst, snd := d })) fun d => b (f x.fst d)) x.snd)
            x n ∘
          inl)
        fun a =>
        (next_bit_x a
            (fun d =>
              propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
                (fun c b =>
                  Sum.elim
                    (next_bit (c ∘ inl) fun a =>
                        (next_bit_x a (fun d => c (inr { fst := a, snd := d })) fun d => b (f a d)).snd).fst
                    fun x =>
                    Prod.fst (next_bit_x x.fst (fun d => c (inr { fst := x.fst, snd := d })) fun d => b (f x.fst d))
                      x.snd)
                x n (inr { fst := a, snd := d }))
            fun d => x (f a d) (n + 1)).snd).snd
Theorem: propagate_propagate
Proof state before:
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
n : ℕ
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
⊢ (next_bit
        (propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
            (fun carry bits =>
              let f := fun a => next_bit_x a (fun d => carry (inr { fst := a, snd := d })) fun d => bits (f a d);
              let g := (next_bit (carry ∘ inl) fun a => (f a).snd).fst;
              Sum.elim g fun x => Prod.fst (f x.fst) x.snd)
            x n ∘
          inl)
        fun j =>
        (next_bit_x j (propagateCarry (init_carry_x j) (fun c b => (next_bit_x j c b).fst) (fun d => x (f j d)) n)
            fun j_1 => x (f j j_1) (n + 1)).snd).snd =
    (next_bit
        (propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
            (fun c b =>
              Sum.elim
                (next_bit (c ∘ inl) fun a =>
                    (next_bit_x a (fun d => c (inr { fst := a, snd := d })) fun d => b (f a d)).snd).fst
                fun x =>
                Prod.fst (next_bit_x x.fst (fun d => c (inr { fst := x.fst, snd := d })) fun d => b (f x.fst d)) x.snd)
            x n ∘
          inl)
        fun a =>
        (next_bit_x a
            (fun d =>
              propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
                (fun c b =>
                  Sum.elim
                    (next_bit (c ∘ inl) fun a =>
                        (next_bit_x a (fun d => c (inr { fst := a, snd := d })) fun d => b (f a d)).snd).fst
                    fun x =>
                    Prod.fst (next_bit_x x.fst (fun d => c (inr { fst := x.fst, snd := d })) fun d => b (f x.fst d))
                      x.snd)
                x n (inr { fst := a, snd := d }))
            fun d => x (f a d) (n + 1)).snd).snd
Tactic:
congr
Proof state after:
case e_self.e__bits
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
n : ℕ
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
⊢ (fun j =>
      (next_bit_x j (propagateCarry (init_carry_x j) (fun c b => (next_bit_x j c b).fst) (fun d => x (f j d)) n)
          fun j_1 => x (f j j_1) (n + 1)).snd) =
    fun a =>
    (next_bit_x a
        (fun d =>
          propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
            (fun c b =>
              Sum.elim
                (next_bit (c ∘ inl) fun a =>
                    (next_bit_x a (fun d => c (inr { fst := a, snd := d })) fun d => b (f a d)).snd).fst
                fun x =>
                Prod.fst (next_bit_x x.fst (fun d => c (inr { fst := x.fst, snd := d })) fun d => b (f x.fst d)) x.snd)
            x n (inr { fst := a, snd := d }))
        fun d => x (f a d) (n + 1)).snd
Theorem: propagate_propagate
Proof state before:
case e_self.e__bits
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
n : ℕ
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
⊢ (fun j =>
      (next_bit_x j (propagateCarry (init_carry_x j) (fun c b => (next_bit_x j c b).fst) (fun d => x (f j d)) n)
          fun j_1 => x (f j j_1) (n + 1)).snd) =
    fun a =>
    (next_bit_x a
        (fun d =>
          propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
            (fun c b =>
              Sum.elim
                (next_bit (c ∘ inl) fun a =>
                    (next_bit_x a (fun d => c (inr { fst := a, snd := d })) fun d => b (f a d)).snd).fst
                fun x =>
                Prod.fst (next_bit_x x.fst (fun d => c (inr { fst := x.fst, snd := d })) fun d => b (f x.fst d)) x.snd)
            x n (inr { fst := a, snd := d }))
        fun d => x (f a d) (n + 1)).snd
Tactic:
ext
Proof state after:
case e_self.e__bits.h
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
n : ℕ
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
x✝ : β
⊢ (next_bit_x x✝ (propagateCarry (init_carry_x x✝) (fun c b => (next_bit_x x✝ c b).fst) (fun d => x (f x✝ d)) n)
        fun j => x (f x✝ j) (n + 1)).snd =
    (next_bit_x x✝
        (fun d =>
          propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
            (fun c b =>
              Sum.elim
                (next_bit (c ∘ inl) fun a =>
                    (next_bit_x a (fun d => c (inr { fst := a, snd := d })) fun d => b (f a d)).snd).fst
                fun x =>
                Prod.fst (next_bit_x x.fst (fun d => c (inr { fst := x.fst, snd := d })) fun d => b (f x.fst d)) x.snd)
            x n (inr { fst := x✝, snd := d }))
        fun d => x (f x✝ d) (n + 1)).snd
Theorem: propagate_propagate
Proof state before:
case e_self.e__bits.h
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
n : ℕ
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
x✝ : β
⊢ (next_bit_x x✝ (propagateCarry (init_carry_x x✝) (fun c b => (next_bit_x x✝ c b).fst) (fun d => x (f x✝ d)) n)
        fun j => x (f x✝ j) (n + 1)).snd =
    (next_bit_x x✝
        (fun d =>
          propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
            (fun c b =>
              Sum.elim
                (next_bit (c ∘ inl) fun a =>
                    (next_bit_x a (fun d => c (inr { fst := a, snd := d })) fun d => b (f a d)).snd).fst
                fun x =>
                Prod.fst (next_bit_x x.fst (fun d => c (inr { fst := x.fst, snd := d })) fun d => b (f x.fst d)) x.snd)
            x n (inr { fst := x✝, snd := d }))
        fun d => x (f x✝ d) (n + 1)).snd
Tactic:
congr
Proof state after:
case e_self.e__bits.h.e_self.e__carry
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
n : ℕ
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
x✝ : β
⊢ propagateCarry (init_carry_x x✝) (fun c b => (next_bit_x x✝ c b).fst) (fun d => x (f x✝ d)) n = fun d =>
    propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
      (fun c b =>
        Sum.elim
          (next_bit (c ∘ inl) fun a =>
              (next_bit_x a (fun d => c (inr { fst := a, snd := d })) fun d => b (f a d)).snd).fst
          fun x =>
          Prod.fst (next_bit_x x.fst (fun d => c (inr { fst := x.fst, snd := d })) fun d => b (f x.fst d)) x.snd)
      x n (inr { fst := x✝, snd := d })
Theorem: propagate_propagate
Proof state before:
case e_self.e__bits.h.e_self.e__carry.succ
α β α' β'✝ : Type
γ δ : β → Type
β' : Type
f : (a : β) → δ a → β'
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
init_carry_x : (a : β) → γ a → Bool
next_bit_x : (a : β) → (γ a → Bool) → (δ a → Bool) → (γ a → Bool) × Bool
x : β' → ℕ → Bool
x✝ : β
n : ℕ
ih :
  propagateCarry (init_carry_x x✝) (fun c b => (next_bit_x x✝ c b).fst) (fun d => x (f x✝ d)) n = fun d =>
    propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
      (fun c b =>
        Sum.elim
          (next_bit (c ∘ inl) fun a =>
              (next_bit_x a (fun d => c (inr { fst := a, snd := d })) fun d => b (f a d)).snd).fst
          fun x =>
          Prod.fst (next_bit_x x.fst (fun d => c (inr { fst := x.fst, snd := d })) fun d => b (f x.fst d)) x.snd)
      x n (inr { fst := x✝, snd := d })
⊢ propagateCarry (init_carry_x x✝) (fun c b => (next_bit_x x✝ c b).fst) (fun d => x (f x✝ d)) (Nat.succ n) = fun d =>
    propagateCarry (fun a => Sum.elim init_carry (fun b => init_carry_x b.fst b.snd) a)
      (fun c b =>
        Sum.elim
          (next_bit (c ∘ inl) fun a =>
              (next_bit_x a (fun d => c (inr { fst := a, snd := d })) fun d => b (f a d)).snd).fst
          fun x =>
          Prod.fst (next_bit_x x.fst (fun d => c (inr { fst := x.fst, snd := d })) fun d => b (f x.fst d)) x.snd)
      x (Nat.succ n) (inr { fst := x✝, snd := d })
Tactic:
. simp [ih]
Proof state after:
no goals