Theorem: eq_lineMap_of_dist_eq_mul_of_dist_eq_mul
File: Mathlib/Analysis/Convex/StrictConvexSpace.lean

tactic: have : y -ᵥ x ∈ [(0 : E) -[ℝ] z -ᵥ x] := by
  rw [← dist_add_dist_eq_iff, dist_zero_left, dist_vsub_cancel_right, ← dist_eq_norm_vsub', ←
    dist_eq_norm_vsub', hxy, hyz, ← add_mul, add_sub_cancel'_right, one_mul]
state_before: 𝕜 : Type ?u.86035
E : Type u_2
inst✝¹⁰ : NormedLinearOrderedField 𝕜
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : StrictConvexSpace ℝ E
x✝ y✝ z✝ : E
a b r : ℝ
F : Type ?u.86312
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
PF : Type u
PE : Type u_1
inst✝³ : MetricSpace PF
inst✝² : MetricSpace PE
inst✝¹ : NormedAddTorsor F PF
inst✝ : NormedAddTorsor E PE
x y z : PE
hxy : dist x y = r * dist x z
hyz : dist y z = (1 - r) * dist x z
⊢ y = ↑(AffineMap.lineMap x z) r

tactic: rcases eq_or_ne x z with (rfl | hne)
state_before: 𝕜 : Type ?u.86035
E : Type u_2
inst✝¹⁰ : NormedLinearOrderedField 𝕜
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : StrictConvexSpace ℝ E
x✝ y✝ z✝ : E
a b r : ℝ
F : Type ?u.86312
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
PF : Type u
PE : Type u_1
inst✝³ : MetricSpace PF
inst✝² : MetricSpace PE
inst✝¹ : NormedAddTorsor F PF
inst✝ : NormedAddTorsor E PE
x y z : PE
hxy : dist x y = r * dist x z
hyz : dist y z = (1 - r) * dist x z
this : y -ᵥ x ∈ [0-[ℝ]z -ᵥ x]
⊢ y = ↑(AffineMap.lineMap x z) r

tactic: rw [← dist_add_dist_eq_iff, dist_zero_left, dist_vsub_cancel_right, ← dist_eq_norm_vsub', ←
  dist_eq_norm_vsub', hxy, hyz, ← add_mul, add_sub_cancel'_right, one_mul]
state_before: 𝕜 : Type ?u.86035
E : Type u_2
inst✝¹⁰ : NormedLinearOrderedField 𝕜
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : StrictConvexSpace ℝ E
x✝ y✝ z✝ : E
a b r : ℝ
F : Type ?u.86312
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
PF : Type u
PE : Type u_1
inst✝³ : MetricSpace PF
inst✝² : MetricSpace PE
inst✝¹ : NormedAddTorsor F PF
inst✝ : NormedAddTorsor E PE
x y z : PE
hxy : dist x y = r * dist x z
hyz : dist y z = (1 - r) * dist x z
⊢ y -ᵥ x ∈ [0-[ℝ]z -ᵥ x]

tactic: obtain rfl : y = x := by simpa
state_before: case inl
𝕜 : Type ?u.86035
E : Type u_2
inst✝¹⁰ : NormedLinearOrderedField 𝕜
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : StrictConvexSpace ℝ E
x✝ y✝ z : E
a b r : ℝ
F : Type ?u.86312
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
PF : Type u
PE : Type u_1
inst✝³ : MetricSpace PF
inst✝² : MetricSpace PE
inst✝¹ : NormedAddTorsor F PF
inst✝ : NormedAddTorsor E PE
x y : PE
hxy : dist x y = r * dist x x
hyz : dist y x = (1 - r) * dist x x
this : y -ᵥ x ∈ [0-[ℝ]x -ᵥ x]
⊢ y = ↑(AffineMap.lineMap x x) r

