Module: Mathlib.CategoryTheory.WithTerminal.Basic

Goal state before:
pp: C : Type u
inst✝ : Category.{v, u} C
x✝¹ : (WithTerminal C)ᵒᵖ
x✝ : WithTerminal C
x : C
⊢ {
            obj := fun x ↦
              match x with
              | op x =>
                match x with
                | of x => WithInitial.of (op x)
                | star => WithInitial.star,
            map := fun {x y} x_1 ↦
              match x_1 with
              | op f =>
                match x, y, f, x_1 with
                | op (of x), op (of y), f, x_2 => (down f).op
                | op star, op (of a), x, x_2 =>
                  WithInitial.starInitial.to
                    (match op (of a) with
                    | op x =>
                      match x with
                      | of x => WithInitial.of (op x)
                      | star => WithInitial.star)
                | op star, op star, x, x_2 =>
                  𝟙
                    (match op star with
                    | op x =>
                      match x with
                      | of x => WithInitial.of (op x)
                      | star => WithInitial.star),
            map_id := ⋯, map_comp := ⋯ }.map
        ((NatIso.ofComponents
                (fun x ↦
                  match x with
                  | op x =>
                    match x with
                    | of x => Iso.refl ((𝟭 (WithTerminal C)ᵒᵖ).obj (op (of x)))
                    | star => Iso.refl ((𝟭 (WithTerminal C)ᵒᵖ).obj (op star)))
                ⋯).hom.app
          (op (of x))) ≫
      (NatIso.ofComponents
              (fun x ↦
                match x with
                | WithInitial.of x =>
                  Iso.refl
                    (({
                            obj := fun x ↦
                              match x with
                              | WithInitial.of x => op (of (unop x))
                              | WithInitial.star => op star,
                            map := fun {x y} f ↦
                              match x, y, f with
                              | WithInitial.of (op x), WithInitial.of (op y), f => WithInitial.down f
                              | WithInitial.star, WithInitial.of (op unop), x =>
                                op
                                  (starTerminal.from
                                    (Opposite.unop
                                      (match WithInitial.of (op unop) with
                                      | WithInitial.of x => op (of (Opposite.unop x))
                                      | WithInitial.star => op star)))
                              | WithInitial.star, WithInitial.star, x =>
                                𝟙
                                  (match WithInitial.star with
                                  | WithInitial.of x => op (of (unop x))
                                  | WithInitial.star => op star),
                            map_id := ⋯, map_comp := ⋯ } ⋙
                          {
                            obj := fun x ↦
                              match x with
                              | op x =>
                                match x with
                                | of x => WithInitial.of (op x)
                                | star => WithInitial.star,
                            map := fun {x y} x_1 ↦
                              match x_1 with
                              | op f =>
                                match x, y, f, x_1 with
                                | op (of x), op (of y), f, x_2 => (down f).op
                                | op star, op (of a), x, x_2 =>
                                  WithInitial.starInitial.to
                                    (match op (of a) with
                                    | op x =>
                                      match x with
                                      | of x => WithInitial.of (op x)
                                      | star => WithInitial.star)
                                | op star, op star, x, x_2 =>
                                  𝟙
                                    (match op star with
                                    | op x =>
                                      match x with
                                      | of x => WithInitial.of (op x)
                                      | star => WithInitial.star),
                            map_id := ⋯, map_comp := ⋯ }).obj
                      (WithInitial.of x))
                | WithInitial.star =>
                  Iso.refl
                    (({
                            obj := fun x ↦
                              match x with
                              | WithInitial.of x => op (of (unop x))
                              | WithInitial.star => op star,
                            map := fun {x y} f ↦
                              match x, y, f with
                              | WithInitial.of (op x), WithInitial.of (op y), f => WithInitial.down f
                              | WithInitial.star, WithInitial.of (op unop), x =>
                                op
                                  (starTerminal.from
                                    (Opposite.unop
                                      (match WithInitial.of (op unop) with
                                      | WithInitial.of x => op (of (Opposite.unop x))
                                      | WithInitial.star => op star)))
                              | WithInitial.star, WithInitial.star, x =>
                                𝟙
                                  (match WithInitial.star with
                                  | WithInitial.of x => op (of (unop x))
                                  | WithInitial.star => op star),
                            map_id := ⋯, map_comp := ⋯ } ⋙
                          {
                            obj := fun x ↦
                              match x with
                              | op x =>
                                match x with
                                | of x => WithInitial.of (op x)
                                | star => WithInitial.star,
                            map := fun {x y} x_1 ↦
                              match x_1 with
                              | op f =>
                                match x, y, f, x_1 with
                                | op (of x), op (of y), f, x_2 => (down f).op
                                | op star, op (of a), x, x_2 =>
                                  WithInitial.starInitial.to
                                    (match op (of a) with
                                    | op x =>
                                      match x with
                                      | of x => WithInitial.of (op x)
                                      | star => WithInitial.star)
                                | op star, op star, x, x_2 =>
                                  𝟙
                                    (match op star with
                                    | op x =>
                                      match x with
                                      | of x => WithInitial.of (op x)
                                      | star => WithInitial.star),
                            map_id := ⋯, map_comp := ⋯ }).obj
                      WithInitial.star))
              ⋯).hom.app
        ({
              obj := fun x ↦
                match x with
                | op x =>
                  match x with
                  | of x => WithInitial.of (op x)
                  | star => WithInitial.star,
              map := fun {x y} x_1 ↦
                match x_1 with
                | op f =>
                  match x, y, f, x_1 with
                  | op (of x), op (of y), f, x_2 => (down f).op
                  | op star, op (of a), x, x_2 =>
                    WithInitial.starInitial.to
                      (match op (of a) with
                      | op x =>
                        match x with
                        | of x => WithInitial.of (op x)
                        | star => WithInitial.star)
                  | op star, op star, x, x_2 =>
                    𝟙
                      (match op star with
                      | op x =>
                        match x with
                        | of x => WithInitial.of (op x)
                        | star => WithInitial.star),
              map_id := ⋯, map_comp := ⋯ }.obj
          (op (of x))) =
    𝟙
      ({
            obj := fun x ↦
              match x with
              | op x =>
                match x with
                | of x => WithInitial.of (op x)
                | star => WithInitial.star,
            map := fun {x y} x_1 ↦
              match x_1 with
              | op f =>
                match x, y, f, x_1 with
                | op (of x), op (of y), f, x_2 => (down f).op
                | op star, op (of a), x, x_2 =>
                  WithInitial.starInitial.to
                    (match op (of a) with
                    | op x =>
                      match x with
                      | of x => WithInitial.of (op x)
                      | star => WithInitial.star)
                | op star, op star, x, x_2 =>
                  𝟙
                    (match op star with
                    | op x =>
                      match x with
                      | of x => WithInitial.of (op x)
                      | star => WithInitial.star),
            map_id := ⋯, map_comp := ⋯ }.obj
        (op (of x)))

Tactic:
by
        simp only [op_unop, Functor.id_obj, Functor.comp_obj, NatIso.ofComponents_hom_app,
          Iso.refl_hom, Category.comp_id]
        rfl

Goal state after: