l3lab/ntp-mathlib huggingface dataset:
/--
The equivalence `WalkingParallelPair ⥤ WalkingParallelPairᵒᵖ` sending left to left and right to
right.
-/
@[simps functor inverse]
def walkingParallelPairOpEquiv : WalkingParallelPair ≌ WalkingParallelPairᵒᵖ where
  functor := walkingParallelPairOp
  inverse := walkingParallelPairOp.leftOp
  unitIso :=
    NatIso.ofComponents (fun j => eqToIso (by cases j <;> rfl))
      (by rintro _ _ (_ | _ | _) <;> simp)
  counitIso :=
    NatIso.ofComponents (fun j => eqToIso (by
            induction' j with X
            cases X <;> rfl))
      (fun {i} {j} f => by
      induction' i with i
      induction' j with j
      let g := f.unop
      have : f = g.op := rfl
      rw [this]
      cases i <;> cases j <;> cases g <;> rfl)
  functor_unitIso_comp := fun j => by 

Proof state:
j : WalkingParallelPair
⊢ walkingParallelPairOp.map
        ((NatIso.ofComponents fun j =>
                eqToIso
                  (_ :
                    (𝟭 WalkingParallelPair).obj j =
                      (walkingParallelPairOp ⋙ walkingParallelPairOp.leftOp).obj j)).hom.app
          j) ≫
      (NatIso.ofComponents fun j =>
              eqToIso
                (_ :
                  (walkingParallelPairOp.leftOp ⋙ walkingParallelPairOp).obj j =
                    (𝟭 WalkingParallelPairᵒᵖ).obj j)).hom.app
        (walkingParallelPairOp.obj j) =
    𝟙 (walkingParallelPairOp.obj j)

Next tactic:
cases j
/--
The equivalence `WalkingParallelPair ⥤ WalkingParallelPairᵒᵖ` sending left to left and right to
right.
-/
@[simps functor inverse]
def walkingParallelPairOpEquiv : WalkingParallelPair ≌ WalkingParallelPairᵒᵖ where
  functor := walkingParallelPairOp
  inverse := walkingParallelPairOp.leftOp
  unitIso :=
    NatIso.ofComponents (fun j => eqToIso (by cases j <;> rfl))
      (by rintro _ _ (_ | _ | _) <;> simp)
  counitIso :=
    NatIso.ofComponents (fun j => eqToIso (by
            induction' j with X
            cases X <;> rfl))
      (fun {i} {j} f => by
      induction' i with i
      induction' j with j
      let g := f.unop
      have : f = g.op := rfl
      rw [this]
      cases i <;> cases j <;> cases g <;> rfl)
  functor_unitIso_comp := fun j => by cases j <;> 

Proof state:
case zero
⊢ walkingParallelPairOp.map
        ((NatIso.ofComponents fun j =>
                eqToIso
                  (_ :
                    (𝟭 WalkingParallelPair).obj j =
                      (walkingParallelPairOp ⋙ walkingParallelPairOp.leftOp).obj j)).hom.app
          zero) ≫
      (NatIso.ofComponents fun j =>
              eqToIso
                (_ :
                  (walkingParallelPairOp.leftOp ⋙ walkingParallelPairOp).obj j =
                    (𝟭 WalkingParallelPairᵒᵖ).obj j)).hom.app
        (walkingParallelPairOp.obj zero) =
    𝟙 (walkingParallelPairOp.obj zero)

Next tactic:
rfl
/--
The equivalence `WalkingParallelPair ⥤ WalkingParallelPairᵒᵖ` sending left to left and right to
right.
-/
@[simps functor inverse]
def walkingParallelPairOpEquiv : WalkingParallelPair ≌ WalkingParallelPairᵒᵖ where
  functor := walkingParallelPairOp
  inverse := walkingParallelPairOp.leftOp
  unitIso :=
    NatIso.ofComponents (fun j => eqToIso (by cases j <;> rfl))
      (by rintro _ _ (_ | _ | _) <;> simp)
  counitIso :=
    NatIso.ofComponents (fun j => eqToIso (by
            induction' j with X
            cases X <;> rfl))
      (fun {i} {j} f => by
      induction' i with i
      induction' j with j
      let g := f.unop
      have : f = g.op := rfl
      rw [this]
      cases i <;> cases j <;> cases g <;> rfl)
  functor_unitIso_comp := fun j => by cases j <;> 

