l3lab/ntp-mathlib huggingface dataset:
theorem coeff_add_of_disjoint (x y : 𝕎 R) (h : ∀ n, x.coeff n = 0 ∨ y.coeff n = 0) :
    (x + y).coeff n = x.coeff n + y.coeff n := by
  let P : ℕ → Prop := fun n => y.coeff n = 0
  haveI : DecidablePred P := Classical.decPred P
  set z := mk p fun n => if P n then x.coeff n else y.coeff n
  have hx : select P z = x := by
    ext1 n; rw [select, coeff_mk, coeff_mk]
    split_ifs with hn
    · rfl
    · rw [(h n).resolve_right hn]
  have hy : select (fun i => ¬P i) z = y := by
    ext1 n; rw [select, coeff_mk, coeff_mk]
    split_ifs with hn
    · exact hn.symm
    · rfl
  calc
    (x + y).coeff n = z.coeff n := by rw [← hx, ← hy, select_add_select_not P z]
    _ = x.coeff n + y.coeff n := by
      simp only [mk._eq_1]
      split_ifs with y0
      · rw [y0, add_zero]
      · 

Proof state:
case neg
p : ℕ
hp : Fact (Nat.Prime p)
n : ℕ
R : Type u_1
inst✝ : CommRing R
P✝ : ℕ → Prop
x y : 𝕎 R
h : ∀ (n : ℕ), coeff x n = 0 ∨ coeff y n = 0
P : ℕ → Prop := fun n => coeff y n = 0
this : DecidablePred P
z : 𝕎 R := mk p fun n => if P n then coeff x n else coeff y n
hx : select P z = x
hy : select (fun i => ¬P i) z = y
y0 : ¬coeff y n = 0
⊢ coeff y n = coeff x n + coeff y n

Next tactic:
rw [h n |>.resolve_right y0, zero_add]
@[simp]
theorem init_add_tail (x : 𝕎 R) (n : ℕ) : init n x + tail n x = x := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
n✝ : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
n : ℕ
⊢ init n x + tail n x = x

Next tactic:
simp only [init, tail, ← not_lt, select_add_select_not]
@[simp]
theorem init_init (x : 𝕎 R) (n : ℕ) : init n (init n x) = init n x := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
n✝ : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
n : ℕ
⊢ init n (init n x) = init n x

Next tactic:
rw [ext_iff]
@[simp]
theorem init_init (x : 𝕎 R) (n : ℕ) : init n (init n x) = init n x := by
  rw [ext_iff]
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
n✝ : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
n : ℕ
⊢ ∀ (n_1 : ℕ), coeff (init n (init n x)) n_1 = coeff (init n x) n_1

Next tactic:
intro i
@[simp]
theorem init_init (x : 𝕎 R) (n : ℕ) : init n (init n x) = init n x := by
  rw [ext_iff]
  intro i
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
n✝ : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
n i : ℕ
⊢ coeff (init n (init n x)) i = coeff (init n x) i

Next tactic:
simp only [WittVector.init, WittVector.select, WittVector.coeff_mk]
@[simp]
theorem init_init (x : 𝕎 R) (n : ℕ) : init n (init n x) = init n x := by
  rw [ext_iff]
  intro i
  simp only [WittVector.init, WittVector.select, WittVector.coeff_mk]
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
n✝ : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
n i : ℕ
⊢ (if i < n then if i < n then coeff x i else 0 else 0) = if i < n then coeff x i else 0

Next tactic:
by_cases hi : i < n
@[simp]
theorem init_init (x : 𝕎 R) (n : ℕ) : init n (init n x) = init n x := by
  rw [ext_iff]
  intro i
  simp only [WittVector.init, WittVector.select, WittVector.coeff_mk]
  by_cases hi : i < n <;> 

Proof state:
case pos
p : ℕ
hp : Fact (Nat.Prime p)
n✝ : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
n i : ℕ
hi : i < n
⊢ (if i < n then if i < n then coeff x i else 0 else 0) = if i < n then coeff x i else 0

