l3lab/ntp-mathlib huggingface dataset:
instance : MulDistribMulAction (A →ₐ[R] A) Aˣ where
  smul := fun f => Units.map f
  one_smul := fun x => by 

Proof state:
R : Type u
A : Type v
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
x : Aˣ
⊢ 1 • x = x

Next tactic:
ext
instance : MulDistribMulAction (A →ₐ[R] A) Aˣ where
  smul := fun f => Units.map f
  one_smul := fun x => by ext; 

Proof state:
case a
R : Type u
A : Type v
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
x : Aˣ
⊢ ↑(1 • x) = ↑x

Next tactic:
rfl
instance : MulDistribMulAction (A →ₐ[R] A) Aˣ where
  smul := fun f => Units.map f
  one_smul := fun x => by ext; rfl
  mul_smul := fun x y z => by 

Proof state:
R : Type u
A : Type v
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
x y : A →ₐ[R] A
z : Aˣ
⊢ (x * y) • z = x • y • z

Next tactic:
ext
instance : MulDistribMulAction (A →ₐ[R] A) Aˣ where
  smul := fun f => Units.map f
  one_smul := fun x => by ext; rfl
  mul_smul := fun x y z => by ext; 

Proof state:
case a
R : Type u
A : Type v
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
x y : A →ₐ[R] A
z : Aˣ
⊢ ↑((x * y) • z) = ↑(x • y • z)

Next tactic:
rfl
instance : MulDistribMulAction (A →ₐ[R] A) Aˣ where
  smul := fun f => Units.map f
  one_smul := fun x => by ext; rfl
  mul_smul := fun x y z => by ext; rfl
  smul_mul := fun x y z => by 

Proof state:
R : Type u
A : Type v
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
x : A →ₐ[R] A
y z : Aˣ
⊢ x • (y * z) = x • y * x • z

Next tactic:
ext
instance : MulDistribMulAction (A →ₐ[R] A) Aˣ where
  smul := fun f => Units.map f
  one_smul := fun x => by ext; rfl
  mul_smul := fun x y z => by ext; rfl
  smul_mul := fun x y z => by ext; 

Proof state:
case a
R : Type u
A : Type v
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
x : A →ₐ[R] A
y z : Aˣ
⊢ ↑(x • (y * z)) = ↑(x • y * x • z)

Next tactic:
exact x.map_mul _ _
instance : MulDistribMulAction (A →ₐ[R] A) Aˣ where
  smul := fun f => Units.map f
  one_smul := fun x => by ext; rfl
  mul_smul := fun x y z => by ext; rfl
  smul_mul := fun x y z => by ext; exact x.map_mul _ _
  smul_one := fun x => by 

Proof state:
R : Type u
A : Type v
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
x : A →ₐ[R] A
⊢ x • 1 = 1

Next tactic:
ext
instance : MulDistribMulAction (A →ₐ[R] A) Aˣ where
  smul := fun f => Units.map f
  one_smul := fun x => by ext; rfl
  mul_smul := fun x y z => by ext; rfl
  smul_mul := fun x y z => by ext; exact x.map_mul _ _
  smul_one := fun x => by ext; 

Proof state:
case a
R : Type u
A : Type v
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
x : A →ₐ[R] A
⊢ ↑(x • 1) = ↑1

Next tactic:
exact x.map_one
/-- Left whiskering of an oplax natural transformation and a modification. -/
@[simps]
def whiskerLeft (η : F ⟶ G) {θ ι : G ⟶ H} (Γ : θ ⟶ ι) : η ≫ θ ⟶ η ≫ ι where
  app a := η.app a ◁ Γ.app a
  naturality {a b} f := by
    

Proof state:
B : Type u₁
inst✝¹ : Bicategory B
C : Type u₂
inst✝ : Bicategory C
F G H I : OplaxFunctor B C
η : F ⟶ G
θ ι : G ⟶ H
Γ : θ ⟶ ι
a b : B
f : a ⟶ b
⊢ (↑F.toPrelaxFunctor).map f ◁ (fun a => η.app a ◁ Γ.app a) b ≫ naturality (η ≫ ι) f =
    naturality (η ≫ θ) f ≫ (fun a => η.app a ◁ Γ.app a) a ▷ (↑H.toPrelaxFunctor).map f

Next tactic:
dsimp
/-- Left whiskering of an oplax natural transformation and a modification. -/
@[simps]
def whiskerLeft (η : F ⟶ G) {θ ι : G ⟶ H} (Γ : θ ⟶ ι) : η ≫ θ ⟶ η ≫ ι where
  app a := η.app a ◁ Γ.app a
  naturality {a b} f := by
    dsimp
    