Proof state:
case one
⊢ walkingParallelPairOp.map
        ((NatIso.ofComponents fun j =>
                eqToIso
                  (_ :
                    (𝟭 WalkingParallelPair).obj j =
                      (walkingParallelPairOp ⋙ walkingParallelPairOp.leftOp).obj j)).hom.app
          one) ≫
      (NatIso.ofComponents fun j =>
              eqToIso
                (_ :
                  (walkingParallelPairOp.leftOp ⋙ walkingParallelPairOp).obj j =
                    (𝟭 WalkingParallelPairᵒᵖ).obj j)).hom.app
        (walkingParallelPairOp.obj one) =
    𝟙 (walkingParallelPairOp.obj one)

Next tactic:
rfl
/-- `parallelPair f g` is the diagram in `C` consisting of the two morphisms `f` and `g` with
    common domain and codomain. -/
def parallelPair (f g : X ⟶ Y) : WalkingParallelPair ⥤ C where
  obj x :=
    match x with
    | zero => X
    | one => Y
  map h :=
    match h with
    | WalkingParallelPairHom.id _ => 𝟙 _
    | left => f
    | right => g
  -- `sorry` can cope with this, but it's too slow:
  map_comp := by
    

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X Y : C
f g : X ⟶ Y
⊢ ∀ {X_1 Y_1 Z : WalkingParallelPair} (f_1 : X_1 ⟶ Y_1) (g_1 : Y_1 ⟶ Z),
    {
            obj := fun x =>
              match x with
              | zero => X
              | one => Y,
            map := fun {X_2 Y_2} h =>
              match X_2, Y_2, h with
              | x, .(x), WalkingParallelPairHom.id .(x) =>
                𝟙
                  ((fun x =>
                      match x with
                      | zero => X
                      | one => Y)
                    x)
              | .(zero), .(one), left => f
              | .(zero), .(one), right => g }.map
        (f_1 ≫ g_1) =
      {
              obj := fun x =>
                match x with
                | zero => X
                | one => Y,
              map := fun {X_2 Y_2} h =>
                match X_2, Y_2, h with
                | x, .(x), WalkingParallelPairHom.id .(x) =>
                  𝟙
                    ((fun x =>
                        match x with
                        | zero => X
                        | one => Y)
                      x)
                | .(zero), .(one), left => f
                | .(zero), .(one), right => g }.map
          f_1 ≫
        {
              obj := fun x =>
                match x with
                | zero => X
                | one => Y,
              map := fun {X_2 Y_2} h =>
                match X_2, Y_2, h with
                | x, .(x), WalkingParallelPairHom.id .(x) =>
                  𝟙
                    ((fun x =>
                        match x with
                        | zero => X
                        | one => Y)
                      x)
                | .(zero), .(one), left => f
                | .(zero), .(one), right => g }.map
          g_1

Next tactic:
rintro _ _ _ ⟨⟩ g
/-- `parallelPair f g` is the diagram in `C` consisting of the two morphisms `f` and `g` with
    common domain and codomain. -/
def parallelPair (f g : X ⟶ Y) : WalkingParallelPair ⥤ C where
  obj x :=
    match x with
    | zero => X
    | one => Y
  map h :=
    match h with
    | WalkingParallelPairHom.id _ => 𝟙 _
    | left => f
    | right => g
  -- `sorry` can cope with this, but it's too slow:
  map_comp := by
    rintro _ _ _ ⟨⟩ g <;> 

Proof state:
case left
C : Type u
inst✝ : Category.{v, u} C
X Y : C
f g✝ : X ⟶ Y
Z✝ : WalkingParallelPair
g : one ⟶ Z✝
⊢ {
          obj := fun x =>
            match x with
            | zero => X
            | one => Y,
          map := fun {X_1 Y_1} h =>
            match X_1, Y_1, h with
            | x, .(x), WalkingParallelPairHom.id .(x) =>
              𝟙
                ((fun x =>
                    match x with
                    | zero => X
                    | one => Y)
                  x)
            | .(zero), .(one), left => f
            | .(zero), .(one), right => g✝ }.map
      (left ≫ g) =
    {
            obj := fun x =>
              match x with
              | zero => X
              | one => Y,
            map := fun {X_1 Y_1} h =>
              match X_1, Y_1, h with
              | x, .(x), WalkingParallelPairHom.id .(x) =>
                𝟙
                  ((fun x =>
                      match x with
                      | zero => X
                      | one => Y)
                    x)
              | .(zero), .(one), left => f
              | .(zero), .(one), right => g✝ }.map
        left ≫
      {
            obj := fun x =>
              match x with
              | zero => X
              | one => Y,
            map := fun {X_1 Y_1} h =>
              match X_1, Y_1, h with
              | x, .(x), WalkingParallelPairHom.id .(x) =>
                𝟙
                  ((fun x =>
                      match x with
                      | zero => X
                      | one => Y)
                    x)
              | .(zero), .(one), left => f
              | .(zero), .(one), right => g✝ }.map
        g

Next tactic:
cases g
/-- `parallelPair f g` is the diagram in `C` consisting of the two morphisms `f` and `g` with
    common domain and codomain. -/
def parallelPair (f g : X ⟶ Y) : WalkingParallelPair ⥤ C where
  obj x :=
    match x with
    | zero => X
    | one => Y
  map h :=
    match h with
    | WalkingParallelPairHom.id _ => 𝟙 _
    | left => f
    | right => g
  -- `sorry` can cope with this, but it's too slow:
  map_comp := by
    rintro _ _ _ ⟨⟩ g <;> 

Proof state:
case right
C : Type u
inst✝ : Category.{v, u} C
X Y : C
f g✝ : X ⟶ Y
Z✝ : WalkingParallelPair
g : one ⟶ Z✝
⊢ {
          obj := fun x =>
            match x with
            | zero => X
            | one => Y,
          map := fun {X_1 Y_1} h =>
            match X_1, Y_1, h with
            | x, .(x), WalkingParallelPairHom.id .(x) =>
              𝟙
                ((fun x =>
                    match x with
                    | zero => X
                    | one => Y)
                  x)
            | .(zero), .(one), left => f
            | .(zero), .(one), right => g✝ }.map
      (right ≫ g) =
    {
            obj := fun x =>
              match x with
              | zero => X
              | one => Y,
            map := fun {X_1 Y_1} h =>
              match X_1, Y_1, h with
              | x, .(x), WalkingParallelPairHom.id .(x) =>
                𝟙
                  ((fun x =>
                      match x with
                      | zero => X
                      | one => Y)
                    x)
              | .(zero), .(one), left => f
              | .(zero), .(one), right => g✝ }.map
        right ≫
      {
            obj := fun x =>
              match x with
              | zero => X
              | one => Y,
            map := fun {X_1 Y_1} h =>
              match X_1, Y_1, h with
              | x, .(x), WalkingParallelPairHom.id .(x) =>
                𝟙
                  ((fun x =>
                      match x with
                      | zero => X
                      | one => Y)
                    x)
              | .(zero), .(one), left => f
              | .(zero), .(one), right => g✝ }.map
        g

Next tactic:
cases g
/-- `parallelPair f g` is the diagram in `C` consisting of the two morphisms `f` and `g` with
    common domain and codomain. -/
def parallelPair (f g : X ⟶ Y) : WalkingParallelPair ⥤ C where
  obj x :=
    match x with
    | zero => X
    | one => Y
  map h :=
    match h with
    | WalkingParallelPairHom.id _ => 𝟙 _
    | left => f
    | right => g
  -- `sorry` can cope with this, but it's too slow:
  map_comp := by
    rintro _ _ _ ⟨⟩ g <;> 

