Theorem: propagate_eq_of_seq_eq_le (Lean4bits/lemmas.lean)

State before:
α β α' β' : Type
γ : β → Type
init_carry✝ : α → Bool
next_carry : (α → Bool) → (β → Bool) → α → Bool
next_bit✝ : (α → Bool) → (β → Bool) → (α → Bool) × Bool
inst✝¹ : Fintype α
inst✝ : Fintype α'
seq₁ seq₂ : β → ℕ → Bool
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
i : ℕ
h : ∀ (b : β) (j : ℕ), j ≤ i → seq₁ b j = seq₂ b j
⊢ propagate init_carry next_bit seq₁ i = propagate init_carry next_bit seq₂ i
Tactic:
cases i
State after:
case zero
α β α' β' : Type
γ : β → Type
init_carry✝ : α → Bool
next_carry : (α → Bool) → (β → Bool) → α → Bool
next_bit✝ : (α → Bool) → (β → Bool) → (α → Bool) × Bool
inst✝¹ : Fintype α
inst✝ : Fintype α'
seq₁ seq₂ : β → ℕ → Bool
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
h : ∀ (b : β) (j : ℕ), j ≤ Nat.zero → seq₁ b j = seq₂ b j
⊢ propagate init_carry next_bit seq₁ Nat.zero = propagate init_carry next_bit seq₂ Nat.zero

case succ
α β α' β' : Type
γ : β → Type
init_carry✝ : α → Bool
next_carry : (α → Bool) → (β → Bool) → α → Bool
next_bit✝ : (α → Bool) → (β → Bool) → (α → Bool) × Bool
inst✝¹ : Fintype α
inst✝ : Fintype α'
seq₁ seq₂ : β → ℕ → Bool
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
n✝ : ℕ
h : ∀ (b : β) (j : ℕ), j ≤ Nat.succ n✝ → seq₁ b j = seq₂ b j
⊢ propagate init_carry next_bit seq₁ (Nat.succ n✝) = propagate init_carry next_bit seq₂ (Nat.succ n✝)

State before:
case zero
α β α' β' : Type
γ : β → Type
init_carry✝ : α → Bool
next_carry : (α → Bool) → (β → Bool) → α → Bool
next_bit✝ : (α → Bool) → (β → Bool) → (α → Bool) × Bool
inst✝¹ : Fintype α
inst✝ : Fintype α'
seq₁ seq₂ : β → ℕ → Bool
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
h : ∀ (b : β) (j : ℕ), j ≤ Nat.zero → seq₁ b j = seq₂ b j
⊢ propagate init_carry next_bit seq₁ Nat.zero = propagate init_carry next_bit seq₂ Nat.zero

case succ
α β α' β' : Type
γ : β → Type
init_carry✝ : α → Bool
next_carry : (α → Bool) → (β → Bool) → α → Bool
next_bit✝ : (α → Bool) → (β → Bool) → (α → Bool) × Bool
inst✝¹ : Fintype α
inst✝ : Fintype α'
seq₁ seq₂ : β → ℕ → Bool
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
n✝ : ℕ
h : ∀ (b : β) (j : ℕ), j ≤ Nat.succ n✝ → seq₁ b j = seq₂ b j
⊢ propagate init_carry next_bit seq₁ (Nat.succ n✝) = propagate init_carry next_bit seq₂ (Nat.succ n✝)
Tactic:
{ simp [propagate_zero, h _ 0 (le_refl _)] }
State after:
case succ
α β α' β' : Type
γ : β → Type
init_carry✝ : α → Bool
next_carry : (α → Bool) → (β → Bool) → α → Bool
next_bit✝ : (α → Bool) → (β → Bool) → (α → Bool) × Bool
inst✝¹ : Fintype α
inst✝ : Fintype α'
seq₁ seq₂ : β → ℕ → Bool
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
n✝ : ℕ
h : ∀ (b : β) (j : ℕ), j ≤ Nat.succ n✝ → seq₁ b j = seq₂ b j
⊢ propagate init_carry next_bit seq₁ (Nat.succ n✝) = propagate init_carry next_bit seq₂ (Nat.succ n✝)

