Theorem: CategoryTheory.FreeBicategory.normalize_naturality
File: Mathlib/CategoryTheory/Bicategory/Coherence.lean

tactic: rcases η with ⟨η'⟩
state_before: B : Type u
inst✝ : Quiver B
a b c : B
p : Path a b
f g : Hom b c
η : f ⟶ g
⊢ (↑(preinclusion B)).map { as := p } ◁ η ≫ (normalizeIso p g).hom =
    (normalizeIso p f).hom ≫
      PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f } = { as := normalizeAux p g }))

tactic: clear η
state_before: case mk
B : Type u
inst✝ : Quiver B
a b c : B
p : Path a b
f g : Hom b c
η : f ⟶ g
η' : Hom₂ f g
⊢ (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel η' ≫ (normalizeIso p g).hom =
    (normalizeIso p f).hom ≫
      PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f } = { as := normalizeAux p g }))

tactic: induction η' with
| id => simp
| vcomp η θ ihf ihg =>
  simp only [mk_vcomp, Bicategory.whiskerLeft_comp]
  slice_lhs 2 3 => rw [ihg]
  slice_lhs 1 2 => rw [ihf]
  simp
| whisker_left _ _ ih =>
  dsimp
  rw [associator_inv_naturality_right_assoc, whisker_exchange_assoc, ih]
  simp
| whisker_right h η' ih =>
  dsimp
  rw [associator_inv_naturality_middle_assoc, ← comp_whiskerRight_assoc, ih, comp_whiskerRight]
  have := dcongr_arg (fun x => (normalizeIso x h).hom) (normalizeAux_congr p (Quot.mk _ η'))
  dsimp at this; simp [this]
| _ => simp
state_before: case mk
B : Type u
inst✝ : Quiver B
a b c : B
p : Path a b
f g : Hom b c
η' : Hom₂ f g
⊢ (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel η' ≫ (normalizeIso p g).hom =
    (normalizeIso p f).hom ≫
      PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f } = { as := normalizeAux p g }))

tactic: simp
state_before: case mk.id
B : Type u
inst✝ : Quiver B
a b c : B
f g : Hom b c
a✝ b✝ : FreeBicategory B
f✝ : a✝ ⟶ b✝
p : Path a a✝
⊢ (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel (Hom₂.id f✝) ≫ (normalizeIso p f✝).hom =
    (normalizeIso p f✝).hom ≫
      PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p f✝ }))

tactic: simp only [mk_vcomp, Bicategory.whiskerLeft_comp]
state_before: case mk.vcomp
B : Type u
inst✝ : Quiver B
a b c : B
f g : Hom b c
a✝ b✝ : FreeBicategory B
f✝ g✝ h✝ : a✝ ⟶ b✝
η : Hom₂ f✝ g✝
θ : Hom₂ g✝ h✝
ihf :
  ∀ (p : Path a a✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel η ≫ (normalizeIso p g✝).hom =
      (normalizeIso p f✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p g✝ }))
ihg :
  ∀ (p : Path a a✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel θ ≫ (normalizeIso p h✝).hom =
      (normalizeIso p g✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p g✝ } = { as := normalizeAux p h✝ }))
p : Path a a✝
⊢ (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel (Hom₂.vcomp η θ) ≫ (normalizeIso p h✝).hom =
    (normalizeIso p f✝).hom ≫
      PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p h✝ }))

tactic: slice_lhs 2 3 => rw [ihg]
state_before: case mk.vcomp
B : Type u
inst✝ : Quiver B
a b c : B
f g : Hom b c
a✝ b✝ : FreeBicategory B
f✝ g✝ h✝ : a✝ ⟶ b✝
η : Hom₂ f✝ g✝
θ : Hom₂ g✝ h✝
ihf :
  ∀ (p : Path a a✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel η ≫ (normalizeIso p g✝).hom =
      (normalizeIso p f✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p g✝ }))
ihg :
  ∀ (p : Path a a✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel θ ≫ (normalizeIso p h✝).hom =
      (normalizeIso p g✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p g✝ } = { as := normalizeAux p h✝ }))
p : Path a a✝
⊢ ((↑(preinclusion B)).map { as := p } ◁ Hom₂.mk η ≫ (↑(preinclusion B)).map { as := p } ◁ Hom₂.mk θ) ≫
      (normalizeIso p h✝).hom =
    (normalizeIso p f✝).hom ≫
      PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p h✝ }))