Proof state:
case id
C : Type u
inst✝ : Category.{v, u} C
X Y : C
f g✝ : X ⟶ Y
X✝ Z✝ : WalkingParallelPair
g : X✝ ⟶ Z✝
⊢ {
          obj := fun x =>
            match x with
            | zero => X
            | one => Y,
          map := fun {X_1 Y_1} h =>
            match X_1, Y_1, h with
            | x, .(x), WalkingParallelPairHom.id .(x) =>
              𝟙
                ((fun x =>
                    match x with
                    | zero => X
                    | one => Y)
                  x)
            | .(zero), .(one), left => f
            | .(zero), .(one), right => g✝ }.map
      (WalkingParallelPairHom.id X✝ ≫ g) =
    {
            obj := fun x =>
              match x with
              | zero => X
              | one => Y,
            map := fun {X_1 Y_1} h =>
              match X_1, Y_1, h with
              | x, .(x), WalkingParallelPairHom.id .(x) =>
                𝟙
                  ((fun x =>
                      match x with
                      | zero => X
                      | one => Y)
                    x)
              | .(zero), .(one), left => f
              | .(zero), .(one), right => g✝ }.map
        (WalkingParallelPairHom.id X✝) ≫
      {
            obj := fun x =>
              match x with
              | zero => X
              | one => Y,
            map := fun {X_1 Y_1} h =>
              match X_1, Y_1, h with
              | x, .(x), WalkingParallelPairHom.id .(x) =>
                𝟙
                  ((fun x =>
                      match x with
                      | zero => X
                      | one => Y)
                    x)
              | .(zero), .(one), left => f
              | .(zero), .(one), right => g✝ }.map
        g

Next tactic:
cases g
/-- `parallelPair f g` is the diagram in `C` consisting of the two morphisms `f` and `g` with
    common domain and codomain. -/
def parallelPair (f g : X ⟶ Y) : WalkingParallelPair ⥤ C where
  obj x :=
    match x with
    | zero => X
    | one => Y
  map h :=
    match h with
    | WalkingParallelPairHom.id _ => 𝟙 _
    | left => f
    | right => g
  -- `sorry` can cope with this, but it's too slow:
  map_comp := by
    rintro _ _ _ ⟨⟩ g <;> cases g <;> 

Proof state:
case left.id
C : Type u
inst✝ : Category.{v, u} C
X Y : C
f g : X ⟶ Y
⊢ {
          obj := fun x =>
            match x with
            | zero => X
            | one => Y,
          map := fun {X_1 Y_1} h =>
            match X_1, Y_1, h with
            | x, .(x), WalkingParallelPairHom.id .(x) =>
              𝟙
                ((fun x =>
                    match x with
                    | zero => X
                    | one => Y)
                  x)
            | .(zero), .(one), left => f
            | .(zero), .(one), right => g }.map
      (left ≫ WalkingParallelPairHom.id one) =
    {
            obj := fun x =>
              match x with
              | zero => X
              | one => Y,
            map := fun {X_1 Y_1} h =>
              match X_1, Y_1, h with
              | x, .(x), WalkingParallelPairHom.id .(x) =>
                𝟙
                  ((fun x =>
                      match x with
                      | zero => X
                      | one => Y)
                    x)
              | .(zero), .(one), left => f
              | .(zero), .(one), right => g }.map
        left ≫
      {
            obj := fun x =>
              match x with
              | zero => X
              | one => Y,
            map := fun {X_1 Y_1} h =>
              match X_1, Y_1, h with
              | x, .(x), WalkingParallelPairHom.id .(x) =>
                𝟙
                  ((fun x =>
                      match x with
                      | zero => X
                      | one => Y)
                    x)
              | .(zero), .(one), left => f
              | .(zero), .(one), right => g }.map
        (WalkingParallelPairHom.id one)

Next tactic:
{dsimp; simp}
/-- `parallelPair f g` is the diagram in `C` consisting of the two morphisms `f` and `g` with
    common domain and codomain. -/
