-- Mathlib/CategoryTheory/Localization/CalculusOfFractions/Fractions.lean
lemma exists_leftFraction₂ [W.HasLeftCalculusOfFractions] :
    ∃ (ψ : W.LeftFraction₂ X Y), φ.f ≫ ψ.s = φ.s ≫ ψ.f ∧
      φ.f' ≫ ψ.s = φ.s ≫ ψ.f'

Proof state:
case intro.intro
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
W : MorphismProperty C
X Y : C
φ : W.RightFraction₂ X Y
inst✝ : W.HasLeftCalculusOfFractions
ψ₁ : W.LeftFraction X Y
hψ₁ : φ.fst.f ≫ ψ₁.s = φ.fst.s ≫ ψ₁.f
ψ₂ : W.LeftFraction X Y
hψ₂ : φ.snd.f ≫ ψ₂.s = φ.snd.s ≫ ψ₂.f
⊢ ∃ ψ, φ.f ≫ ψ.s = φ.s ≫ ψ.f ∧ φ.f' ≫ ψ.s = φ.s ≫ ψ.f'

Tactic:
obtain ⟨α, hα⟩ := (RightFraction.mk _ ψ₁.hs ψ₂.s).exists_leftFraction

Result:
case intro.intro.intro
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
W : MorphismProperty C
X Y : C
φ : W.RightFraction₂ X Y
inst✝ : W.HasLeftCalculusOfFractions
ψ₁ : W.LeftFraction X Y
hψ₁ : φ.fst.f ≫ ψ₁.s = φ.fst.s ≫ ψ₁.f
ψ₂ : W.LeftFraction X Y
hψ₂ : φ.snd.f ≫ ψ₂.s = φ.snd.s ≫ ψ₂.f
α : W.LeftFraction ψ₁.Y' ψ₂.Y'
hα : (RightFraction.mk ψ₁.s ⋯ ψ₂.s).f ≫ α.s = (RightFraction.mk ψ₁.s ⋯ ψ₂.s).s ≫ α.f
⊢ ∃ ψ, φ.f ≫ ψ.s = φ.s ≫ ψ.f ∧ φ.f' ≫ ψ.s = φ.s ≫ ψ.f'

Proof state:
case intro.intro.intro.refine_1
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
W : MorphismProperty C
X Y : C
φ : W.RightFraction₂ X Y
inst✝ : W.HasLeftCalculusOfFractions
ψ₁ : W.LeftFraction X Y
hψ₁ : φ.f ≫ ψ₁.s = φ.s ≫ ψ₁.f
ψ₂ : W.LeftFraction X Y
hψ₂ : φ.f' ≫ ψ₂.s = φ.s ≫ ψ₂.f
α : W.LeftFraction ψ₁.Y' ψ₂.Y'
hα : ψ₂.s ≫ α.s = ψ₁.s ≫ α.f
⊢ φ.f ≫ (LeftFraction₂.mk (ψ₁.f ≫ α.f) (ψ₂.f ≫ α.s) (ψ₂.s ≫ α.s) ⋯).s =
    φ.s ≫ (LeftFraction₂.mk (ψ₁.f ≫ α.f) (ψ₂.f ≫ α.s) (ψ₂.s ≫ α.s) ⋯).f

Tactic:
dsimp

Result:
case intro.intro.intro.refine_1
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
W : MorphismProperty C
X Y : C
φ : W.RightFraction₂ X Y
inst✝ : W.HasLeftCalculusOfFractions
ψ₁ : W.LeftFraction X Y
hψ₁ : φ.f ≫ ψ₁.s = φ.s ≫ ψ₁.f
ψ₂ : W.LeftFraction X Y
hψ₂ : φ.f' ≫ ψ₂.s = φ.s ≫ ψ₂.f
α : W.LeftFraction ψ₁.Y' ψ₂.Y'
hα : ψ₂.s ≫ α.s = ψ₁.s ≫ α.f
⊢ φ.f ≫ ψ₂.s ≫ α.s = φ.s ≫ ψ₁.f ≫ α.f

Proof state:
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
W : MorphismProperty C
X Y : C
φ : W.RightFraction₂ X Y
inst✝ : W.HasLeftCalculusOfFractions
⊢ ∃ ψ, φ.f ≫ ψ.s = φ.s ≫ ψ.f ∧ φ.f' ≫ ψ.s = φ.s ≫ ψ.f'

Tactic:
obtain ⟨ψ₁, hψ₁⟩ := φ.fst.exists_leftFraction