State before:
case succ
α β α' β' : Type
γ : β → Type
init_carry✝ : α → Bool
next_carry : (α → Bool) → (β → Bool) → α → Bool
next_bit✝ : (α → Bool) → (β → Bool) → (α → Bool) × Bool
inst✝¹ : Fintype α
inst✝ : Fintype α'
seq₁ seq₂ : β → ℕ → Bool
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
n✝ : ℕ
h : ∀ (b : β) (j : ℕ), j ≤ Nat.succ n✝ → seq₁ b j = seq₂ b j
⊢ propagate init_carry next_bit seq₁ (Nat.succ n✝) = propagate init_carry next_bit seq₂ (Nat.succ n✝)
Tactic:
{ simp only [propagate_succ2, propagate_succ2, h _ _ (le_refl _)]
  congr 2
  apply propagateCarry2_eq_of_seq_eq_lt
  exact λ b j hj => h b j (le_of_lt hj) }
State after:
no goals

State before:
case zero
α β α' β' : Type
γ : β → Type
init_carry✝ : α → Bool
next_carry : (α → Bool) → (β → Bool) → α → Bool
next_bit✝ : (α → Bool) → (β → Bool) → (α → Bool) × Bool
inst✝¹ : Fintype α
inst✝ : Fintype α'
seq₁ seq₂ : β → ℕ → Bool
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
h : ∀ (b : β) (j : ℕ), j ≤ Nat.zero → seq₁ b j = seq₂ b j
⊢ propagate init_carry next_bit seq₁ Nat.zero = propagate init_carry next_bit seq₂ Nat.zero
Tactic:
simp [propagate_zero, h _ 0 (le_refl _)]
State after:
no goals

State before:
case succ
α β α' β' : Type
γ : β → Type
init_carry✝ : α → Bool
next_carry : (α → Bool) → (β → Bool) → α → Bool
next_bit✝ : (α → Bool) → (β → Bool) → (α → Bool) × Bool
inst✝¹ : Fintype α
inst✝ : Fintype α'
seq₁ seq₂ : β → ℕ → Bool
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
n✝ : ℕ
h : ∀ (b : β) (j : ℕ), j ≤ Nat.succ n✝ → seq₁ b j = seq₂ b j
⊢ propagate init_carry next_bit seq₁ (Nat.succ n✝) = propagate init_carry next_bit seq₂ (Nat.succ n✝)
Tactic:
simp only [propagate_succ2, propagate_succ2, h _ _ (le_refl _)]
State after:
case succ
α β α' β' : Type
γ : β → Type
init_carry✝ : α → Bool
next_carry : (α → Bool) → (β → Bool) → α → Bool
next_bit✝ : (α → Bool) → (β → Bool) → (α → Bool) × Bool
inst✝¹ : Fintype α
inst✝ : Fintype α'
seq₁ seq₂ : β → ℕ → Bool
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
n✝ : ℕ
h : ∀ (b : β) (j : ℕ), j ≤ Nat.succ n✝ → seq₁ b j = seq₂ b j
⊢ (next_bit (propagateCarry2 init_carry (fun c b => (next_bit c b).fst) seq₁ (n✝ + 1)) fun j =>
        seq₂ j (Nat.succ n✝)).snd =
    (next_bit (propagateCarry2 init_carry (fun c b => (next_bit c b).fst) seq₂ (n✝ + 1)) fun j => seq₂ j (n✝ + 1)).snd

