-- Mathlib/CategoryTheory/Limits/Shapes/SequentialProduct.lean
lemma functorMap_epi (n : ℕ) : Epi (functorMap f n)

Proof state:
case inst
C : Type u_1
M N : ℕ → C
inst✝⁵ : Category.{u_2, u_1} C
f : (n : ℕ) → M n ⟶ N n
inst✝⁴ : HasProductsOfShape ℕ C
inst✝³ : HasZeroMorphisms C
inst✝² : HasFiniteBiproducts C
inst✝¹ : HasCountableProducts C
inst✝ : ∀ (n : ℕ), Epi (f n)
n : ℕ
⊢ Epi
    (Pi.map fun i =>
      if h : ↑i < n then eqToHom ⋯ else if h' : ↑i < n + 1 then eqToHom ⋯ ≫ f ↑i ≫ eqToHom ⋯ else eqToHom ⋯)

Tactic:
apply ( config := { allowSynthFailures := true } ) Pi.map_epi

Result:
case inst
C : Type u_1
M N : ℕ → C
inst✝⁵ : Category.{u_2, u_1} C
f : (n : ℕ) → M n ⟶ N n
inst✝⁴ : HasProductsOfShape ℕ C
inst✝³ : HasZeroMorphisms C
inst✝² : HasFiniteBiproducts C
inst✝¹ : HasCountableProducts C
inst✝ : ∀ (n : ℕ), Epi (f n)
n : ℕ
⊢ ∀ (j : { x // x < n + 1 }),
    Epi (if h : ↑j < n then eqToHom ⋯ else if h' : ↑j < n + 1 then eqToHom ⋯ ≫ f ↑j ≫ eqToHom ⋯ else eqToHom ⋯)

Proof state:
case inst
C : Type u_1
M N : ℕ → C
inst✝⁵ : Category.{u_2, u_1} C
f : (n : ℕ) → M n ⟶ N n
inst✝⁴ : HasProductsOfShape ℕ C
inst✝³ : HasZeroMorphisms C
inst✝² : HasFiniteBiproducts C
inst✝¹ : HasCountableProducts C
inst✝ : ∀ (n : ℕ), Epi (f n)
n : ℕ
⊢ IsIso
    (Pi.map fun i =>
      if h : ↑i < n then eqToHom ⋯ else if h' : ↑i < n + 1 then eqToHom ⋯ ≫ f ↑i ≫ eqToHom ⋯ else eqToHom ⋯)

Tactic:
apply ( config := { allowSynthFailures := true } ) Pi.map_isIso

Result:
case inst
C : Type u_1
M N : ℕ → C
inst✝⁵ : Category.{u_2, u_1} C
f : (n : ℕ) → M n ⟶ N n
inst✝⁴ : HasProductsOfShape ℕ C
inst✝³ : HasZeroMorphisms C
inst✝² : HasFiniteBiproducts C
inst✝¹ : HasCountableProducts C
inst✝ : ∀ (n : ℕ), Epi (f n)
n : ℕ
⊢ ∀ (b : { x // ¬x < n + 1 }),
    IsIso (if h : ↑b < n then eqToHom ⋯ else if h' : ↑b < n + 1 then eqToHom ⋯ ≫ f ↑b ≫ eqToHom ⋯ else eqToHom ⋯)

Proof state:
case inst
C : Type u_1
M N : ℕ → C
inst✝⁵ : Category.{u_2, u_1} C
f : (n : ℕ) → M n ⟶ N n
inst✝⁴ : HasProductsOfShape ℕ C
inst✝³ : HasZeroMorphisms C
inst✝² : HasFiniteBiproducts C
inst✝¹ : HasCountableProducts C
inst✝ : ∀ (n : ℕ), Epi (f n)
n : ℕ
⊢ Epi
    (prod.map
        (Pi.map fun i =>
          if h : ↑i < n then eqToHom ⋯ else if h' : ↑i < n + 1 then eqToHom ⋯ ≫ f ↑i ≫ eqToHom ⋯ else eqToHom ⋯)
        (Pi.map fun i =>
          if h : ↑i < n then eqToHom ⋯ else if h' : ↑i < n + 1 then eqToHom ⋯ ≫ f ↑i ≫ eqToHom ⋯ else eqToHom ⋯) ≫
      ((Pi.binaryFanOfPropIsLimit (fun m => if x : m < n then M m else N m) fun m => m < n + 1).conePointUniqueUpToIso
          (prodIsProd (∏ᶜ fun i => if x : ↑i < n then M ↑i else N ↑i)
            (∏ᶜ fun i => if x : ↑i < n then M ↑i else N ↑i))).inv)

Tactic:
apply ( config := { allowSynthFailures := true } ) epi_comp

Result:
case inst
C : Type u_1
M N : ℕ → C
inst✝⁵ : Category.{u_2, u_1} C
f : (n : ℕ) → M n ⟶ N n
inst✝⁴ : HasProductsOfShape ℕ C
inst✝³ : HasZeroMorphisms C
inst✝² : HasFiniteBiproducts C
inst✝¹ : HasCountableProducts C
inst✝ : ∀ (n : ℕ), Epi (f n)
n : ℕ
⊢ Epi
    (prod.map
      (Pi.map fun i =>
        if h : ↑i < n then eqToHom ⋯ else if h' : ↑i < n + 1 then eqToHom ⋯ ≫ f ↑i ≫ eqToHom ⋯ else eqToHom ⋯)
      (Pi.map fun i =>
        if h : ↑i < n then eqToHom ⋯ else if h' : ↑i < n + 1 then eqToHom ⋯ ≫ f ↑i ≫ eqToHom ⋯ else eqToHom ⋯))

Proof state:
C : Type u_1
M N : ℕ → C
inst✝⁵ : Category.{u_2, u_1} C
f : (n : ℕ) → M n ⟶ N n
inst✝⁴ : HasProductsOfShape ℕ C
inst✝³ : HasZeroMorphisms C
inst✝² : HasFiniteBiproducts C
inst✝¹ : HasCountableProducts C
inst✝ : ∀ (n : ℕ), Epi (f n)
n : ℕ
⊢ Epi (functorMap f n)

Tactic:
rw [functorMap, Pi.map_eq_prod_map (P := fun m : ℕ ↦ m < n + 1)]

Result:
C : Type u_1
M N : ℕ → C
inst✝⁵ : Category.{u_2, u_1} C
f : (n : ℕ) → M n ⟶ N n
inst✝⁴ : HasProductsOfShape ℕ C
inst✝³ : HasZeroMorphisms C
inst✝² : HasFiniteBiproducts C
inst✝¹ : HasCountableProducts C
inst✝ : ∀ (n : ℕ), Epi (f n)
n : ℕ
⊢ Epi
    (((Pi.binaryFanOfPropIsLimit (fun m => if x : m < n + 1 then M m else N m) fun m =>
              m < n + 1).conePointUniqueUpToIso
          (prodIsProd (∏ᶜ fun i => if x : ↑i < n + 1 then M ↑i else N ↑i)
            (∏ᶜ fun i => if x : ↑i < n + 1 then M ↑i else N ↑i))).hom ≫
      prod.map
          (Pi.map fun i =>
            if h : ↑i < n then eqToHom ⋯ else if h' : ↑i < n + 1 then eqToHom ⋯ ≫ f ↑i ≫ eqToHom ⋯ else eqToHom ⋯)
          (Pi.map fun i =>
            if h : ↑i < n then eqToHom ⋯ else if h' : ↑i < n + 1 then eqToHom ⋯ ≫ f ↑i ≫ eqToHom ⋯ else eqToHom ⋯) ≫
        ((Pi.binaryFanOfPropIsLimit (fun m => if x : m < n then M m else N m) fun m => m < n + 1).conePointUniqueUpToIso
            (prodIsProd (∏ᶜ fun i => if x : ↑i < n then M ↑i else N ↑i)
              (∏ᶜ fun i => if x : ↑i < n then M ↑i else N ↑i))).inv)

Proof state:
case inst.isFalse
C : Type u_1
M N : ℕ → C
inst✝⁵ : Category.{u_2, u_1} C
f : (n : ℕ) → M n ⟶ N n
inst✝⁴ : HasProductsOfShape ℕ C
inst✝³ : HasZeroMorphisms C
inst✝² : HasFiniteBiproducts C
inst✝¹ : HasCountableProducts C
inst✝ : ∀ (n : ℕ), Epi (f n)
n val✝ : ℕ
property✝ : val✝ < n + 1
h✝ : ¬↑⟨val✝, property✝⟩ < n
⊢ Epi (eqToHom ⋯ ≫ f ↑⟨val✝, property✝⟩ ≫ eqToHom ⋯)

Tactic:
infer_instance

Result:
no goals

Proof state:
case inst.isTrue
C : Type u_1
M N : ℕ → C
inst✝⁵ : Category.{u_2, u_1} C
f : (n : ℕ) → M n ⟶ N n
inst✝⁴ : HasProductsOfShape ℕ C
inst✝³ : HasZeroMorphisms C
inst✝² : HasFiniteBiproducts C
inst✝¹ : HasCountableProducts C
inst✝ : ∀ (n : ℕ), Epi (f n)
n val✝ : ℕ
property✝ : ¬val✝ < n + 1
h✝ : ↑⟨val✝, property✝⟩ < n
⊢ IsIso (eqToHom ⋯)

case inst.isFalse
C : Type u_1
M N : ℕ → C
inst✝⁵ : Category.{u_2, u_1} C
f : (n : ℕ) → M n ⟶ N n
inst✝⁴ : HasProductsOfShape ℕ C
inst✝³ : HasZeroMorphisms C
inst✝² : HasFiniteBiproducts C
inst✝¹ : HasCountableProducts C
inst✝ : ∀ (n : ℕ), Epi (f n)
n val✝ : ℕ
property✝ : ¬val✝ < n + 1
h✝ : ¬↑⟨val✝, property✝⟩ < n
⊢ IsIso (eqToHom ⋯)

Tactic:
all_goals infer_instance

Result:
no goals

Proof state:
case inst
C : Type u_1
M N : ℕ → C
inst✝⁵ : Category.{u_2, u_1} C
f : (n : ℕ) → M n ⟶ N n
inst✝⁴ : HasProductsOfShape ℕ C
inst✝³ : HasZeroMorphisms C
inst✝² : HasFiniteBiproducts C
inst✝¹ : HasCountableProducts C
inst✝ : ∀ (n : ℕ), Epi (f n)
n : ℕ
⊢ ∀ (b : { x // ¬x < n + 1 }),
    IsIso (if h : ↑b < n then eqToHom ⋯ else if h' : ↑b < n + 1 then eqToHom ⋯ ≫ f ↑b ≫ eqToHom ⋯ else eqToHom ⋯)

Tactic:
intro ⟨_, _⟩

Result:
case inst
C : Type u_1
M N : ℕ → C
inst✝⁵ : Category.{u_2, u_1} C
f : (n : ℕ) → M n ⟶ N n
inst✝⁴ : HasProductsOfShape ℕ C
inst✝³ : HasZeroMorphisms C
inst✝² : HasFiniteBiproducts C
inst✝¹ : HasCountableProducts C
inst✝ : ∀ (n : ℕ), Epi (f n)
n val✝ : ℕ
property✝ : ¬val✝ < n + 1
⊢ IsIso
    (if h : ↑⟨val✝, property✝⟩ < n then eqToHom ⋯
    else if h' : ↑⟨val✝, property✝⟩ < n + 1 then eqToHom ⋯ ≫ f ↑⟨val✝, property✝⟩ ≫ eqToHom ⋯ else eqToHom ⋯)

Proof state:
case inst.isTrue
C : Type u_1
M N : ℕ → C
inst✝⁵ : Category.{u_2, u_1} C
f : (n : ℕ) → M n ⟶ N n
inst✝⁴ : HasProductsOfShape ℕ C
inst✝³ : HasZeroMorphisms C
inst✝² : HasFiniteBiproducts C
inst✝¹ : HasCountableProducts C
inst✝ : ∀ (n : ℕ), Epi (f n)
n val✝ : ℕ
property✝ : val✝ < n + 1
h✝ : ↑⟨val✝, property✝⟩ < n
⊢ Epi (eqToHom ⋯)

case inst.isFalse
C : Type u_1
M N : ℕ → C
inst✝⁵ : Category.{u_2, u_1} C
f : (n : ℕ) → M n ⟶ N n
inst✝⁴ : HasProductsOfShape ℕ C
inst✝³ : HasZeroMorphisms C
inst✝² : HasFiniteBiproducts C
inst✝¹ : HasCountableProducts C
inst✝ : ∀ (n : ℕ), Epi (f n)
n val✝ : ℕ
property✝ : val✝ < n + 1
h✝ : ¬↑⟨val✝, property✝⟩ < n
⊢ Epi (eqToHom ⋯ ≫ f ↑⟨val✝, property✝⟩ ≫ eqToHom ⋯)

Tactic:
all_goals infer_instance

Result:
no goals