Result:
case intro
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
W : MorphismProperty C
X Y : C
φ : W.RightFraction₂ X Y
inst✝ : W.HasLeftCalculusOfFractions
ψ₁ : W.LeftFraction X Y
hψ₁ : φ.fst.f ≫ ψ₁.s = φ.fst.s ≫ ψ₁.f
⊢ ∃ ψ, φ.f ≫ ψ.s = φ.s ≫ ψ.f ∧ φ.f' ≫ ψ.s = φ.s ≫ ψ.f'

Proof state:
case intro.intro.intro
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
W : MorphismProperty C
X Y : C
φ : W.RightFraction₂ X Y
inst✝ : W.HasLeftCalculusOfFractions
ψ₁ : W.LeftFraction X Y
hψ₁ : φ.fst.f ≫ ψ₁.s = φ.fst.s ≫ ψ₁.f
ψ₂ : W.LeftFraction X Y
hψ₂ : φ.snd.f ≫ ψ₂.s = φ.snd.s ≫ ψ₂.f
α : W.LeftFraction ψ₁.Y' ψ₂.Y'
hα : (RightFraction.mk ψ₁.s ⋯ ψ₂.s).f ≫ α.s = (RightFraction.mk ψ₁.s ⋯ ψ₂.s).s ≫ α.f
⊢ ∃ ψ, φ.f ≫ ψ.s = φ.s ≫ ψ.f ∧ φ.f' ≫ ψ.s = φ.s ≫ ψ.f'

Tactic:
dsimp at hψ₁ hψ₂ hα

Result:
case intro.intro.intro
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
W : MorphismProperty C
X Y : C
φ : W.RightFraction₂ X Y
inst✝ : W.HasLeftCalculusOfFractions
ψ₁ : W.LeftFraction X Y
hψ₁ : φ.f ≫ ψ₁.s = φ.s ≫ ψ₁.f
ψ₂ : W.LeftFraction X Y
hψ₂ : φ.f' ≫ ψ₂.s = φ.s ≫ ψ₂.f
α : W.LeftFraction ψ₁.Y' ψ₂.Y'
hα : ψ₂.s ≫ α.s = ψ₁.s ≫ α.f
⊢ ∃ ψ, φ.f ≫ ψ.s = φ.s ≫ ψ.f ∧ φ.f' ≫ ψ.s = φ.s ≫ ψ.f'

Proof state:
case intro.intro.intro.refine_2
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
W : MorphismProperty C
X Y : C
φ : W.RightFraction₂ X Y
inst✝ : W.HasLeftCalculusOfFractions
ψ₁ : W.LeftFraction X Y
hψ₁ : φ.f ≫ ψ₁.s = φ.s ≫ ψ₁.f
ψ₂ : W.LeftFraction X Y
hψ₂ : φ.f' ≫ ψ₂.s = φ.s ≫ ψ₂.f
α : W.LeftFraction ψ₁.Y' ψ₂.Y'
hα : ψ₂.s ≫ α.s = ψ₁.s ≫ α.f
⊢ φ.f' ≫ (LeftFraction₂.mk (ψ₁.f ≫ α.f) (ψ₂.f ≫ α.s) (ψ₂.s ≫ α.s) ⋯).s =
    φ.s ≫ (LeftFraction₂.mk (ψ₁.f ≫ α.f) (ψ₂.f ≫ α.s) (ψ₂.s ≫ α.s) ⋯).f'

Tactic:
rw [reassoc_of% hψ₂]

Result:
no goals

Proof state:
case intro
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
W : MorphismProperty C
X Y : C
φ : W.RightFraction₂ X Y
inst✝ : W.HasLeftCalculusOfFractions
ψ₁ : W.LeftFraction X Y
hψ₁ : φ.fst.f ≫ ψ₁.s = φ.fst.s ≫ ψ₁.f
⊢ ∃ ψ, φ.f ≫ ψ.s = φ.s ≫ ψ.f ∧ φ.f' ≫ ψ.s = φ.s ≫ ψ.f'

Tactic:
obtain ⟨ψ₂, hψ₂⟩ := φ.snd.exists_leftFraction