Next tactic:
simp [hi]
@[simp]
theorem init_init (x : 𝕎 R) (n : ℕ) : init n (init n x) = init n x := by
  rw [ext_iff]
  intro i
  simp only [WittVector.init, WittVector.select, WittVector.coeff_mk]
  by_cases hi : i < n <;> 

Proof state:
case neg
p : ℕ
hp : Fact (Nat.Prime p)
n✝ : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
n i : ℕ
hi : ¬i < n
⊢ (if i < n then if i < n then coeff x i else 0 else 0) = if i < n then coeff x i else 0

Next tactic:
simp [hi]
theorem init_add (x y : 𝕎 R) (n : ℕ) : init n (x + y) = init n (init n x + init n y) := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
n✝ : ℕ
R : Type u_1
inst✝ : CommRing R
x y : 𝕎 R
n : ℕ
⊢ init n (x + y) = init n (init n x + init n y)

Next tactic:
init_ring using wittAdd_vars
theorem init_mul (x y : 𝕎 R) (n : ℕ) : init n (x * y) = init n (init n x * init n y) := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
n✝ : ℕ
R : Type u_1
inst✝ : CommRing R
x y : 𝕎 R
n : ℕ
⊢ init n (x * y) = init n (init n x * init n y)

Next tactic:
init_ring using wittMul_vars
theorem init_neg (x : 𝕎 R) (n : ℕ) : init n (-x) = init n (-init n x) := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
n✝ : ℕ
R : Type u_1
inst✝ : CommRing R
x : 𝕎 R
n : ℕ
⊢ init n (-x) = init n (-init n x)

Next tactic:
init_ring using wittNeg_vars
theorem init_sub (x y : 𝕎 R) (n : ℕ) : init n (x - y) = init n (init n x - init n y) := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
n✝ : ℕ
R : Type u_1
inst✝ : CommRing R
x y : 𝕎 R
n : ℕ
⊢ init n (x - y) = init n (init n x - init n y)

Next tactic:
init_ring using wittSub_vars
theorem init_nsmul (m : ℕ) (x : 𝕎 R) (n : ℕ) : init n (m • x) = init n (m • init n x) := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
n✝ : ℕ
R : Type u_1
inst✝ : CommRing R
m : ℕ
x : 𝕎 R
n : ℕ
⊢ init n (m • x) = init n (m • init n x)

Next tactic:
init_ring using fun p [Fact (Nat.Prime p)] n => wittNSMul_vars p m n
theorem init_zsmul (m : ℤ) (x : 𝕎 R) (n : ℕ) : init n (m • x) = init n (m • init n x) := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
n✝ : ℕ
R : Type u_1
inst✝ : CommRing R
m : ℤ
x : 𝕎 R
n : ℕ
⊢ init n (m • x) = init n (m • init n x)

Next tactic:
init_ring using fun p [Fact (Nat.Prime p)] n => wittZSMul_vars p m n
theorem init_pow (m : ℕ) (x : 𝕎 R) (n : ℕ) : init n (x ^ m) = init n (init n x ^ m) := by
  

Proof state:
p : ℕ
hp : Fact (Nat.Prime p)
n✝ : ℕ
R : Type u_1
inst✝ : CommRing R
m : ℕ
x : 𝕎 R
n : ℕ
⊢ init n (x ^ m) = init n (init n x ^ m)

Next tactic:
init_ring using fun p [Fact (Nat.Prime p)] n => wittPow_vars p m n
/-- The diagram used to define `P⁺`, composed with `F`, is isomorphic
to the diagram used to define `P ⋙ F`. -/
def diagramCompIso (X : C) : J.diagram P X ⋙ F ≅ J.diagram (P ⋙ F) X :=
  NatIso.ofComponents
    (fun W => by
      

Proof state:
C : Type u
inst✝⁵ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w₁
inst✝⁴ : Category.{max v u, w₁} D
E : Type w₂
inst✝³ : Category.{max v u, w₂} E
F : D ⥤ E
inst✝² : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) D
inst✝¹ : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) E
inst✝ : (X : C) → (W : Cover J X) → (P : Cᵒᵖ ⥤ D) → PreservesLimit (MulticospanIndex.multicospan (Cover.index W P)) F
P : Cᵒᵖ ⥤ D
X : C
W : (Cover J X)ᵒᵖ
⊢ (diagram J P X ⋙ F).obj W ≅ (diagram J (P ⋙ F) X).obj W

