-- Mathlib/CategoryTheory/Localization/CalculusOfFractions/Fractions.lean
lemma exists_leftFraction₂ {X Y : C} (f f' : L.obj X ⟶ L.obj Y) :
    ∃ (φ : W.LeftFraction₂ X Y), f = φ.fst.map L (inverts L W) ∧
      f' = φ.snd.map L (inverts L W)

Proof state:
case intro.refine_2
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_4, u_1} C
inst✝² : Category.{u_3, u_2} D
L : C ⥤ D
W : MorphismProperty C
inst✝¹ : L.IsLocalization W
inst✝ : W.HasLeftCalculusOfFractions
X Y : C
f f' : L.obj X ⟶ L.obj Y
φ : W.LeftFraction X Y
hφ : f = φ.map L ⋯
φ' : W.LeftFraction X Y
hφ' : f' = φ'.map L ⋯
α : W.LeftFraction φ.Y' φ'.Y'
hα : (RightFraction.mk φ.s ⋯ φ'.s).f ≫ α.s = (RightFraction.mk φ.s ⋯ φ'.s).s ≫ α.f
ψ : W.LeftFraction₂ X Y := LeftFraction₂.mk (φ.f ≫ α.f) (φ'.f ≫ α.s) (φ'.s ≫ α.s) ⋯
this✝¹ : IsIso (L.map φ'.s)
this✝ : IsIso (L.map α.s)
this : IsIso (L.map (φ'.s ≫ α.s))
⊢ φ'.map L ⋯ ≫ L.map φ'.s ≫ L.map α.s = ψ.snd.map L ⋯ ≫ L.map (φ'.s ≫ α.s)

Tactic:
rw [LeftFraction.map_comp_map_s_assoc, LeftFraction.map_comp_map_s,
  L.map_comp]

Result:
no goals

Proof state:
case intro
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_4, u_1} C
inst✝² : Category.{u_3, u_2} D
L : C ⥤ D
W : MorphismProperty C
inst✝¹ : L.IsLocalization W
inst✝ : W.HasLeftCalculusOfFractions
X Y : C
f f' : L.obj X ⟶ L.obj Y
φ : W.LeftFraction X Y
hφ : f = φ.map L ⋯
φ' : W.LeftFraction X Y
hφ' : f' = φ'.map L ⋯
α : W.LeftFraction φ.Y' φ'.Y'
hα : (RightFraction.mk φ.s ⋯ φ'.s).f ≫ α.s = (RightFraction.mk φ.s ⋯ φ'.s).s ≫ α.f
ψ : W.LeftFraction₂ X Y := LeftFraction₂.mk (φ.f ≫ α.f) (φ'.f ≫ α.s) (φ'.s ≫ α.s) ⋯
this : IsIso (L.map φ'.s)
⊢ ∃ φ, f = φ.fst.map L ⋯ ∧ f' = φ.snd.map L ⋯

Tactic:
have := inverts L W _ α.hs

Result:
case intro
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_4, u_1} C
inst✝² : Category.{u_3, u_2} D
L : C ⥤ D
W : MorphismProperty C
inst✝¹ : L.IsLocalization W
inst✝ : W.HasLeftCalculusOfFractions
X Y : C
f f' : L.obj X ⟶ L.obj Y
φ : W.LeftFraction X Y
hφ : f = φ.map L ⋯
φ' : W.LeftFraction X Y
hφ' : f' = φ'.map L ⋯
α : W.LeftFraction φ.Y' φ'.Y'
hα : (RightFraction.mk φ.s ⋯ φ'.s).f ≫ α.s = (RightFraction.mk φ.s ⋯ φ'.s).s ≫ α.f
ψ : W.LeftFraction₂ X Y := LeftFraction₂.mk (φ.f ≫ α.f) (φ'.f ≫ α.s) (φ'.s ≫ α.s) ⋯
this✝ : IsIso (L.map φ'.s)
this : IsIso (L.map α.s)
⊢ ∃ φ, f = φ.fst.map L ⋯ ∧ f' = φ.snd.map L ⋯

Proof state:
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_4, u_1} C
inst✝² : Category.{u_3, u_2} D
L : C ⥤ D
W : MorphismProperty C
inst✝¹ : L.IsLocalization W
inst✝ : W.HasLeftCalculusOfFractions
X Y : C
f f' : L.obj X ⟶ L.obj Y
φ : W.LeftFraction X Y
hφ : f = φ.map L ⋯
φ' : W.LeftFraction X Y
hφ' : f' = φ'.map L ⋯
⊢ ∃ φ, f = φ.fst.map L ⋯ ∧ f' = φ.snd.map L ⋯

Tactic:
obtain ⟨α, hα⟩ := (RightFraction.mk _ φ.hs φ'.s).exists_leftFraction

Result:
case intro
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_4, u_1} C
inst✝² : Category.{u_3, u_2} D
L : C ⥤ D
W : MorphismProperty C
inst✝¹ : L.IsLocalization W
inst✝ : W.HasLeftCalculusOfFractions
X Y : C
f f' : L.obj X ⟶ L.obj Y
φ : W.LeftFraction X Y
hφ : f = φ.map L ⋯
φ' : W.LeftFraction X Y
hφ' : f' = φ'.map L ⋯
α : W.LeftFraction φ.Y' φ'.Y'
hα : (RightFraction.mk φ.s ⋯ φ'.s).f ≫ α.s = (RightFraction.mk φ.s ⋯ φ'.s).s ≫ α.f
⊢ ∃ φ, f = φ.fst.map L ⋯ ∧ f' = φ.snd.map L ⋯

Proof state:
case intro.refine_2
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_4, u_1} C
inst✝² : Category.{u_3, u_2} D
L : C ⥤ D
W : MorphismProperty C
inst✝¹ : L.IsLocalization W
inst✝ : W.HasLeftCalculusOfFractions
X Y : C
f f' : L.obj X ⟶ L.obj Y
φ : W.LeftFraction X Y
hφ : f = φ.map L ⋯
φ' : W.LeftFraction X Y
hφ' : f' = φ'.map L ⋯
α : W.LeftFraction φ.Y' φ'.Y'
hα : (RightFraction.mk φ.s ⋯ φ'.s).f ≫ α.s = (RightFraction.mk φ.s ⋯ φ'.s).s ≫ α.f
ψ : W.LeftFraction₂ X Y := LeftFraction₂.mk (φ.f ≫ α.f) (φ'.f ≫ α.s) (φ'.s ≫ α.s) ⋯
this✝¹ : IsIso (L.map φ'.s)
this✝ : IsIso (L.map α.s)
this : IsIso (L.map (φ'.s ≫ α.s))
⊢ φ'.map L ⋯ ≫ L.map (φ'.s ≫ α.s) = ψ.snd.map L ⋯ ≫ L.map (φ'.s ≫ α.s)

Tactic:
nth_rw 1 [L.map_comp]

Result:
case intro.refine_2
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_4, u_1} C
inst✝² : Category.{u_3, u_2} D
L : C ⥤ D
W : MorphismProperty C
inst✝¹ : L.IsLocalization W
inst✝ : W.HasLeftCalculusOfFractions
X Y : C
f f' : L.obj X ⟶ L.obj Y
φ : W.LeftFraction X Y
hφ : f = φ.map L ⋯
φ' : W.LeftFraction X Y
hφ' : f' = φ'.map L ⋯
α : W.LeftFraction φ.Y' φ'.Y'
hα : (RightFraction.mk φ.s ⋯ φ'.s).f ≫ α.s = (RightFraction.mk φ.s ⋯ φ'.s).s ≫ α.f
ψ : W.LeftFraction₂ X Y := LeftFraction₂.mk (φ.f ≫ α.f) (φ'.f ≫ α.s) (φ'.s ≫ α.s) ⋯
this✝¹ : IsIso (L.map φ'.s)
this✝ : IsIso (L.map α.s)
this : IsIso (L.map (φ'.s ≫ α.s))
⊢ φ'.map L ⋯ ≫ L.map φ'.s ≫ L.map α.s = ψ.snd.map L ⋯ ≫ L.map (φ'.s ≫ α.s)

Proof state:
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_4, u_1} C
inst✝² : Category.{u_3, u_2} D
L : C ⥤ D
W : MorphismProperty C
inst✝¹ : L.IsLocalization W
inst✝ : W.HasLeftCalculusOfFractions
X Y : C
f f' : L.obj X ⟶ L.obj Y
φ : W.LeftFraction X Y
hφ : f = φ.map L ⋯
φ' : W.LeftFraction X Y
hφ' : f' = φ'.map L ⋯
α : W.LeftFraction φ.Y' φ'.Y'
hα : (RightFraction.mk φ.s ⋯ φ'.s).f ≫ α.s = (RightFraction.mk φ.s ⋯ φ'.s).s ≫ α.f
ψ : W.LeftFraction₂ X Y := LeftFraction₂.mk (φ.f ≫ α.f) (φ'.f ≫ α.s) (φ'.s ≫ α.s) ⋯
this✝ : IsIso (L.map φ'.s)
this : IsIso (L.map α.s)
⊢ IsIso (L.map (φ'.s ≫ α.s))

Tactic:
rw [L.map_comp]

Result:
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_4, u_1} C
inst✝² : Category.{u_3, u_2} D
L : C ⥤ D
W : MorphismProperty C
inst✝¹ : L.IsLocalization W
inst✝ : W.HasLeftCalculusOfFractions
X Y : C
f f' : L.obj X ⟶ L.obj Y
φ : W.LeftFraction X Y
hφ : f = φ.map L ⋯
φ' : W.LeftFraction X Y
hφ' : f' = φ'.map L ⋯
α : W.LeftFraction φ.Y' φ'.Y'
hα : (RightFraction.mk φ.s ⋯ φ'.s).f ≫ α.s = (RightFraction.mk φ.s ⋯ φ'.s).s ≫ α.f
ψ : W.LeftFraction₂ X Y := LeftFraction₂.mk (φ.f ≫ α.f) (φ'.f ≫ α.s) (φ'.s ≫ α.s) ⋯
this✝ : IsIso (L.map φ'.s)
this : IsIso (L.map α.s)
⊢ IsIso (L.map φ'.s ≫ L.map α.s)

Proof state:
case intro
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_4, u_1} C
inst✝² : Category.{u_3, u_2} D
L : C ⥤ D
W : MorphismProperty C
inst✝¹ : L.IsLocalization W
inst✝ : W.HasLeftCalculusOfFractions
X Y : C
f f' : L.obj X ⟶ L.obj Y
φ : W.LeftFraction X Y
hφ : f = φ.map L ⋯
φ' : W.LeftFraction X Y
hφ' : f' = φ'.map L ⋯
α : W.LeftFraction φ.Y' φ'.Y'
hα : (RightFraction.mk φ.s ⋯ φ'.s).f ≫ α.s = (RightFraction.mk φ.s ⋯ φ'.s).s ≫ α.f
ψ : W.LeftFraction₂ X Y := LeftFraction₂.mk (φ.f ≫ α.f) (φ'.f ≫ α.s) (φ'.s ≫ α.s) ⋯
this✝ : IsIso (L.map φ'.s)
this : IsIso (L.map α.s)
⊢ ∃ φ, f = φ.fst.map L ⋯ ∧ f' = φ.snd.map L ⋯

Tactic:
have : IsIso (L.map (φ'.s ≫ α.s)) := by
  rw [L.map_comp]
  infer_instance

Result:
case intro
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_4, u_1} C
inst✝² : Category.{u_3, u_2} D
L : C ⥤ D
W : MorphismProperty C
inst✝¹ : L.IsLocalization W
inst✝ : W.HasLeftCalculusOfFractions
X Y : C
f f' : L.obj X ⟶ L.obj Y
φ : W.LeftFraction X Y
hφ : f = φ.map L ⋯
φ' : W.LeftFraction X Y
hφ' : f' = φ'.map L ⋯
α : W.LeftFraction φ.Y' φ'.Y'
hα : (RightFraction.mk φ.s ⋯ φ'.s).f ≫ α.s = (RightFraction.mk φ.s ⋯ φ'.s).s ≫ α.f
ψ : W.LeftFraction₂ X Y := LeftFraction₂.mk (φ.f ≫ α.f) (φ'.f ≫ α.s) (φ'.s ≫ α.s) ⋯
this✝¹ : IsIso (L.map φ'.s)
this✝ : IsIso (L.map α.s)
this : IsIso (L.map (φ'.s ≫ α.s))
⊢ ∃ φ, f = φ.fst.map L ⋯ ∧ f' = φ.snd.map L ⋯