tactic: simp
state_before: case inl
𝕜 : Type ?u.86035
E : Type u_2
inst✝¹⁰ : NormedLinearOrderedField 𝕜
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : StrictConvexSpace ℝ E
x y✝ z : E
a b r : ℝ
F : Type ?u.86312
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
PF : Type u
PE : Type u_1
inst✝³ : MetricSpace PF
inst✝² : MetricSpace PE
inst✝¹ : NormedAddTorsor F PF
inst✝ : NormedAddTorsor E PE
y : PE
hxy : dist y y = r * dist y y
hyz : dist y y = (1 - r) * dist y y
this : y -ᵥ y ∈ [0-[ℝ]y -ᵥ y]
⊢ y = ↑(AffineMap.lineMap y y) r

tactic: rfl
state_before: case inl
𝕜 : Type ?u.86035
E : Type u_2
inst✝¹⁰ : NormedLinearOrderedField 𝕜
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : StrictConvexSpace ℝ E
x y✝ z : E
a b r : ℝ
F : Type ?u.86312
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
PF : Type u
PE : Type u_1
inst✝³ : MetricSpace PF
inst✝² : MetricSpace PE
inst✝¹ : NormedAddTorsor F PF
inst✝ : NormedAddTorsor E PE
y : PE
hxy : dist y y = r * dist y y
hyz : dist y y = (1 - r) * dist y y
this : y -ᵥ y ∈ [0-[ℝ]y -ᵥ y]
⊢ y = ↑(AffineMap.const ℝ ℝ y) r

tactic: simpa
state_before: 𝕜 : Type ?u.86035
E : Type u_2
inst✝¹⁰ : NormedLinearOrderedField 𝕜
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : StrictConvexSpace ℝ E
x✝ y✝ z : E
a b r : ℝ
F : Type ?u.86312
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
PF : Type u
PE : Type u_1
inst✝³ : MetricSpace PF
inst✝² : MetricSpace PE
inst✝¹ : NormedAddTorsor F PF
inst✝ : NormedAddTorsor E PE
x y : PE
hxy : dist x y = r * dist x x
hyz : dist y x = (1 - r) * dist x x
this : y -ᵥ x ∈ [0-[ℝ]x -ᵥ x]
⊢ y = x

tactic: rw [← dist_ne_zero] at hne
state_before: case inr
𝕜 : Type ?u.86035
E : Type u_2
inst✝¹⁰ : NormedLinearOrderedField 𝕜
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : StrictConvexSpace ℝ E
x✝ y✝ z✝ : E
a b r : ℝ
F : Type ?u.86312
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
PF : Type u
PE : Type u_1
inst✝³ : MetricSpace PF
inst✝² : MetricSpace PE
inst✝¹ : NormedAddTorsor F PF
inst✝ : NormedAddTorsor E PE
x y z : PE
hxy : dist x y = r * dist x z
hyz : dist y z = (1 - r) * dist x z
this : y -ᵥ x ∈ [0-[ℝ]z -ᵥ x]
hne : x ≠ z
⊢ y = ↑(AffineMap.lineMap x z) r

tactic: rcases this with ⟨a, b, _, hb, _, H⟩
state_before: case inr
𝕜 : Type ?u.86035
E : Type u_2
inst✝¹⁰ : NormedLinearOrderedField 𝕜
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : StrictConvexSpace ℝ E
x✝ y✝ z✝ : E
a b r : ℝ
F : Type ?u.86312
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
PF : Type u
PE : Type u_1
inst✝³ : MetricSpace PF
inst✝² : MetricSpace PE
inst✝¹ : NormedAddTorsor F PF
inst✝ : NormedAddTorsor E PE
x y z : PE
hxy : dist x y = r * dist x z
hyz : dist y z = (1 - r) * dist x z
this : y -ᵥ x ∈ [0-[ℝ]z -ᵥ x]
hne✝ : x ≠ z
hne : dist x z ≠ 0
⊢ y = ↑(AffineMap.lineMap x z) r