Next tactic:
refine' _ ≪≫ HasLimit.isoOfNatIso (W.unop.multicospanComp _ _).symm
/-- The diagram used to define `P⁺`, composed with `F`, is isomorphic
to the diagram used to define `P ⋙ F`. -/
def diagramCompIso (X : C) : J.diagram P X ⋙ F ≅ J.diagram (P ⋙ F) X :=
  NatIso.ofComponents
    (fun W => by
      refine' _ ≪≫ HasLimit.isoOfNatIso (W.unop.multicospanComp _ _).symm
      

Proof state:
C : Type u
inst✝⁵ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w₁
inst✝⁴ : Category.{max v u, w₁} D
E : Type w₂
inst✝³ : Category.{max v u, w₂} E
F : D ⥤ E
inst✝² : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) D
inst✝¹ : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) E
inst✝ : (X : C) → (W : Cover J X) → (P : Cᵒᵖ ⥤ D) → PreservesLimit (MulticospanIndex.multicospan (Cover.index W P)) F
P : Cᵒᵖ ⥤ D
X : C
W : (Cover J X)ᵒᵖ
⊢ (diagram J P X ⋙ F).obj W ≅ limit (MulticospanIndex.multicospan (Cover.index W.unop P) ⋙ F)

Next tactic:
refine'
        (isLimitOfPreserves F (limit.isLimit _)).conePointUniqueUpToIso (limit.isLimit _)
/-- The diagram used to define `P⁺`, composed with `F`, is isomorphic
to the diagram used to define `P ⋙ F`. -/
def diagramCompIso (X : C) : J.diagram P X ⋙ F ≅ J.diagram (P ⋙ F) X :=
  NatIso.ofComponents
    (fun W => by
      refine' _ ≪≫ HasLimit.isoOfNatIso (W.unop.multicospanComp _ _).symm
      refine'
        (isLimitOfPreserves F (limit.isLimit _)).conePointUniqueUpToIso (limit.isLimit _))
    (by
      

Proof state:
C : Type u
inst✝⁵ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w₁
inst✝⁴ : Category.{max v u, w₁} D
E : Type w₂
inst✝³ : Category.{max v u, w₂} E
F : D ⥤ E
inst✝² : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) D
inst✝¹ : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) E
inst✝ : (X : C) → (W : Cover J X) → (P : Cᵒᵖ ⥤ D) → PreservesLimit (MulticospanIndex.multicospan (Cover.index W P)) F
P : Cᵒᵖ ⥤ D
X : C
⊢ ∀ {X_1 Y : (Cover J X)ᵒᵖ} (f : X_1 ⟶ Y),
    (diagram J P X ⋙ F).map f ≫
        ((fun W =>
              IsLimit.conePointUniqueUpToIso
                  (isLimitOfPreserves F (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P))))
                  (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P) ⋙ F)) ≪≫
                HasLimit.isoOfNatIso (Cover.multicospanComp F P W.unop).symm)
            Y).hom =
      ((fun W =>
              IsLimit.conePointUniqueUpToIso
                  (isLimitOfPreserves F (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P))))
                  (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P) ⋙ F)) ≪≫
                HasLimit.isoOfNatIso (Cover.multicospanComp F P W.unop).symm)
            X_1).hom ≫
        (diagram J (P ⋙ F) X).map f