def parallelPair (f g : X ⟶ Y) : WalkingParallelPair ⥤ C where
  obj x :=
    match x with
    | zero => X
    | one => Y
  map h :=
    match h with
    | WalkingParallelPairHom.id _ => 𝟙 _
    | left => f
    | right => g
  -- `sorry` can cope with this, but it's too slow:
  map_comp := by
    rintro _ _ _ ⟨⟩ g <;> cases g <;> {

Proof state:
case left.id
C : Type u
inst✝ : Category.{v, u} C
X Y : C
f g : X ⟶ Y
⊢ {
          obj := fun x =>
            match x with
            | zero => X
            | one => Y,
          map := fun {X_1 Y_1} h =>
            match X_1, Y_1, h with
            | x, .(x), WalkingParallelPairHom.id .(x) =>
              𝟙
                ((fun x =>
                    match x with
                    | zero => X
                    | one => Y)
                  x)
            | .(zero), .(one), left => f
            | .(zero), .(one), right => g }.map
      (left ≫ WalkingParallelPairHom.id one) =
    {
            obj := fun x =>
              match x with
              | zero => X
              | one => Y,
            map := fun {X_1 Y_1} h =>
              match X_1, Y_1, h with
              | x, .(x), WalkingParallelPairHom.id .(x) =>
                𝟙
                  ((fun x =>
                      match x with
                      | zero => X
                      | one => Y)
                    x)
              | .(zero), .(one), left => f
              | .(zero), .(one), right => g }.map
        left ≫
      {
            obj := fun x =>
              match x with
              | zero => X
              | one => Y,
            map := fun {X_1 Y_1} h =>
              match X_1, Y_1, h with
              | x, .(x), WalkingParallelPairHom.id .(x) =>
                𝟙
                  ((fun x =>
                      match x with
                      | zero => X
                      | one => Y)
                    x)
              | .(zero), .(one), left => f
              | .(zero), .(one), right => g }.map
        (WalkingParallelPairHom.id one)

Next tactic:
dsimp
/-- `parallelPair f g` is the diagram in `C` consisting of the two morphisms `f` and `g` with
    common domain and codomain. -/
def parallelPair (f g : X ⟶ Y) : WalkingParallelPair ⥤ C where
  obj x :=
    match x with
    | zero => X
    | one => Y
  map h :=
    match h with
    | WalkingParallelPairHom.id _ => 𝟙 _
    | left => f
    | right => g
  -- `sorry` can cope with this, but it's too slow:
  map_comp := by
    rintro _ _ _ ⟨⟩ g <;> cases g <;> {dsimp; 

Proof state:
case left.id
C : Type u
inst✝ : Category.{v, u} C
X Y : C
f g : X ⟶ Y
⊢ (match zero, one, left ≫ 𝟙 one with
    | x, .(x), WalkingParallelPairHom.id .(x) =>
      𝟙
        (match x with
        | zero => X
        | one => Y)
    | .(zero), .(one), left => f
    | .(zero), .(one), right => g) =
    f ≫ 𝟙 Y

Next tactic:
simp
/-- `parallelPair f g` is the diagram in `C` consisting of the two morphisms `f` and `g` with
    common domain and codomain. -/
def parallelPair (f g : X ⟶ Y) : WalkingParallelPair ⥤ C where
  obj x :=
    match x with
    | zero => X
    | one => Y
  map h :=
    match h with
    | WalkingParallelPairHom.id _ => 𝟙 _
    | left => f
    | right => g
  -- `sorry` can cope with this, but it's too slow:
  map_comp := by
    rintro _ _ _ ⟨⟩ g <;> cases g <;> 

Proof state:
case right.id
C : Type u
inst✝ : Category.{v, u} C
X Y : C
f g : X ⟶ Y
⊢ {
          obj := fun x =>
            match x with
            | zero => X
            | one => Y,
          map := fun {X_1 Y_1} h =>
            match X_1, Y_1, h with
            | x, .(x), WalkingParallelPairHom.id .(x) =>
              𝟙
                ((fun x =>
                    match x with
                    | zero => X
                    | one => Y)
                  x)
            | .(zero), .(one), left => f
            | .(zero), .(one), right => g }.map
      (right ≫ WalkingParallelPairHom.id one) =
    {
            obj := fun x =>
              match x with
              | zero => X
              | one => Y,
            map := fun {X_1 Y_1} h =>
              match X_1, Y_1, h with
              | x, .(x), WalkingParallelPairHom.id .(x) =>
                𝟙
                  ((fun x =>
                      match x with
                      | zero => X
                      | one => Y)
                    x)
              | .(zero), .(one), left => f
              | .(zero), .(one), right => g }.map
        right ≫
      {
            obj := fun x =>
              match x with
              | zero => X
              | one => Y,
            map := fun {X_1 Y_1} h =>
              match X_1, Y_1, h with
              | x, .(x), WalkingParallelPairHom.id .(x) =>
                𝟙
                  ((fun x =>
                      match x with
                      | zero => X
                      | one => Y)
                    x)
              | .(zero), .(one), left => f
              | .(zero), .(one), right => g }.map
        (WalkingParallelPairHom.id one)

Next tactic:
{dsimp; simp}
/-- `parallelPair f g` is the diagram in `C` consisting of the two morphisms `f` and `g` with
    common domain and codomain. -/
def parallelPair (f g : X ⟶ Y) : WalkingParallelPair ⥤ C where
  obj x :=
    match x with
    | zero => X
    | one => Y
  map h :=
    match h with
    | WalkingParallelPairHom.id _ => 𝟙 _
    | left => f
    | right => g
  -- `sorry` can cope with this, but it's too slow:
  map_comp := by
    rintro _ _ _ ⟨⟩ g <;> cases g <;> {

Proof state:
case right.id
C : Type u
inst✝ : Category.{v, u} C
X Y : C
f g : X ⟶ Y
⊢ {
          obj := fun x =>
            match x with
            | zero => X
            | one => Y,
          map := fun {X_1 Y_1} h =>
            match X_1, Y_1, h with
            | x, .(x), WalkingParallelPairHom.id .(x) =>
              𝟙
                ((fun x =>
                    match x with
                    | zero => X
                    | one => Y)
                  x)
            | .(zero), .(one), left => f
            | .(zero), .(one), right => g }.map
      (right ≫ WalkingParallelPairHom.id one) =
    {
            obj := fun x =>
              match x with
              | zero => X
              | one => Y,
            map := fun {X_1 Y_1} h =>
              match X_1, Y_1, h with
              | x, .(x), WalkingParallelPairHom.id .(x) =>
                𝟙
                  ((fun x =>
                      match x with
                      | zero => X
                      | one => Y)
                    x)
              | .(zero), .(one), left => f
              | .(zero), .(one), right => g }.map
        right ≫
      {
            obj := fun x =>
              match x with
              | zero => X
              | one => Y,
            map := fun {X_1 Y_1} h =>
              match X_1, Y_1, h with
              | x, .(x), WalkingParallelPairHom.id .(x) =>
                𝟙
                  ((fun x =>
                      match x with
                      | zero => X
                      | one => Y)
                    x)
              | .(zero), .(one), left => f
              | .(zero), .(one), right => g }.map
        (WalkingParallelPairHom.id one)

Next tactic:
dsimp
/-- `parallelPair f g` is the diagram in `C` consisting of the two morphisms `f` and `g` with
    common domain and codomain. -/
def parallelPair (f g : X ⟶ Y) : WalkingParallelPair ⥤ C where
  obj x :=
    match x with
    | zero => X
    | one => Y
  map h :=
    match h with
    | WalkingParallelPairHom.id _ => 𝟙 _
    | left => f
    | right => g
  -- `sorry` can cope with this, but it's too slow:
  map_comp := by
    rintro _ _ _ ⟨⟩ g <;> cases g <;> {dsimp; 

Proof state:
case right.id
C : Type u
inst✝ : Category.{v, u} C
X Y : C
f g : X ⟶ Y
⊢ (match zero, one, right ≫ 𝟙 one with
    | x, .(x), WalkingParallelPairHom.id .(x) =>
      𝟙
        (match x with
        | zero => X
        | one => Y)
    | .(zero), .(one), left => f
    | .(zero), .(one), right => g) =
    g ≫ 𝟙 Y

Next tactic:
simp