Theorem: SeparatingDual.exists_continuousLinearEquiv_apply_eq
File: Mathlib/Analysis/NormedSpace/HahnBanach/SeparatingDual.lean

Proof steps:
state_before: R : Type u_1
V : Type u_2
inst✝⁸ : Field R
inst✝⁷ : AddCommGroup V
inst✝⁶ : TopologicalSpace R
inst✝⁵ : TopologicalSpace V
inst✝⁴ : TopologicalRing R
inst✝³ : TopologicalAddGroup V
inst✝² : Module R V
inst✝¹ : SeparatingDual R V
inst✝ : ContinuousSMul R V
x y : V
hx : x ≠ 0
hy : y ≠ 0
⊢ ∃ A, A x = y
state_after: case intro.intro
R : Type u_1
V : Type u_2
inst✝⁸ : Field R
inst✝⁷ : AddCommGroup V
inst✝⁶ : TopologicalSpace R
inst✝⁵ : TopologicalSpace V
inst✝⁴ : TopologicalRing R
inst✝³ : TopologicalAddGroup V
inst✝² : Module R V
inst✝¹ : SeparatingDual R V
inst✝ : ContinuousSMul R V
x y : V
hx : x ≠ 0
hy : y ≠ 0
G : V →L[R] R
Gx : G x = 1
Gy : G y ≠ 0
⊢ ∃ A, A x = y
tactic: obtain ⟨G, Gx, Gy⟩ : ∃ G : V →L[R] R, G x = 1 ∧ G y ≠ 0 :=
    exists_eq_one_ne_zero_of_ne_zero_pair hx hy
state_before: case intro.intro
R : Type u_1
V : Type u_2
inst✝⁸ : Field R
inst✝⁷ : AddCommGroup V
inst✝⁶ : TopologicalSpace R
inst✝⁵ : TopologicalSpace V
inst✝⁴ : TopologicalRing R
inst✝³ : TopologicalAddGroup V
inst✝² : Module R V
inst✝¹ : SeparatingDual R V
inst✝ : ContinuousSMul R V
x y : V
hx : x ≠ 0
hy : y ≠ 0
G : V →L[R] R
Gx : G x = 1
Gy : G y ≠ 0
⊢ ∃ A, A x = y
state_after: case intro.intro
R : Type u_1
V : Type u_2
inst✝⁸ : Field R
inst✝⁷ : AddCommGroup V
inst✝⁶ : TopologicalSpace R
inst✝⁵ : TopologicalSpace V
inst✝⁴ : TopologicalRing R
inst✝³ : TopologicalAddGroup V
inst✝² : Module R V
inst✝¹ : SeparatingDual R V
inst✝ : ContinuousSMul R V
x y : V
hx : x ≠ 0
hy : y ≠ 0
G : V →L[R] R
Gx : G x = 1
Gy : G y ≠ 0
A : V ≃L[R] V :=
  { toFun := fun z => z + G z • (y - x), map_add' := ⋯, map_smul' := ⋯,
    invFun := fun z => z + ((G y)⁻¹ * G z) • (x - y), left_inv := ⋯, right_inv := ⋯, continuous_toFun := ⋯,
    continuous_invFun := ⋯ }
⊢ ∃ A, A x = y
tactic: let A : V ≃L[R] V :=
  { toFun := fun z ↦ z + G z • (y - x)
    invFun := fun z ↦ z + ((G y) ⁻¹ * G z) • (x - y)
    map_add' := fun a b ↦ by simp [add_smul]; abel
    map_smul' := by simp [smul_smul]
    left_inv := fun z ↦ by
      simp only [id_eq, eq_mpr_eq_cast, RingHom.id_apply, smul_eq_mul, AddHom.toFun_eq_coe,
        -- Note: #8386 had to change `map_smulₛₗ` into `map_smulₛₗ _`
        AddHom.coe_mk, map_add, map_smulₛₗ _, map_sub, Gx, mul_sub, mul_one, add_sub_cancel]
      rw [mul_comm (G z), ← mul_assoc, inv_mul_cancel Gy]
      simp only [smul_sub, one_mul]
      abel
    right_inv := fun z ↦ by
        -- Note: #8386 had to change `map_smulₛₗ` into `map_smulₛₗ _`
      simp only [map_add, map_smulₛₗ _, map_mul, map_inv₀, RingHom.id_apply, map_sub, Gx,
        smul_eq_mul, mul_sub, mul_one]
      rw [mul_comm _ (G y), ← mul_assoc, mul_inv_cancel Gy]
      simp only [smul_sub, one_mul, add_sub_cancel]
      abel
    continuous_toFun := continuous_id.add (G.continuous.smul continuous_const)
    continuous_invFun :=
      continuous_id.add ((continuous_const.mul G.continuous).smul continuous_const) }
state_before: case intro.intro
R : Type u_1
V : Type u_2
inst✝⁸ : Field R
inst✝⁷ : AddCommGroup V
inst✝⁶ : TopologicalSpace R
inst✝⁵ : TopologicalSpace V
inst✝⁴ : TopologicalRing R
inst✝³ : TopologicalAddGroup V
inst✝² : Module R V
inst✝¹ : SeparatingDual R V
inst✝ : ContinuousSMul R V
x y : V
hx : x ≠ 0
hy : y ≠ 0
G : V →L[R] R
Gx : G x = 1
Gy : G y ≠ 0
A : V ≃L[R] V :=
  { toFun := fun z => z + G z • (y - x), map_add' := ⋯, map_smul' := ⋯,
    invFun := fun z => z + ((G y)⁻¹ * G z) • (x - y), left_inv := ⋯, right_inv := ⋯, continuous_toFun := ⋯,
    continuous_invFun := ⋯ }
⊢ ∃ A, A x = y
state_after: no goals
tactic: exact ⟨A, show x + G x • (y - x) = y by simp [Gx]⟩