Next tactic:
intro A B f
/-- The diagram used to define `P⁺`, composed with `F`, is isomorphic
to the diagram used to define `P ⋙ F`. -/
def diagramCompIso (X : C) : J.diagram P X ⋙ F ≅ J.diagram (P ⋙ F) X :=
  NatIso.ofComponents
    (fun W => by
      refine' _ ≪≫ HasLimit.isoOfNatIso (W.unop.multicospanComp _ _).symm
      refine'
        (isLimitOfPreserves F (limit.isLimit _)).conePointUniqueUpToIso (limit.isLimit _))
    (by
      intro A B f
      -- porting note: this used to work with `ext`
      -- See https://github.com/leanprover-community/mathlib4/issues/5229
      

Proof state:
C : Type u
inst✝⁵ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w₁
inst✝⁴ : Category.{max v u, w₁} D
E : Type w₂
inst✝³ : Category.{max v u, w₂} E
F : D ⥤ E
inst✝² : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) D
inst✝¹ : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) E
inst✝ : (X : C) → (W : Cover J X) → (P : Cᵒᵖ ⥤ D) → PreservesLimit (MulticospanIndex.multicospan (Cover.index W P)) F
P : Cᵒᵖ ⥤ D
X : C
A B : (Cover J X)ᵒᵖ
f : A ⟶ B
⊢ (diagram J P X ⋙ F).map f ≫
      ((fun W =>
            IsLimit.conePointUniqueUpToIso
                (isLimitOfPreserves F (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P))))
                (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P) ⋙ F)) ≪≫
              HasLimit.isoOfNatIso (Cover.multicospanComp F P W.unop).symm)
          B).hom =
    ((fun W =>
            IsLimit.conePointUniqueUpToIso
                (isLimitOfPreserves F (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P))))
                (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P) ⋙ F)) ≪≫
              HasLimit.isoOfNatIso (Cover.multicospanComp F P W.unop).symm)
          A).hom ≫
      (diagram J (P ⋙ F) X).map f

Next tactic:
apply Multiequalizer.hom_ext
/-- The diagram used to define `P⁺`, composed with `F`, is isomorphic
to the diagram used to define `P ⋙ F`. -/
def diagramCompIso (X : C) : J.diagram P X ⋙ F ≅ J.diagram (P ⋙ F) X :=
  NatIso.ofComponents
    (fun W => by
      refine' _ ≪≫ HasLimit.isoOfNatIso (W.unop.multicospanComp _ _).symm
      refine'
        (isLimitOfPreserves F (limit.isLimit _)).conePointUniqueUpToIso (limit.isLimit _))
    (by
      intro A B f
      -- porting note: this used to work with `ext`
      -- See https://github.com/leanprover-community/mathlib4/issues/5229
      apply Multiequalizer.hom_ext
      

Proof state:
case h
C : Type u
inst✝⁵ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w₁
inst✝⁴ : Category.{max v u, w₁} D
E : Type w₂
inst✝³ : Category.{max v u, w₂} E
F : D ⥤ E
inst✝² : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) D
inst✝¹ : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) E
inst✝ : (X : C) → (W : Cover J X) → (P : Cᵒᵖ ⥤ D) → PreservesLimit (MulticospanIndex.multicospan (Cover.index W P)) F
P : Cᵒᵖ ⥤ D
X : C
A B : (Cover J X)ᵒᵖ
f : A ⟶ B
⊢ ∀ (a : (Cover.index B.unop (P ⋙ F)).L),
    ((diagram J P X ⋙ F).map f ≫
          ((fun W =>
                IsLimit.conePointUniqueUpToIso
                    (isLimitOfPreserves F (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P))))
                    (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P) ⋙ F)) ≪≫
                  HasLimit.isoOfNatIso (Cover.multicospanComp F P W.unop).symm)
              B).hom) ≫
        Multiequalizer.ι (Cover.index B.unop (P ⋙ F)) a =
      (((fun W =>
                IsLimit.conePointUniqueUpToIso
                    (isLimitOfPreserves F (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P))))
                    (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P) ⋙ F)) ≪≫
                  HasLimit.isoOfNatIso (Cover.multicospanComp F P W.unop).symm)
              A).hom ≫
          (diagram J (P ⋙ F) X).map f) ≫
        Multiequalizer.ι (Cover.index B.unop (P ⋙ F)) a