State before:
case succ
α β α' β' : Type
γ : β → Type
init_carry✝ : α → Bool
next_carry : (α → Bool) → (β → Bool) → α → Bool
next_bit✝ : (α → Bool) → (β → Bool) → (α → Bool) × Bool
inst✝¹ : Fintype α
inst✝ : Fintype α'
seq₁ seq₂ : β → ℕ → Bool
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
n✝ : ℕ
h : ∀ (b : β) (j : ℕ), j ≤ Nat.succ n✝ → seq₁ b j = seq₂ b j
⊢ (next_bit (propagateCarry2 init_carry (fun c b => (next_bit c b).fst) seq₁ (n✝ + 1)) fun j =>
        seq₂ j (Nat.succ n✝)).snd =
    (next_bit (propagateCarry2 init_carry (fun c b => (next_bit c b).fst) seq₂ (n✝ + 1)) fun j => seq₂ j (n✝ + 1)).snd
Tactic:
congr 2
State after:
case succ.e_self.e__carry
α β α' β' : Type
γ : β → Type
init_carry✝ : α → Bool
next_carry : (α → Bool) → (β → Bool) → α → Bool
next_bit✝ : (α → Bool) → (β → Bool) → (α → Bool) × Bool
inst✝¹ : Fintype α
inst✝ : Fintype α'
seq₁ seq₂ : β → ℕ → Bool
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
n✝ : ℕ
h : ∀ (b : β) (j : ℕ), j ≤ Nat.succ n✝ → seq₁ b j = seq₂ b j
⊢ propagateCarry2 init_carry (fun c b => (next_bit c b).fst) seq₁ (n✝ + 1) =
    propagateCarry2 init_carry (fun c b => (next_bit c b).fst) seq₂ (n✝ + 1)

State before:
case succ.e_self.e__carry
α β α' β' : Type
γ : β → Type
init_carry✝ : α → Bool
next_carry : (α → Bool) → (β → Bool) → α → Bool
next_bit✝ : (α → Bool) → (β → Bool) → (α → Bool) × Bool
inst✝¹ : Fintype α
inst✝ : Fintype α'
seq₁ seq₂ : β → ℕ → Bool
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
n✝ : ℕ
h : ∀ (b : β) (j : ℕ), j ≤ Nat.succ n✝ → seq₁ b j = seq₂ b j
⊢ propagateCarry2 init_carry (fun c b => (next_bit c b).fst) seq₁ (n✝ + 1) =
    propagateCarry2 init_carry (fun c b => (next_bit c b).fst) seq₂ (n✝ + 1)
Tactic:
apply propagateCarry2_eq_of_seq_eq_lt
State after:
case succ.e_self.e__carry.h
α β α' β' : Type
γ : β → Type
init_carry✝ : α → Bool
next_carry : (α → Bool) → (β → Bool) → α → Bool
next_bit✝ : (α → Bool) → (β → Bool) → (α → Bool) × Bool
inst✝¹ : Fintype α
inst✝ : Fintype α'
seq₁ seq₂ : β → ℕ → Bool
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
n✝ : ℕ
h : ∀ (b : β) (j : ℕ), j ≤ Nat.succ n✝ → seq₁ b j = seq₂ b j
⊢ ∀ (b : β) (j : ℕ), j < n✝ + 1 → seq₁ b j = seq₂ b j

State before:
case succ.e_self.e__carry.h
α β α' β' : Type
γ : β → Type
init_carry✝ : α → Bool
next_carry : (α → Bool) → (β → Bool) → α → Bool
next_bit✝ : (α → Bool) → (β → Bool) → (α → Bool) × Bool
inst✝¹ : Fintype α
inst✝ : Fintype α'
seq₁ seq₂ : β → ℕ → Bool
init_carry : α → Bool
next_bit : (α → Bool) → (β → Bool) → (α → Bool) × Bool
n✝ : ℕ
h : ∀ (b : β) (j : ℕ), j ≤ Nat.succ n✝ → seq₁ b j = seq₂ b j
⊢ ∀ (b : β) (j : ℕ), j < n✝ + 1 → seq₁ b j = seq₂ b j
Tactic:
exact λ b j hj => h b j (le_of_lt hj)
State after:
no goals