Proof state:
B : Type u₁
inst✝¹ : Bicategory B
C : Type u₂
inst✝ : Bicategory C
F G H I : OplaxFunctor B C
η : F ⟶ G
θ ι : G ⟶ H
Γ : θ ⟶ ι
a b : B
f : a ⟶ b
⊢ (↑F.toPrelaxFunctor).map f ◁ η.app b ◁ Γ.app b ≫
      (α_ ((↑F.toPrelaxFunctor).map f) (η.app b) (ι.app b)).inv ≫
        naturality η f ▷ ι.app b ≫
          (α_ (η.app a) ((↑G.toPrelaxFunctor).map f) (ι.app b)).hom ≫
            η.app a ◁ naturality ι f ≫ (α_ (η.app a) (ι.app a) ((↑H.toPrelaxFunctor).map f)).inv =
    ((α_ ((↑F.toPrelaxFunctor).map f) (η.app b) (θ.app b)).inv ≫
        naturality η f ▷ θ.app b ≫
          (α_ (η.app a) ((↑G.toPrelaxFunctor).map f) (θ.app b)).hom ≫
            η.app a ◁ naturality θ f ≫ (α_ (η.app a) (θ.app a) ((↑H.toPrelaxFunctor).map f)).inv) ≫
      (η.app a ◁ Γ.app a) ▷ (↑H.toPrelaxFunctor).map f

Next tactic:
rw [associator_inv_naturality_right_assoc, whisker_exchange_assoc]
/-- Left whiskering of an oplax natural transformation and a modification. -/
@[simps]
def whiskerLeft (η : F ⟶ G) {θ ι : G ⟶ H} (Γ : θ ⟶ ι) : η ≫ θ ⟶ η ≫ ι where
  app a := η.app a ◁ Γ.app a
  naturality {a b} f := by
    dsimp
    rw [associator_inv_naturality_right_assoc, whisker_exchange_assoc]
    

Proof state:
B : Type u₁
inst✝¹ : Bicategory B
C : Type u₂
inst✝ : Bicategory C
F G H I : OplaxFunctor B C
η : F ⟶ G
θ ι : G ⟶ H
Γ : θ ⟶ ι
a b : B
f : a ⟶ b
⊢ (α_ ((↑F.toPrelaxFunctor).map f) (η.app b) (θ.app b)).inv ≫
      naturality η f ▷ θ.app b ≫
        (η.app a ≫ (↑G.toPrelaxFunctor).map f) ◁ Γ.app b ≫
          (α_ (η.app a) ((↑G.toPrelaxFunctor).map f) (ι.app b)).hom ≫
            η.app a ◁ naturality ι f ≫ (α_ (η.app a) (ι.app a) ((↑H.toPrelaxFunctor).map f)).inv =
    ((α_ ((↑F.toPrelaxFunctor).map f) (η.app b) (θ.app b)).inv ≫
        naturality η f ▷ θ.app b ≫
          (α_ (η.app a) ((↑G.toPrelaxFunctor).map f) (θ.app b)).hom ≫
            η.app a ◁ naturality θ f ≫ (α_ (η.app a) (θ.app a) ((↑H.toPrelaxFunctor).map f)).inv) ≫
      (η.app a ◁ Γ.app a) ▷ (↑H.toPrelaxFunctor).map f

Next tactic:
simp
/-- Right whiskering of an oplax natural transformation and a modification. -/
@[simps]
def whiskerRight {η θ : F ⟶ G} (Γ : η ⟶ θ) (ι : G ⟶ H) : η ≫ ι ⟶ θ ≫ ι where
  app a := Γ.app a ▷ ι.app a
  naturality {a b} f := by
    

Proof state:
B : Type u₁
inst✝¹ : Bicategory B
C : Type u₂
inst✝ : Bicategory C
F G H I : OplaxFunctor B C
η θ : F ⟶ G
Γ : η ⟶ θ
ι : G ⟶ H
a b : B
f : a ⟶ b
⊢ (↑F.toPrelaxFunctor).map f ◁ (fun a => Γ.app a ▷ ι.app a) b ≫ naturality (θ ≫ ι) f =
    naturality (η ≫ ι) f ≫ (fun a => Γ.app a ▷ ι.app a) a ▷ (↑H.toPrelaxFunctor).map f