Next tactic:
dsimp
/-- The diagram used to define `P⁺`, composed with `F`, is isomorphic
to the diagram used to define `P ⋙ F`. -/
def diagramCompIso (X : C) : J.diagram P X ⋙ F ≅ J.diagram (P ⋙ F) X :=
  NatIso.ofComponents
    (fun W => by
      refine' _ ≪≫ HasLimit.isoOfNatIso (W.unop.multicospanComp _ _).symm
      refine'
        (isLimitOfPreserves F (limit.isLimit _)).conePointUniqueUpToIso (limit.isLimit _))
    (by
      intro A B f
      -- porting note: this used to work with `ext`
      -- See https://github.com/leanprover-community/mathlib4/issues/5229
      apply Multiequalizer.hom_ext
      dsimp
      simp only [Functor.mapCone_π_app, Multiequalizer.multifork_π_app_left, Iso.symm_hom,
        Multiequalizer.lift_ι, eqToHom_refl, Category.comp_id,
        limit.conePointUniqueUpToIso_hom_comp,
        GrothendieckTopology.Cover.multicospanComp_hom_inv_left, HasLimit.isoOfNatIso_hom_π,
        Category.assoc]
      

Proof state:
case h
C : Type u
inst✝⁵ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w₁
inst✝⁴ : Category.{max v u, w₁} D
E : Type w₂
inst✝³ : Category.{max v u, w₂} E
F : D ⥤ E
inst✝² : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) D
inst✝¹ : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) E
inst✝ : (X : C) → (W : Cover J X) → (P : Cᵒᵖ ⥤ D) → PreservesLimit (MulticospanIndex.multicospan (Cover.index W P)) F
P : Cᵒᵖ ⥤ D
X : C
A B : (Cover J X)ᵒᵖ
f : A ⟶ B
⊢ ∀ (a : (Cover.index B.unop (P ⋙ F)).L),
    F.map
          (Multiequalizer.lift (Cover.index B.unop P) (multiequalizer (Cover.index A.unop P))
            (fun I => Multiequalizer.ι (Cover.index A.unop P) (Cover.Arrow.map I f.unop))
            (_ :
              ∀ (I : (Cover.index B.unop P).R),
                Multiequalizer.ι (Cover.index A.unop P)
                      (MulticospanIndex.fstTo (Cover.index A.unop P) (Cover.Relation.map I f.unop)) ≫
                    MulticospanIndex.fst (Cover.index A.unop P) (Cover.Relation.map I f.unop) =
                  Multiequalizer.ι (Cover.index A.unop P)
                      (MulticospanIndex.sndTo (Cover.index A.unop P) (Cover.Relation.map I f.unop)) ≫
                    MulticospanIndex.snd (Cover.index A.unop P) (Cover.Relation.map I f.unop))) ≫
        F.map (Multiequalizer.ι (Cover.index B.unop P) a) =
      F.map (Multiequalizer.ι (Cover.index A.unop P) (Cover.Arrow.map a f.unop))

Next tactic:
simp only [← F.map_comp, limit.lift_π, Multifork.ofι_π_app, implies_true]
@[reassoc (attr := simp)]
theorem diagramCompIso_hom_ι (X : C) (W : (J.Cover X)ᵒᵖ) (i : W.unop.Arrow) :
    (J.diagramCompIso F P X).hom.app W ≫ Multiequalizer.ι ((unop W).index (P ⋙ F)) i =
  F.map (Multiequalizer.ι _ _) := by
  

Proof state:
C : Type u
inst✝⁵ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w₁
inst✝⁴ : Category.{max v u, w₁} D
E : Type w₂
inst✝³ : Category.{max v u, w₂} E
F : D ⥤ E
inst✝² : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) D
inst✝¹ : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) E
inst✝ : (X : C) → (W : Cover J X) → (P : Cᵒᵖ ⥤ D) → PreservesLimit (MulticospanIndex.multicospan (Cover.index W P)) F
P : Cᵒᵖ ⥤ D
X : C
W : (Cover J X)ᵒᵖ
i : Cover.Arrow W.unop
⊢ (diagramCompIso J F P X).hom.app W ≫ Multiequalizer.ι (Cover.index W.unop (P ⋙ F)) i =
    F.map (Multiequalizer.ι (Cover.index W.unop P) i)