tactic: slice_lhs 1 2 => rw [ihf]
state_before: case mk.vcomp
B : Type u
inst✝ : Quiver B
a b c : B
f g : Hom b c
a✝ b✝ : FreeBicategory B
f✝ g✝ h✝ : a✝ ⟶ b✝
η : Hom₂ f✝ g✝
θ : Hom₂ g✝ h✝
ihf :
  ∀ (p : Path a a✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel η ≫ (normalizeIso p g✝).hom =
      (normalizeIso p f✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p g✝ }))
ihg :
  ∀ (p : Path a a✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel θ ≫ (normalizeIso p h✝).hom =
      (normalizeIso p g✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p g✝ } = { as := normalizeAux p h✝ }))
p : Path a a✝
⊢ (↑(preinclusion B)).map { as := p } ◁ Hom₂.mk η ≫
      (normalizeIso p g✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p g✝ } = { as := normalizeAux p h✝ })) =
    (normalizeIso p f✝).hom ≫
      PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p h✝ }))

tactic: simp
state_before: case mk.vcomp
B : Type u
inst✝ : Quiver B
a b c : B
f g : Hom b c
a✝ b✝ : FreeBicategory B
f✝ g✝ h✝ : a✝ ⟶ b✝
η : Hom₂ f✝ g✝
θ : Hom₂ g✝ h✝
ihf :
  ∀ (p : Path a a✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel η ≫ (normalizeIso p g✝).hom =
      (normalizeIso p f✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p g✝ }))
ihg :
  ∀ (p : Path a a✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel θ ≫ (normalizeIso p h✝).hom =
      (normalizeIso p g✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p g✝ } = { as := normalizeAux p h✝ }))
p : Path a a✝
⊢ ((normalizeIso p f✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p g✝ }))) ≫
      PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p g✝ } = { as := normalizeAux p h✝ })) =
    (normalizeIso p f✝).hom ≫
      PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p h✝ }))

tactic: dsimp
state_before: case mk.whisker_left
B : Type u
inst✝ : Quiver B
a b c : B
f g : Hom b c
a✝ b✝ c✝ : FreeBicategory B
f✝ : a✝ ⟶ b✝
g✝ h✝ : b✝ ⟶ c✝
η✝ : Hom₂ g✝ h✝
ih :
  ∀ (p : Path a b✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel η✝ ≫ (normalizeIso p h✝).hom =
      (normalizeIso p g✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p g✝ } = { as := normalizeAux p h✝ }))
p : Path a a✝
⊢ (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel (Hom₂.whisker_left f✝ η✝) ≫ (normalizeIso p (f✝ ≫ h✝)).hom =
    (normalizeIso p (f✝ ≫ g✝)).hom ≫
      PrelaxFunctor.map₂ (preinclusion B)
        (eqToHom (_ : { as := normalizeAux p (f✝ ≫ g✝) } = { as := normalizeAux p (f✝ ≫ h✝) }))

tactic: rw [associator_inv_naturality_right_assoc, whisker_exchange_assoc, ih]
state_before: case mk.whisker_left
B : Type u
inst✝ : Quiver B
a b c : B
f g : Hom b c
a✝ b✝ c✝ : FreeBicategory B
f✝ : a✝ ⟶ b✝
g✝ h✝ : b✝ ⟶ c✝
η✝ : Hom₂ g✝ h✝
ih :
  ∀ (p : Path a b✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel η✝ ≫ (normalizeIso p h✝).hom =
      (normalizeIso p g✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p g✝ } = { as := normalizeAux p h✝ }))
p : Path a a✝
⊢ (↑(preinclusion B)).map { as := p } ◁ f✝ ◁ Hom₂.mk η✝ ≫
      (α_ ((↑(preinclusion B)).map { as := p }) f✝ h✝).inv ≫
        (normalizeIso p f✝).hom ▷ h✝ ≫ (normalizeIso (normalizeAux p f✝) h✝).hom =
    ((α_ ((↑(preinclusion B)).map { as := p }) f✝ g✝).inv ≫
        (normalizeIso p f✝).hom ▷ g✝ ≫ (normalizeIso (normalizeAux p f✝) g✝).hom) ≫
      PrelaxFunctor.map₂ (preinclusion B)
        (eqToHom (_ : { as := normalizeAux (normalizeAux p f✝) g✝ } = { as := normalizeAux (normalizeAux p f✝) h✝ }))

tactic: simp
state_before: case mk.whisker_left
B : Type u
inst✝ : Quiver B
a b c : B
f g : Hom b c
a✝ b✝ c✝ : FreeBicategory B
f✝ : a✝ ⟶ b✝
g✝ h✝ : b✝ ⟶ c✝
η✝ : Hom₂ g✝ h✝
ih :
  ∀ (p : Path a b✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel η✝ ≫ (normalizeIso p h✝).hom =
      (normalizeIso p g✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p g✝ } = { as := normalizeAux p h✝ }))