tactic: rw [smul_zero, zero_add] at H
state_before: case inr.intro.intro.intro.intro.intro
𝕜 : Type ?u.86035
E : Type u_2
inst✝¹⁰ : NormedLinearOrderedField 𝕜
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : StrictConvexSpace ℝ E
x✝ y✝ z✝ : E
a✝ b✝ r : ℝ
F : Type ?u.86312
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
PF : Type u
PE : Type u_1
inst✝³ : MetricSpace PF
inst✝² : MetricSpace PE
inst✝¹ : NormedAddTorsor F PF
inst✝ : NormedAddTorsor E PE
x y z : PE
hxy : dist x y = r * dist x z
hyz : dist y z = (1 - r) * dist x z
hne✝ : x ≠ z
hne : dist x z ≠ 0
a b : ℝ
w✝¹ : 0 ≤ a
hb : 0 ≤ b
w✝ : a + b = 1
H : a • 0 + b • (z -ᵥ x) = y -ᵥ x
⊢ y = ↑(AffineMap.lineMap x z) r

tactic: have H' := congr_arg norm H
state_before: case inr.intro.intro.intro.intro.intro
𝕜 : Type ?u.86035
E : Type u_2
inst✝¹⁰ : NormedLinearOrderedField 𝕜
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : StrictConvexSpace ℝ E
x✝ y✝ z✝ : E
a✝ b✝ r : ℝ
F : Type ?u.86312
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
PF : Type u
PE : Type u_1
inst✝³ : MetricSpace PF
inst✝² : MetricSpace PE
inst✝¹ : NormedAddTorsor F PF
inst✝ : NormedAddTorsor E PE
x y z : PE
hxy : dist x y = r * dist x z
hyz : dist y z = (1 - r) * dist x z
hne✝ : x ≠ z
hne : dist x z ≠ 0
a b : ℝ
w✝¹ : 0 ≤ a
hb : 0 ≤ b
w✝ : a + b = 1
H : b • (z -ᵥ x) = y -ᵥ x
⊢ y = ↑(AffineMap.lineMap x z) r

tactic: rw [norm_smul, Real.norm_of_nonneg hb, ← dist_eq_norm_vsub', ← dist_eq_norm_vsub', hxy,
  mul_left_inj' hne] at H'
state_before: case inr.intro.intro.intro.intro.intro
𝕜 : Type ?u.86035
E : Type u_2
inst✝¹⁰ : NormedLinearOrderedField 𝕜
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : StrictConvexSpace ℝ E
x✝ y✝ z✝ : E
a✝ b✝ r : ℝ
F : Type ?u.86312
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
PF : Type u
PE : Type u_1
inst✝³ : MetricSpace PF
inst✝² : MetricSpace PE
inst✝¹ : NormedAddTorsor F PF
inst✝ : NormedAddTorsor E PE
x y z : PE
hxy : dist x y = r * dist x z
hyz : dist y z = (1 - r) * dist x z
hne✝ : x ≠ z
hne : dist x z ≠ 0
a b : ℝ
w✝¹ : 0 ≤ a
hb : 0 ≤ b
w✝ : a + b = 1
H : b • (z -ᵥ x) = y -ᵥ x
H' : ‖b • (z -ᵥ x)‖ = ‖y -ᵥ x‖
⊢ y = ↑(AffineMap.lineMap x z) r

tactic: rw [AffineMap.lineMap_apply, ← H', H, vsub_vadd]
state_before: case inr.intro.intro.intro.intro.intro
𝕜 : Type ?u.86035
E : Type u_2
inst✝¹⁰ : NormedLinearOrderedField 𝕜
inst✝⁹ : NormedAddCommGroup E
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : NormedSpace ℝ E
inst✝⁶ : StrictConvexSpace ℝ E
x✝ y✝ z✝ : E
a✝ b✝ r : ℝ
F : Type ?u.86312
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace ℝ F
PF : Type u
PE : Type u_1
inst✝³ : MetricSpace PF
inst✝² : MetricSpace PE
inst✝¹ : NormedAddTorsor F PF
inst✝ : NormedAddTorsor E PE
x y z : PE
hxy : dist x y = r * dist x z
hyz : dist y z = (1 - r) * dist x z
hne✝ : x ≠ z
hne : dist x z ≠ 0
a b : ℝ
w✝¹ : 0 ≤ a
hb : 0 ≤ b
w✝ : a + b = 1
H : b • (z -ᵥ x) = y -ᵥ x
H' : b = r
⊢ y = ↑(AffineMap.lineMap x z) r