Result:
case intro.intro
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
W : MorphismProperty C
X Y : C
φ : W.RightFraction₂ X Y
inst✝ : W.HasLeftCalculusOfFractions
ψ₁ : W.LeftFraction X Y
hψ₁ : φ.fst.f ≫ ψ₁.s = φ.fst.s ≫ ψ₁.f
ψ₂ : W.LeftFraction X Y
hψ₂ : φ.snd.f ≫ ψ₂.s = φ.snd.s ≫ ψ₂.f
⊢ ∃ ψ, φ.f ≫ ψ.s = φ.s ≫ ψ.f ∧ φ.f' ≫ ψ.s = φ.s ≫ ψ.f'

Proof state:
case intro.intro.intro.refine_1
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
W : MorphismProperty C
X Y : C
φ : W.RightFraction₂ X Y
inst✝ : W.HasLeftCalculusOfFractions
ψ₁ : W.LeftFraction X Y
hψ₁ : φ.f ≫ ψ₁.s = φ.s ≫ ψ₁.f
ψ₂ : W.LeftFraction X Y
hψ₂ : φ.f' ≫ ψ₂.s = φ.s ≫ ψ₂.f
α : W.LeftFraction ψ₁.Y' ψ₂.Y'
hα : ψ₂.s ≫ α.s = ψ₁.s ≫ α.f
⊢ φ.f ≫ ψ₂.s ≫ α.s = φ.s ≫ ψ₁.f ≫ α.f

Tactic:
rw [hα, reassoc_of% hψ₁]

Result:
no goals

Proof state:
case intro.intro.intro
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
W : MorphismProperty C
X Y : C
φ : W.RightFraction₂ X Y
inst✝ : W.HasLeftCalculusOfFractions
ψ₁ : W.LeftFraction X Y
hψ₁ : φ.f ≫ ψ₁.s = φ.s ≫ ψ₁.f
ψ₂ : W.LeftFraction X Y
hψ₂ : φ.f' ≫ ψ₂.s = φ.s ≫ ψ₂.f
α : W.LeftFraction ψ₁.Y' ψ₂.Y'
hα : ψ₂.s ≫ α.s = ψ₁.s ≫ α.f
⊢ ∃ ψ, φ.f ≫ ψ.s = φ.s ≫ ψ.f ∧ φ.f' ≫ ψ.s = φ.s ≫ ψ.f'

Tactic:
refine ⟨LeftFraction₂.mk (ψ₁.f ≫ α.f) (ψ₂.f ≫ α.s) (ψ₂.s ≫ α.s)
    (W.comp_mem _ _ ψ₂.hs α.hs), ?_, ?_⟩

Result:
case intro.intro.intro.refine_1
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
W : MorphismProperty C
X Y : C
φ : W.RightFraction₂ X Y
inst✝ : W.HasLeftCalculusOfFractions
ψ₁ : W.LeftFraction X Y
hψ₁ : φ.f ≫ ψ₁.s = φ.s ≫ ψ₁.f
ψ₂ : W.LeftFraction X Y
hψ₂ : φ.f' ≫ ψ₂.s = φ.s ≫ ψ₂.f
α : W.LeftFraction ψ₁.Y' ψ₂.Y'
hα : ψ₂.s ≫ α.s = ψ₁.s ≫ α.f
⊢ φ.f ≫ (LeftFraction₂.mk (ψ₁.f ≫ α.f) (ψ₂.f ≫ α.s) (ψ₂.s ≫ α.s) ⋯).s =
    φ.s ≫ (LeftFraction₂.mk (ψ₁.f ≫ α.f) (ψ₂.f ≫ α.s) (ψ₂.s ≫ α.s) ⋯).f

case intro.intro.intro.refine_2
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
W : MorphismProperty C
X Y : C
φ : W.RightFraction₂ X Y
inst✝ : W.HasLeftCalculusOfFractions
ψ₁ : W.LeftFraction X Y
hψ₁ : φ.f ≫ ψ₁.s = φ.s ≫ ψ₁.f
ψ₂ : W.LeftFraction X Y
hψ₂ : φ.f' ≫ ψ₂.s = φ.s ≫ ψ₂.f
α : W.LeftFraction ψ₁.Y' ψ₂.Y'
hα : ψ₂.s ≫ α.s = ψ₁.s ≫ α.f
⊢ φ.f' ≫ (LeftFraction₂.mk (ψ₁.f ≫ α.f) (ψ₂.f ≫ α.s) (ψ₂.s ≫ α.s) ⋯).s =
    φ.s ≫ (LeftFraction₂.mk (ψ₁.f ≫ α.f) (ψ₂.f ≫ α.s) (ψ₂.s ≫ α.s) ⋯).f'