Next tactic:
delta diagramCompIso
@[reassoc (attr := simp)]
theorem diagramCompIso_hom_ι (X : C) (W : (J.Cover X)ᵒᵖ) (i : W.unop.Arrow) :
    (J.diagramCompIso F P X).hom.app W ≫ Multiequalizer.ι ((unop W).index (P ⋙ F)) i =
  F.map (Multiequalizer.ι _ _) := by
  delta diagramCompIso
  

Proof state:
C : Type u
inst✝⁵ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w₁
inst✝⁴ : Category.{max v u, w₁} D
E : Type w₂
inst✝³ : Category.{max v u, w₂} E
F : D ⥤ E
inst✝² : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) D
inst✝¹ : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) E
inst✝ : (X : C) → (W : Cover J X) → (P : Cᵒᵖ ⥤ D) → PreservesLimit (MulticospanIndex.multicospan (Cover.index W P)) F
P : Cᵒᵖ ⥤ D
X : C
W : (Cover J X)ᵒᵖ
i : Cover.Arrow W.unop
⊢ (NatIso.ofComponents fun W =>
              IsLimit.conePointUniqueUpToIso
                  (isLimitOfPreserves F (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P))))
                  (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P) ⋙ F)) ≪≫
                HasLimit.isoOfNatIso (Cover.multicospanComp F P W.unop).symm).hom.app
        W ≫
      Multiequalizer.ι (Cover.index W.unop (P ⋙ F)) i =
    F.map (Multiequalizer.ι (Cover.index W.unop P) i)

Next tactic:
dsimp
@[reassoc (attr := simp)]
theorem diagramCompIso_hom_ι (X : C) (W : (J.Cover X)ᵒᵖ) (i : W.unop.Arrow) :
    (J.diagramCompIso F P X).hom.app W ≫ Multiequalizer.ι ((unop W).index (P ⋙ F)) i =
  F.map (Multiequalizer.ι _ _) := by
  delta diagramCompIso
  dsimp
  

Proof state:
C : Type u
inst✝⁵ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w₁
inst✝⁴ : Category.{max v u, w₁} D
E : Type w₂
inst✝³ : Category.{max v u, w₂} E
F : D ⥤ E
inst✝² : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) D
inst✝¹ : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) E
inst✝ : (X : C) → (W : Cover J X) → (P : Cᵒᵖ ⥤ D) → PreservesLimit (MulticospanIndex.multicospan (Cover.index W P)) F
P : Cᵒᵖ ⥤ D
X : C
W : (Cover J X)ᵒᵖ
i : Cover.Arrow W.unop
⊢ ((IsLimit.conePointUniqueUpToIso
            (isLimitOfPreserves F (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P))))
            (limit.isLimit (MulticospanIndex.multicospan (Cover.index W.unop P) ⋙ F))).hom ≫
        (HasLimit.isoOfNatIso (Cover.multicospanComp F P W.unop).symm).hom) ≫
      Multiequalizer.ι (Cover.index W.unop (P ⋙ F)) i =
    F.map (Multiequalizer.ι (Cover.index W.unop P) i)

Next tactic:
simp
/-- The isomorphism between `P⁺ ⋙ F` and `(P ⋙ F)⁺`. -/
def plusCompIso : J.plusObj P ⋙ F ≅ J.plusObj (P ⋙ F) :=
  NatIso.ofComponents
    (fun X => by
      

Proof state:
C : Type u
inst✝⁸ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w₁
inst✝⁷ : Category.{max v u, w₁} D
E : Type w₂
inst✝⁶ : Category.{max v u, w₂} E
F : D ⥤ E
inst✝⁵ : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) D
inst✝⁴ : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) E
inst✝³ : (X : C) → (W : Cover J X) → (P : Cᵒᵖ ⥤ D) → PreservesLimit (MulticospanIndex.multicospan (Cover.index W P)) F
P : Cᵒᵖ ⥤ D
inst✝² : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
inst✝¹ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ E
inst✝ : (X : C) → PreservesColimitsOfShape (Cover J X)ᵒᵖ F
X : Cᵒᵖ
⊢ (plusObj J P ⋙ F).obj X ≅ (plusObj J (P ⋙ F)).obj X