p : Path a a✝
⊢ (α_ ((↑(preinclusion B)).map { as := p }) f✝ g✝).inv ≫
      (normalizeIso p f✝).hom ▷ g✝ ≫
        (normalizeIso (normalizeAux p f✝) g✝).hom ≫
          PrelaxFunctor.map₂ (preinclusion B)
            (eqToHom
              (_ : { as := normalizeAux (normalizeAux p f✝) g✝ } = { as := normalizeAux (normalizeAux p f✝) h✝ })) =
    ((α_ ((↑(preinclusion B)).map { as := p }) f✝ g✝).inv ≫
        (normalizeIso p f✝).hom ▷ g✝ ≫ (normalizeIso (normalizeAux p f✝) g✝).hom) ≫
      PrelaxFunctor.map₂ (preinclusion B)
        (eqToHom (_ : { as := normalizeAux (normalizeAux p f✝) g✝ } = { as := normalizeAux (normalizeAux p f✝) h✝ }))

tactic: dsimp
state_before: case mk.whisker_right
B : Type u
inst✝ : Quiver B
a b c : B
f g : Hom b c
a✝ b✝ c✝ : FreeBicategory B
f✝ g✝ : a✝ ⟶ b✝
h : b✝ ⟶ c✝
η' : Hom₂ f✝ g✝
ih :
  ∀ (p : Path a a✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel η' ≫ (normalizeIso p g✝).hom =
      (normalizeIso p f✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p g✝ }))
p : Path a a✝
⊢ (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel (Hom₂.whisker_right h η') ≫ (normalizeIso p (Hom.comp g✝ h)).hom =
    (normalizeIso p (Hom.comp f✝ h)).hom ≫
      PrelaxFunctor.map₂ (preinclusion B)
        (eqToHom (_ : { as := normalizeAux p (Hom.comp f✝ h) } = { as := normalizeAux p (Hom.comp g✝ h) }))

tactic: rw [associator_inv_naturality_middle_assoc, ← comp_whiskerRight_assoc, ih, comp_whiskerRight]
state_before: case mk.whisker_right
B : Type u
inst✝ : Quiver B
a b c : B
f g : Hom b c
a✝ b✝ c✝ : FreeBicategory B
f✝ g✝ : a✝ ⟶ b✝
h : b✝ ⟶ c✝
η' : Hom₂ f✝ g✝
ih :
  ∀ (p : Path a a✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel η' ≫ (normalizeIso p g✝).hom =
      (normalizeIso p f✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p g✝ }))
p : Path a a✝
⊢ (↑(preinclusion B)).map { as := p } ◁ Hom₂.mk η' ▷ h ≫
      (α_ ((↑(preinclusion B)).map { as := p }) g✝ h).inv ≫
        (normalizeIso p g✝).hom ▷ h ≫ (normalizeIso (normalizeAux p g✝) h).hom =
    ((α_ ((↑(preinclusion B)).map { as := p }) f✝ h).inv ≫
        (normalizeIso p f✝).hom ▷ h ≫ (normalizeIso (normalizeAux p f✝) h).hom) ≫
      PrelaxFunctor.map₂ (preinclusion B)
        (eqToHom (_ : { as := normalizeAux (normalizeAux p f✝) h } = { as := normalizeAux (normalizeAux p g✝) h }))

tactic: have := dcongr_arg (fun x => (normalizeIso x h).hom) (normalizeAux_congr p (Quot.mk _ η'))
state_before: case mk.whisker_right
B : Type u
inst✝ : Quiver B
a b c : B
f g : Hom b c
a✝ b✝ c✝ : FreeBicategory B
f✝ g✝ : a✝ ⟶ b✝
h : b✝ ⟶ c✝
η' : Hom₂ f✝ g✝
ih :
  ∀ (p : Path a a✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel η' ≫ (normalizeIso p g✝).hom =
      (normalizeIso p f✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p g✝ }))
p : Path a a✝
⊢ (α_ ((↑(preinclusion B)).map { as := p }) f✝ h).inv ≫
      ((normalizeIso p f✝).hom ▷ h ≫
          PrelaxFunctor.map₂ (preinclusion B)
              (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p g✝ })) ▷
            h) ≫
        (normalizeIso (normalizeAux p g✝) h).hom =
    ((α_ ((↑(preinclusion B)).map { as := p }) f✝ h).inv ≫
        (normalizeIso p f✝).hom ▷ h ≫ (normalizeIso (normalizeAux p f✝) h).hom) ≫
      PrelaxFunctor.map₂ (preinclusion B)
        (eqToHom (_ : { as := normalizeAux (normalizeAux p f✝) h } = { as := normalizeAux (normalizeAux p g✝) h }))