Next tactic:
dsimp
/-- Right whiskering of an oplax natural transformation and a modification. -/
@[simps]
def whiskerRight {η θ : F ⟶ G} (Γ : η ⟶ θ) (ι : G ⟶ H) : η ≫ ι ⟶ θ ≫ ι where
  app a := Γ.app a ▷ ι.app a
  naturality {a b} f := by
    dsimp
    

Proof state:
B : Type u₁
inst✝¹ : Bicategory B
C : Type u₂
inst✝ : Bicategory C
F G H I : OplaxFunctor B C
η θ : F ⟶ G
Γ : η ⟶ θ
ι : G ⟶ H
a b : B
f : a ⟶ b
⊢ (↑F.toPrelaxFunctor).map f ◁ Γ.app b ▷ ι.app b ≫
      (α_ ((↑F.toPrelaxFunctor).map f) (θ.app b) (ι.app b)).inv ≫
        naturality θ f ▷ ι.app b ≫
          (α_ (θ.app a) ((↑G.toPrelaxFunctor).map f) (ι.app b)).hom ≫
            θ.app a ◁ naturality ι f ≫ (α_ (θ.app a) (ι.app a) ((↑H.toPrelaxFunctor).map f)).inv =
    ((α_ ((↑F.toPrelaxFunctor).map f) (η.app b) (ι.app b)).inv ≫
        naturality η f ▷ ι.app b ≫
          (α_ (η.app a) ((↑G.toPrelaxFunctor).map f) (ι.app b)).hom ≫
            η.app a ◁ naturality ι f ≫ (α_ (η.app a) (ι.app a) ((↑H.toPrelaxFunctor).map f)).inv) ≫
      Γ.app a ▷ ι.app a ▷ (↑H.toPrelaxFunctor).map f

Next tactic:
simp_rw [assoc, ← associator_inv_naturality_left, whisker_exchange_assoc]
/-- Right whiskering of an oplax natural transformation and a modification. -/
@[simps]
def whiskerRight {η θ : F ⟶ G} (Γ : η ⟶ θ) (ι : G ⟶ H) : η ≫ ι ⟶ θ ≫ ι where
  app a := Γ.app a ▷ ι.app a
  naturality {a b} f := by
    dsimp
    simp_rw [assoc, ← associator_inv_naturality_left, whisker_exchange_assoc]
    

Proof state:
B : Type u₁
inst✝¹ : Bicategory B
C : Type u₂
inst✝ : Bicategory C
F G H I : OplaxFunctor B C
η θ : F ⟶ G
Γ : η ⟶ θ
ι : G ⟶ H
a b : B
f : a ⟶ b
⊢ (↑F.toPrelaxFunctor).map f ◁ Γ.app b ▷ ι.app b ≫
      (α_ ((↑F.toPrelaxFunctor).map f) (θ.app b) (ι.app b)).inv ≫
        naturality θ f ▷ ι.app b ≫
          (α_ (θ.app a) ((↑G.toPrelaxFunctor).map f) (ι.app b)).hom ≫
            θ.app a ◁ naturality ι f ≫ (α_ (θ.app a) (ι.app a) ((↑H.toPrelaxFunctor).map f)).inv =
    (α_ ((↑F.toPrelaxFunctor).map f) (η.app b) (ι.app b)).inv ≫
      naturality η f ▷ ι.app b ≫
        (α_ (η.app a) ((↑G.toPrelaxFunctor).map f) (ι.app b)).hom ≫
          Γ.app a ▷ ((↑G.toPrelaxFunctor).map f ≫ ι.app b) ≫
            θ.app a ◁ naturality ι f ≫ (α_ (θ.app a) (ι.app a) ((↑H.toPrelaxFunctor).map f)).inv