Next tactic:
refine' _ ≪≫ HasColimit.isoOfNatIso (J.diagramCompIso F P X.unop)
/-- The isomorphism between `P⁺ ⋙ F` and `(P ⋙ F)⁺`. -/
def plusCompIso : J.plusObj P ⋙ F ≅ J.plusObj (P ⋙ F) :=
  NatIso.ofComponents
    (fun X => by
      refine' _ ≪≫ HasColimit.isoOfNatIso (J.diagramCompIso F P X.unop)
      

Proof state:
C : Type u
inst✝⁸ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w₁
inst✝⁷ : Category.{max v u, w₁} D
E : Type w₂
inst✝⁶ : Category.{max v u, w₂} E
F : D ⥤ E
inst✝⁵ : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) D
inst✝⁴ : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) E
inst✝³ : (X : C) → (W : Cover J X) → (P : Cᵒᵖ ⥤ D) → PreservesLimit (MulticospanIndex.multicospan (Cover.index W P)) F
P : Cᵒᵖ ⥤ D
inst✝² : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
inst✝¹ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ E
inst✝ : (X : C) → PreservesColimitsOfShape (Cover J X)ᵒᵖ F
X : Cᵒᵖ
⊢ (plusObj J P ⋙ F).obj X ≅ colimit (diagram J P X.unop ⋙ F)

Next tactic:
refine'
        (isColimitOfPreserves F
              (colimit.isColimit (J.diagram P (unop X)))).coconePointUniqueUpToIso
          (colimit.isColimit _)
/-- The isomorphism between `P⁺ ⋙ F` and `(P ⋙ F)⁺`. -/
def plusCompIso : J.plusObj P ⋙ F ≅ J.plusObj (P ⋙ F) :=
  NatIso.ofComponents
    (fun X => by
      refine' _ ≪≫ HasColimit.isoOfNatIso (J.diagramCompIso F P X.unop)
      refine'
        (isColimitOfPreserves F
              (colimit.isColimit (J.diagram P (unop X)))).coconePointUniqueUpToIso
          (colimit.isColimit _))
    (by
      

Proof state:
C : Type u
inst✝⁸ : Category.{v, u} C
J : GrothendieckTopology C
D : Type w₁
inst✝⁷ : Category.{max v u, w₁} D
E : Type w₂
inst✝⁶ : Category.{max v u, w₂} E
F : D ⥤ E
inst✝⁵ : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) D
inst✝⁴ : ∀ (α β : Type (max v u)) (fst snd : β → α), HasLimitsOfShape (WalkingMulticospan fst snd) E
inst✝³ : (X : C) → (W : Cover J X) → (P : Cᵒᵖ ⥤ D) → PreservesLimit (MulticospanIndex.multicospan (Cover.index W P)) F
P : Cᵒᵖ ⥤ D
inst✝² : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ D
inst✝¹ : ∀ (X : C), HasColimitsOfShape (Cover J X)ᵒᵖ E
inst✝ : (X : C) → PreservesColimitsOfShape (Cover J X)ᵒᵖ F
⊢ ∀ {X Y : Cᵒᵖ} (f : X ⟶ Y),
    (plusObj J P ⋙ F).map f ≫
        ((fun X =>
              IsColimit.coconePointUniqueUpToIso (isColimitOfPreserves F (colimit.isColimit (diagram J P X.unop)))
                  (colimit.isColimit (diagram J P X.unop ⋙ F)) ≪≫
                HasColimit.isoOfNatIso (diagramCompIso J F P X.unop))
            Y).hom =
      ((fun X =>
              IsColimit.coconePointUniqueUpToIso (isColimitOfPreserves F (colimit.isColimit (diagram J P X.unop)))
                  (colimit.isColimit (diagram J P X.unop ⋙ F)) ≪≫
                HasColimit.isoOfNatIso (diagramCompIso J F P X.unop))
            X).hom ≫
        (plusObj J (P ⋙ F)).map f

Next tactic:
intro X Y f