tactic: dsimp at this
state_before: case mk.whisker_right
B : Type u
inst✝ : Quiver B
a b c : B
f g : Hom b c
a✝ b✝ c✝ : FreeBicategory B
f✝ g✝ : a✝ ⟶ b✝
h : b✝ ⟶ c✝
η' : Hom₂ f✝ g✝
ih :
  ∀ (p : Path a a✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel η' ≫ (normalizeIso p g✝).hom =
      (normalizeIso p f✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p g✝ }))
p : Path a a✝
this :
  (normalizeIso (normalizeAux p f✝) h).hom =
    eqToHom
        (_ :
          (↑(preinclusion B)).map { as := normalizeAux p f✝ } ≫ h =
            (↑(preinclusion B)).map { as := normalizeAux p g✝ } ≫ h) ≫
      (normalizeIso (normalizeAux p g✝) h).hom ≫
        eqToHom
          (_ :
            (↑(preinclusion B)).map { as := normalizeAux (normalizeAux p g✝) h } =
              (↑(preinclusion B)).map { as := normalizeAux (normalizeAux p f✝) h })
⊢ (α_ ((↑(preinclusion B)).map { as := p }) f✝ h).inv ≫
      ((normalizeIso p f✝).hom ▷ h ≫
          PrelaxFunctor.map₂ (preinclusion B)
              (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p g✝ })) ▷
            h) ≫
        (normalizeIso (normalizeAux p g✝) h).hom =
    ((α_ ((↑(preinclusion B)).map { as := p }) f✝ h).inv ≫
        (normalizeIso p f✝).hom ▷ h ≫ (normalizeIso (normalizeAux p f✝) h).hom) ≫
      PrelaxFunctor.map₂ (preinclusion B)
        (eqToHom (_ : { as := normalizeAux (normalizeAux p f✝) h } = { as := normalizeAux (normalizeAux p g✝) h }))

tactic: simp [this]
state_before: case mk.whisker_right
B : Type u
inst✝ : Quiver B
a b c : B
f g : Hom b c
a✝ b✝ c✝ : FreeBicategory B
f✝ g✝ : a✝ ⟶ b✝
h : b✝ ⟶ c✝
η' : Hom₂ f✝ g✝
ih :
  ∀ (p : Path a a✝),
    (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel η' ≫ (normalizeIso p g✝).hom =
      (normalizeIso p f✝).hom ≫
        PrelaxFunctor.map₂ (preinclusion B) (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p g✝ }))
p : Path a a✝
this :
  (normalizeIso (normalizeAux p f✝) h).hom =
    eqToHom
        (_ :
          (↑(preinclusion B)).map { as := normalizeAux p f✝ } ≫ h =
            (↑(preinclusion B)).map { as := normalizeAux p g✝ } ≫ h) ≫
      (normalizeIso (normalizeAux p g✝) h).hom ≫
        eqToHom
          (_ :
            (↑(preinclusion B)).map { as := normalizeAux (normalizeAux p g✝) h } =
              (↑(preinclusion B)).map { as := normalizeAux (normalizeAux p f✝) h })
⊢ (α_ ((↑(preinclusion B)).map { as := p }) f✝ h).inv ≫
      ((normalizeIso p f✝).hom ▷ h ≫
          PrelaxFunctor.map₂ (preinclusion B)
              (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p g✝ })) ▷
            h) ≫
        (normalizeIso (normalizeAux p g✝) h).hom =
    ((α_ ((↑(preinclusion B)).map { as := p }) f✝ h).inv ≫
        (normalizeIso p f✝).hom ▷ h ≫ (normalizeIso (normalizeAux p f✝) h).hom) ≫
      PrelaxFunctor.map₂ (preinclusion B)
        (eqToHom (_ : { as := normalizeAux (normalizeAux p f✝) h } = { as := normalizeAux (normalizeAux p g✝) h }))

tactic: simp
state_before: case mk.left_unitor_inv
B : Type u
inst✝ : Quiver B
a b c : B
f g : Hom b c
a✝ b✝ : FreeBicategory B
f✝ : a✝ ⟶ b✝
p : Path a a✝
⊢ (↑(preinclusion B)).map { as := p } ◁ Quot.mk Rel (Hom₂.left_unitor_inv f✝) ≫ (normalizeIso p (𝟙 a✝ ≫ f✝)).hom =
    (normalizeIso p f✝).hom ≫
      PrelaxFunctor.map₂ (preinclusion B)
        (eqToHom (_ : { as := normalizeAux p f✝ } = { as := normalizeAux p (𝟙 a✝ ≫ f✝) }))