Next tactic:
simp
/-- Associator for the vertical composition of oplax natural transformations. -/
-- Porting note: verified that projections are correct and changed @[simps] to @[simps!]
@[simps!]
def associator (η : F ⟶ G) (θ : G ⟶ H) (ι : H ⟶ I) : (η ≫ θ) ≫ ι ≅ η ≫ θ ≫ ι :=
  ModificationIso.ofComponents (fun a => α_ (η.app a) (θ.app a) (ι.app a)) (by 

Proof state:
B : Type u₁
inst✝¹ : Bicategory B
C : Type u₂
inst✝ : Bicategory C
F G H I : OplaxFunctor B C
η : F ⟶ G
θ : G ⟶ H
ι : H ⟶ I
⊢ ∀ {a b : B} (f : a ⟶ b),
    (↑F.toPrelaxFunctor).map f ◁ ((fun a => α_ (η.app a) (θ.app a) (ι.app a)) b).hom ≫ naturality (η ≫ θ ≫ ι) f =
      naturality ((η ≫ θ) ≫ ι) f ≫ ((fun a => α_ (η.app a) (θ.app a) (ι.app a)) a).hom ▷ (↑I.toPrelaxFunctor).map f

Next tactic:
aesop_cat
/-- Left unitor for the vertical composition of oplax natural transformations. -/
-- Porting note: verified that projections are correct and changed @[simps] to @[simps!]
@[simps!]
def leftUnitor (η : F ⟶ G) : 𝟙 F ≫ η ≅ η :=
  ModificationIso.ofComponents (fun a => λ_ (η.app a)) (by 

Proof state:
B : Type u₁
inst✝¹ : Bicategory B
C : Type u₂
inst✝ : Bicategory C
F G H I : OplaxFunctor B C
η : F ⟶ G
⊢ ∀ {a b : B} (f : a ⟶ b),
    (↑F.toPrelaxFunctor).map f ◁ ((fun a => λ_ (η.app a)) b).hom ≫ naturality η f =
      naturality (𝟙 F ≫ η) f ≫ ((fun a => λ_ (η.app a)) a).hom ▷ (↑G.toPrelaxFunctor).map f

Next tactic:
aesop_cat
/-- Right unitor for the vertical composition of oplax natural transformations. -/
-- Porting note: verified that projections are correct and changed @[simps] to @[simps!]
@[simps!]
def rightUnitor (η : F ⟶ G) : η ≫ 𝟙 G ≅ η :=
  ModificationIso.ofComponents (fun a => ρ_ (η.app a)) (by 

Proof state:
B : Type u₁
inst✝¹ : Bicategory B
C : Type u₂
inst✝ : Bicategory C
F G H I : OplaxFunctor B C
η : F ⟶ G
⊢ ∀ {a b : B} (f : a ⟶ b),
    (↑F.toPrelaxFunctor).map f ◁ ((fun a => ρ_ (η.app a)) b).hom ≫ naturality η f =
      naturality (η ≫ 𝟙 G) f ≫ ((fun a => ρ_ (η.app a)) a).hom ▷ (↑G.toPrelaxFunctor).map f

Next tactic:
aesop_cat
/-- A bicategory structure on the oplax functors between bicategories. -/
-- Porting note: verified that projections are correct and changed @[simps] to @[simps!]
@[simps!]
instance OplaxFunctor.bicategory : Bicategory (OplaxFunctor B C) where
  whiskerLeft {F G H} η _ _ Γ := OplaxNatTrans.whiskerLeft η Γ
  whiskerRight {F G H} _ _ Γ η := OplaxNatTrans.whiskerRight Γ η
  associator {F G H} I := OplaxNatTrans.associator
  leftUnitor {F G} := OplaxNatTrans.leftUnitor
  rightUnitor {F G} := OplaxNatTrans.rightUnitor
  whisker_exchange {a b c f g h i} η θ := by
    

Proof state:
B : Type u₁
inst✝¹ : Bicategory B
C : Type u₂
inst✝ : Bicategory C
F G H I a b c : OplaxFunctor B C
f g : a ⟶ b
h i : b ⟶ c
η : f ⟶ g
θ : h ⟶ i
⊢ (fun {F G H} η x x_1 Γ => OplaxNatTrans.whiskerLeft η Γ) f h i θ ≫
      (fun {F G H} x x_1 Γ η => OplaxNatTrans.whiskerRight Γ η) f g η i =
    (fun {F G H} x x_1 Γ η => OplaxNatTrans.whiskerRight Γ η) f g η h ≫
      (fun {F G H} η x x_1 Γ => OplaxNatTrans.whiskerLeft η Γ) g h i θ

Next tactic:
ext
/-- A bicategory structure on the oplax functors between bicategories. -/
-- Porting note: verified that projections are correct and changed @[simps] to @[simps!]
@[simps!]
instance OplaxFunctor.bicategory : Bicategory (OplaxFunctor B C) where
  whiskerLeft {F G H} η _ _ Γ := OplaxNatTrans.whiskerLeft η Γ
  whiskerRight {F G H} _ _ Γ η := OplaxNatTrans.whiskerRight Γ η
  associator {F G H} I := OplaxNatTrans.associator
  leftUnitor {F G} := OplaxNatTrans.leftUnitor
  rightUnitor {F G} := OplaxNatTrans.rightUnitor
  whisker_exchange {a b c f g h i} η θ := by
    ext
    

Proof state:
case w
B : Type u₁
inst✝¹ : Bicategory B
C : Type u₂
inst✝ : Bicategory C
F G H I a b c : OplaxFunctor B C
f g : a ⟶ b
h i : b ⟶ c
η : f ⟶ g
θ : h ⟶ i
b✝ : B
⊢ ((fun {F G H} η x x_1 Γ => OplaxNatTrans.whiskerLeft η Γ) f h i θ ≫
          (fun {F G H} x x_1 Γ η => OplaxNatTrans.whiskerRight Γ η) f g η i).app
      b✝ =
    ((fun {F G H} x x_1 Γ η => OplaxNatTrans.whiskerRight Γ η) f g η h ≫
          (fun {F G H} η x x_1 Γ => OplaxNatTrans.whiskerLeft η Γ) g h i θ).app
      b✝

Next tactic:
exact whisker_exchange _ _
/-- If a binary fan `t` over `P Q` is a limit cone, then `t.swap` is a limit cone over `Q P`.
-/
@[simps]
def IsLimit.swapBinaryFan {P Q : C} {t : BinaryFan P Q} (I : IsLimit t) : IsLimit t.swap where
  lift s := I.lift (BinaryFan.swap s)
  fac s := by 

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X Y P Q : C
t : BinaryFan P Q
I : IsLimit t
s : Cone (pair Q P)
⊢ ∀ (j : Discrete WalkingPair), (fun s => lift I (BinaryFan.swap s)) s ≫ (BinaryFan.swap t).π.app j = s.π.app j

Next tactic:
rintro ⟨⟨⟩⟩
/-- If a binary fan `t` over `P Q` is a limit cone, then `t.swap` is a limit cone over `Q P`.
-/
@[simps]
def IsLimit.swapBinaryFan {P Q : C} {t : BinaryFan P Q} (I : IsLimit t) : IsLimit t.swap where
  lift s := I.lift (BinaryFan.swap s)
  fac s := by rintro ⟨⟨⟩⟩ <;> 

Proof state:
case mk.left
C : Type u
inst✝ : Category.{v, u} C
X Y P Q : C
t : BinaryFan P Q
I : IsLimit t
s : Cone (pair Q P)
⊢ (fun s => lift I (BinaryFan.swap s)) s ≫ (BinaryFan.swap t).π.app { as := WalkingPair.left } =
    s.π.app { as := WalkingPair.left }

Next tactic:
simp
/-- If a binary fan `t` over `P Q` is a limit cone, then `t.swap` is a limit cone over `Q P`.
-/
@[simps]
def IsLimit.swapBinaryFan {P Q : C} {t : BinaryFan P Q} (I : IsLimit t) : IsLimit t.swap where
  lift s := I.lift (BinaryFan.swap s)
  fac s := by rintro ⟨⟨⟩⟩ <;> 

Proof state:
case mk.right
C : Type u
inst✝ : Category.{v, u} C
X Y P Q : C
t : BinaryFan P Q
I : IsLimit t
s : Cone (pair Q P)
⊢ (fun s => lift I (BinaryFan.swap s)) s ≫ (BinaryFan.swap t).π.app { as := WalkingPair.right } =
    s.π.app { as := WalkingPair.right }

Next tactic:
simp
/-- If a binary fan `t` over `P Q` is a limit cone, then `t.swap` is a limit cone over `Q P`.
-/
@[simps]
def IsLimit.swapBinaryFan {P Q : C} {t : BinaryFan P Q} (I : IsLimit t) : IsLimit t.swap where
  lift s := I.lift (BinaryFan.swap s)
  fac s := by rintro ⟨⟨⟩⟩ <;> simp
  uniq s m w := by
    

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X Y P Q : C
t : BinaryFan P Q
I : IsLimit t
s : Cone (pair Q P)
m : s.pt ⟶ (BinaryFan.swap t).pt
w : ∀ (j : Discrete WalkingPair), m ≫ (BinaryFan.swap t).π.app j = s.π.app j
⊢ m = (fun s => lift I (BinaryFan.swap s)) s

Next tactic:
have h := I.uniq (BinaryFan.swap s) m
/-- If a binary fan `t` over `P Q` is a limit cone, then `t.swap` is a limit cone over `Q P`.
-/
@[simps]
def IsLimit.swapBinaryFan {P Q : C} {t : BinaryFan P Q} (I : IsLimit t) : IsLimit t.swap where
  lift s := I.lift (BinaryFan.swap s)
  fac s := by rintro ⟨⟨⟩⟩ <;> simp
  uniq s m w := by
    have h := I.uniq (BinaryFan.swap s) m
    

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X Y P Q : C
t : BinaryFan P Q
I : IsLimit t
s : Cone (pair Q P)
m : s.pt ⟶ (BinaryFan.swap t).pt
w : ∀ (j : Discrete WalkingPair), m ≫ (BinaryFan.swap t).π.app j = s.π.app j
h : (∀ (j : Discrete WalkingPair), m ≫ t.π.app j = (BinaryFan.swap s).π.app j) → m = lift I (BinaryFan.swap s)
⊢ m = (fun s => lift I (BinaryFan.swap s)) s

Next tactic:
rw [h]
/-- If a binary fan `t` over `P Q` is a limit cone, then `t.swap` is a limit cone over `Q P`.
-/
@[simps]
def IsLimit.swapBinaryFan {P Q : C} {t : BinaryFan P Q} (I : IsLimit t) : IsLimit t.swap where
  lift s := I.lift (BinaryFan.swap s)
  fac s := by rintro ⟨⟨⟩⟩ <;> simp
  uniq s m w := by
    have h := I.uniq (BinaryFan.swap s) m
    rw [h]
    

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X Y P Q : C
t : BinaryFan P Q
I : IsLimit t
s : Cone (pair Q P)
m : s.pt ⟶ (BinaryFan.swap t).pt
w : ∀ (j : Discrete WalkingPair), m ≫ (BinaryFan.swap t).π.app j = s.π.app j
h : (∀ (j : Discrete WalkingPair), m ≫ t.π.app j = (BinaryFan.swap s).π.app j) → m = lift I (BinaryFan.swap s)
⊢ ∀ (j : Discrete WalkingPair), m ≫ t.π.app j = (BinaryFan.swap s).π.app j

Next tactic:
rintro ⟨j⟩
/-- If a binary fan `t` over `P Q` is a limit cone, then `t.swap` is a limit cone over `Q P`.
-/
@[simps]
def IsLimit.swapBinaryFan {P Q : C} {t : BinaryFan P Q} (I : IsLimit t) : IsLimit t.swap where
  lift s := I.lift (BinaryFan.swap s)
  fac s := by rintro ⟨⟨⟩⟩ <;> simp
  uniq s m w := by
    have h := I.uniq (BinaryFan.swap s) m
    rw [h]
    rintro ⟨j⟩
    

Proof state:
case mk
C : Type u
inst✝ : Category.{v, u} C
X Y P Q : C
t : BinaryFan P Q
I : IsLimit t
s : Cone (pair Q P)
m : s.pt ⟶ (BinaryFan.swap t).pt
w : ∀ (j : Discrete WalkingPair), m ≫ (BinaryFan.swap t).π.app j = s.π.app j
h : (∀ (j : Discrete WalkingPair), m ≫ t.π.app j = (BinaryFan.swap s).π.app j) → m = lift I (BinaryFan.swap s)
j : WalkingPair
⊢ m ≫ t.π.app { as := j } = (BinaryFan.swap s).π.app { as := j }

Next tactic:
specialize w ⟨WalkingPair.swap j⟩
/-- If a binary fan `t` over `P Q` is a limit cone, then `t.swap` is a limit cone over `Q P`.
-/
@[simps]
def IsLimit.swapBinaryFan {P Q : C} {t : BinaryFan P Q} (I : IsLimit t) : IsLimit t.swap where
  lift s := I.lift (BinaryFan.swap s)
  fac s := by rintro ⟨⟨⟩⟩ <;> simp
  uniq s m w := by
    have h := I.uniq (BinaryFan.swap s) m
    rw [h]
    rintro ⟨j⟩
    specialize w ⟨WalkingPair.swap j⟩
    

Proof state:
case mk
C : Type u
inst✝ : Category.{v, u} C
X Y P Q : C
t : BinaryFan P Q
I : IsLimit t
s : Cone (pair Q P)
m : s.pt ⟶ (BinaryFan.swap t).pt
h : (∀ (j : Discrete WalkingPair), m ≫ t.π.app j = (BinaryFan.swap s).π.app j) → m = lift I (BinaryFan.swap s)
j : WalkingPair
w : m ≫ (BinaryFan.swap t).π.app { as := WalkingPair.swap j } = s.π.app { as := WalkingPair.swap j }
⊢ m ≫ t.π.app { as := j } = (BinaryFan.swap s).π.app { as := j }

Next tactic:
cases j
/-- If a binary fan `t` over `P Q` is a limit cone, then `t.swap` is a limit cone over `Q P`.
-/
@[simps]
def IsLimit.swapBinaryFan {P Q : C} {t : BinaryFan P Q} (I : IsLimit t) : IsLimit t.swap where
  lift s := I.lift (BinaryFan.swap s)
  fac s := by rintro ⟨⟨⟩⟩ <;> simp
  uniq s m w := by
    have h := I.uniq (BinaryFan.swap s) m
    rw [h]
    rintro ⟨j⟩
    specialize w ⟨WalkingPair.swap j⟩
    cases j <;> 

Proof state:
case mk.left
C : Type u
inst✝ : Category.{v, u} C
X Y P Q : C
t : BinaryFan P Q
I : IsLimit t
s : Cone (pair Q P)
m : s.pt ⟶ (BinaryFan.swap t).pt
h : (∀ (j : Discrete WalkingPair), m ≫ t.π.app j = (BinaryFan.swap s).π.app j) → m = lift I (BinaryFan.swap s)
w :
  m ≫ (BinaryFan.swap t).π.app { as := WalkingPair.swap WalkingPair.left } =
    s.π.app { as := WalkingPair.swap WalkingPair.left }
⊢ m ≫ t.π.app { as := WalkingPair.left } = (BinaryFan.swap s).π.app { as := WalkingPair.left }

Next tactic:
exact w
/-- If a binary fan `t` over `P Q` is a limit cone, then `t.swap` is a limit cone over `Q P`.
-/
@[simps]
def IsLimit.swapBinaryFan {P Q : C} {t : BinaryFan P Q} (I : IsLimit t) : IsLimit t.swap where
  lift s := I.lift (BinaryFan.swap s)
  fac s := by rintro ⟨⟨⟩⟩ <;> simp
  uniq s m w := by
    have h := I.uniq (BinaryFan.swap s) m
    rw [h]
    rintro ⟨j⟩
    specialize w ⟨WalkingPair.swap j⟩
    cases j <;> 

Proof state:
case mk.right
C : Type u
inst✝ : Category.{v, u} C
X Y P Q : C
t : BinaryFan P Q
I : IsLimit t
s : Cone (pair Q P)
m : s.pt ⟶ (BinaryFan.swap t).pt
h : (∀ (j : Discrete WalkingPair), m ≫ t.π.app j = (BinaryFan.swap s).π.app j) → m = lift I (BinaryFan.swap s)
w :
  m ≫ (BinaryFan.swap t).π.app { as := WalkingPair.swap WalkingPair.right } =
    s.π.app { as := WalkingPair.swap WalkingPair.right }
⊢ m ≫ t.π.app { as := WalkingPair.right } = (BinaryFan.swap s).π.app { as := WalkingPair.right }

Next tactic:
exact w
/-- If all the binary fans involved a limit cones, `BinaryFan.assoc` produces another limit cone.
-/
@[simps]
def IsLimit.assoc {X Y Z : C} {sXY : BinaryFan X Y} (P : IsLimit sXY) {sYZ : BinaryFan Y Z}
    (Q : IsLimit sYZ) {s : BinaryFan sXY.pt Z} (R : IsLimit s) : IsLimit (BinaryFan.assoc Q s) where
  lift t := R.lift (BinaryFan.assocInv P t)
  fac t := by
    

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ X Y Z : C
sXY : BinaryFan X Y
P : IsLimit sXY
sYZ : BinaryFan Y Z
Q : IsLimit sYZ
s : BinaryFan sXY.pt Z
R : IsLimit s
t : Cone (pair X sYZ.pt)
⊢ ∀ (j : Discrete WalkingPair), (fun t => lift R (BinaryFan.assocInv P t)) t ≫ (BinaryFan.assoc Q s).π.app j = t.π.app j

Next tactic:
rintro ⟨⟨⟩⟩
/-- If all the binary fans involved a limit cones, `BinaryFan.assoc` produces another limit cone.
-/
@[simps]
def IsLimit.assoc {X Y Z : C} {sXY : BinaryFan X Y} (P : IsLimit sXY) {sYZ : BinaryFan Y Z}
    (Q : IsLimit sYZ) {s : BinaryFan sXY.pt Z} (R : IsLimit s) : IsLimit (BinaryFan.assoc Q s) where
  lift t := R.lift (BinaryFan.assocInv P t)
  fac t := by
    rintro ⟨⟨⟩⟩ <;> 

Proof state:
case mk.left
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ X Y Z : C
sXY : BinaryFan X Y
P : IsLimit sXY
sYZ : BinaryFan Y Z
Q : IsLimit sYZ
s : BinaryFan sXY.pt Z
R : IsLimit s
t : Cone (pair X sYZ.pt)
⊢ (fun t => lift R (BinaryFan.assocInv P t)) t ≫ (BinaryFan.assoc Q s).π.app { as := WalkingPair.left } =
    t.π.app { as := WalkingPair.left }

Next tactic:
simp
/-- If all the binary fans involved a limit cones, `BinaryFan.assoc` produces another limit cone.
-/
@[simps]
def IsLimit.assoc {X Y Z : C} {sXY : BinaryFan X Y} (P : IsLimit sXY) {sYZ : BinaryFan Y Z}
    (Q : IsLimit sYZ) {s : BinaryFan sXY.pt Z} (R : IsLimit s) : IsLimit (BinaryFan.assoc Q s) where
  lift t := R.lift (BinaryFan.assocInv P t)
  fac t := by
    rintro ⟨⟨⟩⟩ <;> 

Proof state:
case mk.right
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ X Y Z : C
sXY : BinaryFan X Y
P : IsLimit sXY
sYZ : BinaryFan Y Z
Q : IsLimit sYZ
s : BinaryFan sXY.pt Z
R : IsLimit s
t : Cone (pair X sYZ.pt)
⊢ (fun t => lift R (BinaryFan.assocInv P t)) t ≫ (BinaryFan.assoc Q s).π.app { as := WalkingPair.right } =
    t.π.app { as := WalkingPair.right }

Next tactic:
simp
/-- If all the binary fans involved a limit cones, `BinaryFan.assoc` produces another limit cone.
-/
@[simps]
def IsLimit.assoc {X Y Z : C} {sXY : BinaryFan X Y} (P : IsLimit sXY) {sYZ : BinaryFan Y Z}
    (Q : IsLimit sYZ) {s : BinaryFan sXY.pt Z} (R : IsLimit s) : IsLimit (BinaryFan.assoc Q s) where
  lift t := R.lift (BinaryFan.assocInv P t)
  fac t := by
    rintro ⟨⟨⟩⟩ <;> simp
    

Proof state:
case mk.right
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ X Y Z : C
sXY : BinaryFan X Y
P : IsLimit sXY
sYZ : BinaryFan Y Z
Q : IsLimit sYZ
s : BinaryFan sXY.pt Z
R : IsLimit s
t : Cone (pair X sYZ.pt)
⊢ lift R (BinaryFan.assocInv P t) ≫ lift Q (BinaryFan.mk (BinaryFan.fst s ≫ BinaryFan.snd sXY) (BinaryFan.snd s)) =
    BinaryFan.snd t

Next tactic:
apply Q.hom_ext
/-- If all the binary fans involved a limit cones, `BinaryFan.assoc` produces another limit cone.
-/
@[simps]
def IsLimit.assoc {X Y Z : C} {sXY : BinaryFan X Y} (P : IsLimit sXY) {sYZ : BinaryFan Y Z}
    (Q : IsLimit sYZ) {s : BinaryFan sXY.pt Z} (R : IsLimit s) : IsLimit (BinaryFan.assoc Q s) where
  lift t := R.lift (BinaryFan.assocInv P t)
  fac t := by
    rintro ⟨⟨⟩⟩ <;> simp
    apply Q.hom_ext
    

Proof state:
case mk.right
C : Type u
inst✝ : Category.{v, u} C
X✝ Y✝ X Y Z : C
sXY : BinaryFan X Y
P : IsLimit sXY
sYZ : BinaryFan Y Z
Q : IsLimit sYZ
s : BinaryFan sXY.pt Z
R : IsLimit s
t : Cone (pair X sYZ.pt)
⊢ ∀ (j : Discrete WalkingPair),
    (lift R (BinaryFan.assocInv P t) ≫ lift Q (BinaryFan.mk (BinaryFan.fst s ≫ BinaryFan.snd sXY) (BinaryFan.snd s))) ≫
        sYZ.π.app j =
      BinaryFan.snd t ≫ sYZ.π.app j

Next tactic:
rintro ⟨⟨⟩⟩