l3lab/ntp-mathlib huggingface dataset:
/-- The inverse associator functor `C ⊕ (D ⊕ E) ⥤ (C ⊕ D) ⊕ E` for sums of categories.
-/
def inverseAssociator : Sum C (Sum D E) ⥤ Sum (Sum C D) E
    where
  obj X :=
    match X with
    | inl X => inl (inl X)
    | inr (inl X) => inl (inr X)
    | inr (inr X) => inr X
  map {X Y} f :=
    match X, Y, f with
    | inl _, inl _, f => f
    | inr (inl _), inr (inl _), f => f
    | inr (inr _), inr (inr _), f => f
  map_id := by rintro (_|(_|_)) <;> rfl
  map_comp := by
    rintro (_|(_|_)) (_|(_|_)) (_|(_|_)) f g <;> first | 

Proof state:
case inl.inl.inr.inr
C : Type u
inst✝² : Category.{v, u} C
D : Type u
inst✝¹ : Category.{v, u} D
E : Type u
inst✝ : Category.{v, u} E
val✝² val✝¹ : C
val✝ : E
f : inl val✝² ⟶ inl val✝¹
g : inl val✝¹ ⟶ inr (inr val✝)
⊢ {
          obj := fun X =>
            match X with
            | inl X => inl (inl X)
            | inr (inl X) => inl (inr X)
            | inr (inr X) => inr X,
          map := fun {X Y} f =>
            match X, Y, f with
            | inl val, inl val_1, f => f
            | inr (inl val), inr (inl val_1), f => f
            | inr (inr val), inr (inr val_1), f => f }.map
      (f ≫ g) =
    {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        f ≫
      {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        g

Next tactic:
cases f
/-- The inverse associator functor `C ⊕ (D ⊕ E) ⥤ (C ⊕ D) ⊕ E` for sums of categories.
-/
def inverseAssociator : Sum C (Sum D E) ⥤ Sum (Sum C D) E
    where
  obj X :=
    match X with
    | inl X => inl (inl X)
    | inr (inl X) => inl (inr X)
    | inr (inr X) => inr X
  map {X Y} f :=
    match X, Y, f with
    | inl _, inl _, f => f
    | inr (inl _), inr (inl _), f => f
    | inr (inr _), inr (inr _), f => f
  map_id := by rintro (_|(_|_)) <;> rfl
  map_comp := by
    rintro (_|(_|_)) (_|(_|_)) (_|(_|_)) f g <;> first | cases f | 

Proof state:
case inl.inl.inr.inr
C : Type u
inst✝² : Category.{v, u} C
D : Type u
inst✝¹ : Category.{v, u} D
E : Type u
inst✝ : Category.{v, u} E
val✝² val✝¹ : C
val✝ : E
f : inl val✝² ⟶ inl val✝¹
g : inl val✝¹ ⟶ inr (inr val✝)
⊢ {
          obj := fun X =>
            match X with
            | inl X => inl (inl X)
            | inr (inl X) => inl (inr X)
            | inr (inr X) => inr X,
          map := fun {X Y} f =>
            match X, Y, f with
            | inl val, inl val_1, f => f
            | inr (inl val), inr (inl val_1), f => f
            | inr (inr val), inr (inr val_1), f => f }.map
      (f ≫ g) =
    {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        f ≫
      {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        g

Next tactic:
cases g
/-- The inverse associator functor `C ⊕ (D ⊕ E) ⥤ (C ⊕ D) ⊕ E` for sums of categories.
-/
def inverseAssociator : Sum C (Sum D E) ⥤ Sum (Sum C D) E
    where
  obj X :=
    match X with
    | inl X => inl (inl X)
    | inr (inl X) => inl (inr X)
    | inr (inr X) => inr X
  map {X Y} f :=
    match X, Y, f with
    | inl _, inl _, f => f
    | inr (inl _), inr (inl _), f => f
    | inr (inr _), inr (inr _), f => f
  map_id := by rintro (_|(_|_)) <;> rfl
  map_comp := by
    rintro (_|(_|_)) (_|(_|_)) (_|(_|_)) f g <;> 

Proof state:
case inl.inr.inl.inl
C : Type u
inst✝² : Category.{v, u} C
D : Type u
inst✝¹ : Category.{v, u} D
E : Type u
inst✝ : Category.{v, u} E
val✝² : C
val✝¹ : D
val✝ : C
f : inl val✝² ⟶ inr (inl val✝¹)
g : inr (inl val✝¹) ⟶ inl val✝
⊢ {
          obj := fun X =>
            match X with
            | inl X => inl (inl X)
            | inr (inl X) => inl (inr X)
            | inr (inr X) => inr X,
          map := fun {X Y} f =>
            match X, Y, f with
            | inl val, inl val_1, f => f
            | inr (inl val), inr (inl val_1), f => f
            | inr (inr val), inr (inr val_1), f => f }.map
      (f ≫ g) =
    {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        f ≫
      {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        g

Next tactic:
first | cases f | cases g | aesop_cat
/-- The inverse associator functor `C ⊕ (D ⊕ E) ⥤ (C ⊕ D) ⊕ E` for sums of categories.
-/
def inverseAssociator : Sum C (Sum D E) ⥤ Sum (Sum C D) E
    where
  obj X :=
    match X with
    | inl X => inl (inl X)
    | inr (inl X) => inl (inr X)
    | inr (inr X) => inr X
  map {X Y} f :=
    match X, Y, f with
    | inl _, inl _, f => f
    | inr (inl _), inr (inl _), f => f
    | inr (inr _), inr (inr _), f => f
  map_id := by rintro (_|(_|_)) <;> rfl
  map_comp := by
    rintro (_|(_|_)) (_|(_|_)) (_|(_|_)) f g <;> first | 

Proof state:
case inl.inr.inl.inl
C : Type u
inst✝² : Category.{v, u} C
D : Type u
inst✝¹ : Category.{v, u} D
E : Type u
inst✝ : Category.{v, u} E
val✝² : C
val✝¹ : D
val✝ : C
f : inl val✝² ⟶ inr (inl val✝¹)
g : inr (inl val✝¹) ⟶ inl val✝
⊢ {
          obj := fun X =>
            match X with
            | inl X => inl (inl X)
            | inr (inl X) => inl (inr X)
            | inr (inr X) => inr X,
          map := fun {X Y} f =>
            match X, Y, f with
            | inl val, inl val_1, f => f
            | inr (inl val), inr (inl val_1), f => f
            | inr (inr val), inr (inr val_1), f => f }.map
      (f ≫ g) =
    {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        f ≫
      {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        g

Next tactic:
cases f
/-- The inverse associator functor `C ⊕ (D ⊕ E) ⥤ (C ⊕ D) ⊕ E` for sums of categories.
-/
def inverseAssociator : Sum C (Sum D E) ⥤ Sum (Sum C D) E
    where
  obj X :=
    match X with
    | inl X => inl (inl X)
    | inr (inl X) => inl (inr X)
    | inr (inr X) => inr X
  map {X Y} f :=
    match X, Y, f with
    | inl _, inl _, f => f
    | inr (inl _), inr (inl _), f => f
    | inr (inr _), inr (inr _), f => f
  map_id := by rintro (_|(_|_)) <;> rfl
  map_comp := by
    rintro (_|(_|_)) (_|(_|_)) (_|(_|_)) f g <;> 

Proof state:
case inl.inr.inl.inr.inl
C : Type u
inst✝² : Category.{v, u} C
D : Type u
inst✝¹ : Category.{v, u} D
E : Type u
inst✝ : Category.{v, u} E
val✝² : C
val✝¹ val✝ : D
f : inl val✝² ⟶ inr (inl val✝¹)
g : inr (inl val✝¹) ⟶ inr (inl val✝)
⊢ {
          obj := fun X =>
            match X with
            | inl X => inl (inl X)
            | inr (inl X) => inl (inr X)
            | inr (inr X) => inr X,
          map := fun {X Y} f =>
            match X, Y, f with
            | inl val, inl val_1, f => f
            | inr (inl val), inr (inl val_1), f => f
            | inr (inr val), inr (inr val_1), f => f }.map
      (f ≫ g) =
    {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        f ≫
      {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        g

Next tactic:
first | cases f | cases g | aesop_cat
/-- The inverse associator functor `C ⊕ (D ⊕ E) ⥤ (C ⊕ D) ⊕ E` for sums of categories.
-/
def inverseAssociator : Sum C (Sum D E) ⥤ Sum (Sum C D) E
    where
  obj X :=
    match X with
    | inl X => inl (inl X)
    | inr (inl X) => inl (inr X)
    | inr (inr X) => inr X
  map {X Y} f :=
    match X, Y, f with
    | inl _, inl _, f => f
    | inr (inl _), inr (inl _), f => f
    | inr (inr _), inr (inr _), f => f
  map_id := by rintro (_|(_|_)) <;> rfl
  map_comp := by
    rintro (_|(_|_)) (_|(_|_)) (_|(_|_)) f g <;> first | 

Proof state:
case inl.inr.inl.inr.inl
C : Type u
inst✝² : Category.{v, u} C
D : Type u
inst✝¹ : Category.{v, u} D
E : Type u
inst✝ : Category.{v, u} E
val✝² : C
val✝¹ val✝ : D
f : inl val✝² ⟶ inr (inl val✝¹)
g : inr (inl val✝¹) ⟶ inr (inl val✝)
⊢ {
          obj := fun X =>
            match X with
            | inl X => inl (inl X)
            | inr (inl X) => inl (inr X)
            | inr (inr X) => inr X,
          map := fun {X Y} f =>
            match X, Y, f with
            | inl val, inl val_1, f => f
            | inr (inl val), inr (inl val_1), f => f
            | inr (inr val), inr (inr val_1), f => f }.map
      (f ≫ g) =
    {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        f ≫
      {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        g

Next tactic:
cases f
/-- The inverse associator functor `C ⊕ (D ⊕ E) ⥤ (C ⊕ D) ⊕ E` for sums of categories.
-/
def inverseAssociator : Sum C (Sum D E) ⥤ Sum (Sum C D) E
    where
  obj X :=
    match X with
    | inl X => inl (inl X)
    | inr (inl X) => inl (inr X)
    | inr (inr X) => inr X
  map {X Y} f :=
    match X, Y, f with
    | inl _, inl _, f => f
    | inr (inl _), inr (inl _), f => f
    | inr (inr _), inr (inr _), f => f
  map_id := by rintro (_|(_|_)) <;> rfl
  map_comp := by
    rintro (_|(_|_)) (_|(_|_)) (_|(_|_)) f g <;> 

Proof state:
case inl.inr.inl.inr.inr
C : Type u
inst✝² : Category.{v, u} C
D : Type u
inst✝¹ : Category.{v, u} D
E : Type u
inst✝ : Category.{v, u} E
val✝² : C
val✝¹ : D
val✝ : E
f : inl val✝² ⟶ inr (inl val✝¹)
g : inr (inl val✝¹) ⟶ inr (inr val✝)
⊢ {
          obj := fun X =>
            match X with
            | inl X => inl (inl X)
            | inr (inl X) => inl (inr X)
            | inr (inr X) => inr X,
          map := fun {X Y} f =>
            match X, Y, f with
            | inl val, inl val_1, f => f
            | inr (inl val), inr (inl val_1), f => f
            | inr (inr val), inr (inr val_1), f => f }.map
      (f ≫ g) =
    {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        f ≫
      {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        g

Next tactic:
first | cases f | cases g | aesop_cat
/-- The inverse associator functor `C ⊕ (D ⊕ E) ⥤ (C ⊕ D) ⊕ E` for sums of categories.
-/
def inverseAssociator : Sum C (Sum D E) ⥤ Sum (Sum C D) E
    where
  obj X :=
    match X with
    | inl X => inl (inl X)
    | inr (inl X) => inl (inr X)
    | inr (inr X) => inr X
  map {X Y} f :=
    match X, Y, f with
    | inl _, inl _, f => f
    | inr (inl _), inr (inl _), f => f
    | inr (inr _), inr (inr _), f => f
  map_id := by rintro (_|(_|_)) <;> rfl
  map_comp := by
    rintro (_|(_|_)) (_|(_|_)) (_|(_|_)) f g <;> first | 

Proof state:
case inl.inr.inl.inr.inr
C : Type u
inst✝² : Category.{v, u} C
D : Type u
inst✝¹ : Category.{v, u} D
E : Type u
inst✝ : Category.{v, u} E
val✝² : C
val✝¹ : D
val✝ : E
f : inl val✝² ⟶ inr (inl val✝¹)
g : inr (inl val✝¹) ⟶ inr (inr val✝)
⊢ {
          obj := fun X =>
            match X with
            | inl X => inl (inl X)
            | inr (inl X) => inl (inr X)
            | inr (inr X) => inr X,
          map := fun {X Y} f =>
            match X, Y, f with
            | inl val, inl val_1, f => f
            | inr (inl val), inr (inl val_1), f => f
            | inr (inr val), inr (inr val_1), f => f }.map
      (f ≫ g) =
    {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        f ≫
      {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        g

Next tactic:
cases f
/-- The inverse associator functor `C ⊕ (D ⊕ E) ⥤ (C ⊕ D) ⊕ E` for sums of categories.
-/
def inverseAssociator : Sum C (Sum D E) ⥤ Sum (Sum C D) E
    where
  obj X :=
    match X with
    | inl X => inl (inl X)
    | inr (inl X) => inl (inr X)
    | inr (inr X) => inr X
  map {X Y} f :=
    match X, Y, f with
    | inl _, inl _, f => f
    | inr (inl _), inr (inl _), f => f
    | inr (inr _), inr (inr _), f => f
  map_id := by rintro (_|(_|_)) <;> rfl
  map_comp := by
    rintro (_|(_|_)) (_|(_|_)) (_|(_|_)) f g <;> 

Proof state:
case inl.inr.inr.inl
C : Type u
inst✝² : Category.{v, u} C
D : Type u
inst✝¹ : Category.{v, u} D
E : Type u
inst✝ : Category.{v, u} E
val✝² : C
val✝¹ : E
val✝ : C
f : inl val✝² ⟶ inr (inr val✝¹)
g : inr (inr val✝¹) ⟶ inl val✝
⊢ {
          obj := fun X =>
            match X with
            | inl X => inl (inl X)
            | inr (inl X) => inl (inr X)
            | inr (inr X) => inr X,
          map := fun {X Y} f =>
            match X, Y, f with
            | inl val, inl val_1, f => f
            | inr (inl val), inr (inl val_1), f => f
            | inr (inr val), inr (inr val_1), f => f }.map
      (f ≫ g) =
    {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        f ≫
      {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        g

Next tactic:
first | cases f | cases g | aesop_cat
/-- The inverse associator functor `C ⊕ (D ⊕ E) ⥤ (C ⊕ D) ⊕ E` for sums of categories.
-/
def inverseAssociator : Sum C (Sum D E) ⥤ Sum (Sum C D) E
    where
  obj X :=
    match X with
    | inl X => inl (inl X)
    | inr (inl X) => inl (inr X)
    | inr (inr X) => inr X
  map {X Y} f :=
    match X, Y, f with
    | inl _, inl _, f => f
    | inr (inl _), inr (inl _), f => f
    | inr (inr _), inr (inr _), f => f
  map_id := by rintro (_|(_|_)) <;> rfl
  map_comp := by
    rintro (_|(_|_)) (_|(_|_)) (_|(_|_)) f g <;> first | 

Proof state:
case inl.inr.inr.inl
C : Type u
inst✝² : Category.{v, u} C
D : Type u
inst✝¹ : Category.{v, u} D
E : Type u
inst✝ : Category.{v, u} E
val✝² : C
val✝¹ : E
val✝ : C
f : inl val✝² ⟶ inr (inr val✝¹)
g : inr (inr val✝¹) ⟶ inl val✝
⊢ {
          obj := fun X =>
            match X with
            | inl X => inl (inl X)
            | inr (inl X) => inl (inr X)
            | inr (inr X) => inr X,
          map := fun {X Y} f =>
            match X, Y, f with
            | inl val, inl val_1, f => f
            | inr (inl val), inr (inl val_1), f => f
            | inr (inr val), inr (inr val_1), f => f }.map
      (f ≫ g) =
    {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        f ≫
      {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        g

Next tactic:
cases f
/-- The inverse associator functor `C ⊕ (D ⊕ E) ⥤ (C ⊕ D) ⊕ E` for sums of categories.
-/
def inverseAssociator : Sum C (Sum D E) ⥤ Sum (Sum C D) E
    where
  obj X :=
    match X with
    | inl X => inl (inl X)
    | inr (inl X) => inl (inr X)
    | inr (inr X) => inr X
  map {X Y} f :=
    match X, Y, f with
    | inl _, inl _, f => f
    | inr (inl _), inr (inl _), f => f
    | inr (inr _), inr (inr _), f => f
  map_id := by rintro (_|(_|_)) <;> rfl
  map_comp := by
    rintro (_|(_|_)) (_|(_|_)) (_|(_|_)) f g <;> 

Proof state:
case inl.inr.inr.inr.inl
C : Type u
inst✝² : Category.{v, u} C
D : Type u
inst✝¹ : Category.{v, u} D
E : Type u
inst✝ : Category.{v, u} E
val✝² : C
val✝¹ : E
val✝ : D
f : inl val✝² ⟶ inr (inr val✝¹)
g : inr (inr val✝¹) ⟶ inr (inl val✝)
⊢ {
          obj := fun X =>
            match X with
            | inl X => inl (inl X)
            | inr (inl X) => inl (inr X)
            | inr (inr X) => inr X,
          map := fun {X Y} f =>
            match X, Y, f with
            | inl val, inl val_1, f => f
            | inr (inl val), inr (inl val_1), f => f
            | inr (inr val), inr (inr val_1), f => f }.map
      (f ≫ g) =
    {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        f ≫
      {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        g

Next tactic:
first | cases f | cases g | aesop_cat
/-- The inverse associator functor `C ⊕ (D ⊕ E) ⥤ (C ⊕ D) ⊕ E` for sums of categories.
-/
def inverseAssociator : Sum C (Sum D E) ⥤ Sum (Sum C D) E
    where
  obj X :=
    match X with
    | inl X => inl (inl X)
    | inr (inl X) => inl (inr X)
    | inr (inr X) => inr X
  map {X Y} f :=
    match X, Y, f with
    | inl _, inl _, f => f
    | inr (inl _), inr (inl _), f => f
    | inr (inr _), inr (inr _), f => f
  map_id := by rintro (_|(_|_)) <;> rfl
  map_comp := by
    rintro (_|(_|_)) (_|(_|_)) (_|(_|_)) f g <;> first | 

Proof state:
case inl.inr.inr.inr.inl
C : Type u
inst✝² : Category.{v, u} C
D : Type u
inst✝¹ : Category.{v, u} D
E : Type u
inst✝ : Category.{v, u} E
val✝² : C
val✝¹ : E
val✝ : D
f : inl val✝² ⟶ inr (inr val✝¹)
g : inr (inr val✝¹) ⟶ inr (inl val✝)
⊢ {
          obj := fun X =>
            match X with
            | inl X => inl (inl X)
            | inr (inl X) => inl (inr X)
            | inr (inr X) => inr X,
          map := fun {X Y} f =>
            match X, Y, f with
            | inl val, inl val_1, f => f
            | inr (inl val), inr (inl val_1), f => f
            | inr (inr val), inr (inr val_1), f => f }.map
      (f ≫ g) =
    {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        f ≫
      {
            obj := fun X =>
              match X with
              | inl X => inl (inl X)
              | inr (inl X) => inl (inr X)
              | inr (inr X) => inr X,
            map := fun {X Y} f =>
              match X, Y, f with
              | inl val, inl val_1, f => f
              | inr (inl val), inr (inl val_1), f => f
              | inr (inr val), inr (inr val_1), f => f }.map
        g

Next tactic:
cases f