Theorem: IsometryEquiv.midpoint_fixed
File: Mathlib/Analysis/NormedSpace/MazurUlam.lean

tactic: set z := midpoint ℝ x y
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
⊢ ∀ (e : PE ≃ᵢ PE), ↑e x = x → ↑e y = y → ↑e (midpoint ℝ x y) = midpoint ℝ x y

tactic: set s := { e : PE ≃ᵢ PE | e x = x ∧ e y = y }
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
⊢ ∀ (e : PE ≃ᵢ PE), ↑e x = x → ↑e y = y → ↑e z = z

tactic: haveI : Nonempty s := ⟨⟨IsometryEquiv.refl PE, rfl, rfl⟩⟩
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
⊢ ∀ (e : PE ≃ᵢ PE), ↑e x = x → ↑e y = y → ↑e z = z

tactic: have h_bdd : BddAbove (range fun e : s => dist ((e : PE ≃ᵢ PE) z) z) := by
  refine' ⟨dist x z + dist x z, forall_range_iff.2 <| Subtype.forall.2 _⟩
  rintro e ⟨hx, _⟩
  calc
    dist (e z) z ≤ dist (e z) x + dist x z := dist_triangle (e z) x z
    _ = dist (e x) (e z) + dist x z := by rw [hx, dist_comm]
    _ = dist x z + dist x z := by erw [e.dist_eq x z]
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
⊢ ∀ (e : PE ≃ᵢ PE), ↑e x = x → ↑e y = y → ↑e z = z

tactic: set R : PE ≃ᵢ PE := (pointReflection ℝ z).toIsometryEquiv
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
⊢ ∀ (e : PE ≃ᵢ PE), ↑e x = x → ↑e y = y → ↑e z = z

tactic: set f : PE ≃ᵢ PE → PE ≃ᵢ PE := fun e => ((e.trans R).trans e.symm).trans R
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
⊢ ∀ (e : PE ≃ᵢ PE), ↑e x = x → ↑e y = y → ↑e z = z

tactic: have hf_dist : ∀ e, dist (f e z) z = 2 * dist (e z) z := by
  intro e
  dsimp
  rw [dist_pointReflection_fixed, ← e.dist_eq, e.apply_symm_apply,
    dist_pointReflection_self_real, dist_comm]
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
⊢ ∀ (e : PE ≃ᵢ PE), ↑e x = x → ↑e y = y → ↑e z = z

tactic: have hf_maps_to : MapsTo f s s := by
  rintro e ⟨hx, hy⟩
  constructor <;> simp [hx, hy, e.symm_apply_eq.2 hx.symm, e.symm_apply_eq.2 hy.symm]
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
hf_dist : ∀ (e : PE ≃ᵢ PE), dist (↑(f e) z) z = 2 * dist (↑e z) z
⊢ ∀ (e : PE ≃ᵢ PE), ↑e x = x → ↑e y = y → ↑e z = z

tactic: set c := ⨆ e : s, dist ((e : PE ≃ᵢ PE) z) z
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
hf_dist : ∀ (e : PE ≃ᵢ PE), dist (↑(f e) z) z = 2 * dist (↑e z) z
hf_maps_to : MapsTo f s s
⊢ ∀ (e : PE ≃ᵢ PE), ↑e x = x → ↑e y = y → ↑e z = z

tactic: have : c ≤ c / 2 := by
  apply ciSup_le
  rintro ⟨e, he⟩
  simp only [Subtype.coe_mk, le_div_iff' (zero_lt_two' ℝ), ← hf_dist]
  exact le_ciSup h_bdd ⟨f e, hf_maps_to he⟩
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
hf_dist : ∀ (e : PE ≃ᵢ PE), dist (↑(f e) z) z = 2 * dist (↑e z) z
hf_maps_to : MapsTo f s s
c : ℝ := ⨆ (e : ↑s), dist (↑↑e z) z
⊢ ∀ (e : PE ≃ᵢ PE), ↑e x = x → ↑e y = y → ↑e z = z

tactic: replace : c ≤ 0
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this✝ : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
hf_dist : ∀ (e : PE ≃ᵢ PE), dist (↑(f e) z) z = 2 * dist (↑e z) z
hf_maps_to : MapsTo f s s
c : ℝ := ⨆ (e : ↑s), dist (↑↑e z) z
this : c ≤ c / 2
⊢ ∀ (e : PE ≃ᵢ PE), ↑e x = x → ↑e y = y → ↑e z = z

tactic: refine' fun e hx hy => dist_le_zero.1 (le_trans _ this)
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this✝ : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
hf_dist : ∀ (e : PE ≃ᵢ PE), dist (↑(f e) z) z = 2 * dist (↑e z) z
hf_maps_to : MapsTo f s s
c : ℝ := ⨆ (e : ↑s), dist (↑↑e z) z
this : c ≤ 0
⊢ ∀ (e : PE ≃ᵢ PE), ↑e x = x → ↑e y = y → ↑e z = z

tactic: exact le_ciSup h_bdd ⟨e, hx, hy⟩
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this✝ : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
hf_dist : ∀ (e : PE ≃ᵢ PE), dist (↑(f e) z) z = 2 * dist (↑e z) z
hf_maps_to : MapsTo f s s
c : ℝ := ⨆ (e : ↑s), dist (↑↑e z) z
this : c ≤ 0
e : PE ≃ᵢ PE
hx : ↑e x = x
hy : ↑e y = y
⊢ dist (↑e z) z ≤ c

tactic: refine' ⟨dist x z + dist x z, forall_range_iff.2 <| Subtype.forall.2 _⟩
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
⊢ BddAbove (range fun e => dist (↑↑e z) z)

tactic: rintro e ⟨hx, _⟩
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
⊢ ∀ (a : PE ≃ᵢ PE) (b : a ∈ s), dist (↑↑{ val := a, property := b } z) z ≤ dist x z + dist x z

tactic: calc
  dist (e z) z ≤ dist (e z) x + dist x z := dist_triangle (e z) x z
  _ = dist (e x) (e z) + dist x z := by rw [hx, dist_comm]
  _ = dist x z + dist x z := by erw [e.dist_eq x z]
state_before: case intro
E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
e : PE ≃ᵢ PE
hx : ↑e x = x
right✝ : ↑e y = y
⊢ dist (↑↑{ val := e, property := (_ : ↑e x = x ∧ ↑e y = y) } z) z ≤ dist x z + dist x z

tactic: rw [hx, dist_comm]
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
e : PE ≃ᵢ PE
hx : ↑e x = x
right✝ : ↑e y = y
⊢ dist (↑e z) x + dist x z = dist (↑e x) (↑e z) + dist x z

tactic: erw [e.dist_eq x z]
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
e : PE ≃ᵢ PE
hx : ↑e x = x
right✝ : ↑e y = y
⊢ dist (↑e x) (↑e z) + dist x z = dist x z + dist x z

tactic: intro e
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
⊢ ∀ (e : PE ≃ᵢ PE), dist (↑(f e) z) z = 2 * dist (↑e z) z

tactic: dsimp
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
e : PE ≃ᵢ PE
⊢ dist (↑(f e) z) z = 2 * dist (↑e z) z

tactic: rw [dist_pointReflection_fixed, ← e.dist_eq, e.apply_symm_apply,
  dist_pointReflection_self_real, dist_comm]
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
e : PE ≃ᵢ PE
⊢ dist
      (↑(pointReflection ℝ (midpoint ℝ x y))
        (↑(IsometryEquiv.symm e) (↑(pointReflection ℝ (midpoint ℝ x y)) (↑e (midpoint ℝ x y)))))
      (midpoint ℝ x y) =
    2 * dist (↑e (midpoint ℝ x y)) (midpoint ℝ x y)

tactic: rintro e ⟨hx, hy⟩
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
hf_dist : ∀ (e : PE ≃ᵢ PE), dist (↑(f e) z) z = 2 * dist (↑e z) z
⊢ MapsTo f s s

tactic: constructor <;> simp [hx, hy, e.symm_apply_eq.2 hx.symm, e.symm_apply_eq.2 hy.symm]
state_before: case intro
E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
hf_dist : ∀ (e : PE ≃ᵢ PE), dist (↑(f e) z) z = 2 * dist (↑e z) z
e : PE ≃ᵢ PE
hx : ↑e x = x
hy : ↑e y = y
⊢ f e ∈ s

tactic: apply ciSup_le
state_before: E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
hf_dist : ∀ (e : PE ≃ᵢ PE), dist (↑(f e) z) z = 2 * dist (↑e z) z
hf_maps_to : MapsTo f s s
c : ℝ := ⨆ (e : ↑s), dist (↑↑e z) z
⊢ c ≤ c / 2

tactic: rintro ⟨e, he⟩
state_before: case H
E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
hf_dist : ∀ (e : PE ≃ᵢ PE), dist (↑(f e) z) z = 2 * dist (↑e z) z
hf_maps_to : MapsTo f s s
c : ℝ := ⨆ (e : ↑s), dist (↑↑e z) z
⊢ ∀ (x : ↑s), dist (↑↑x z) z ≤ c / 2

tactic: simp only [Subtype.coe_mk, le_div_iff' (zero_lt_two' ℝ), ← hf_dist]
state_before: case H.mk
E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
hf_dist : ∀ (e : PE ≃ᵢ PE), dist (↑(f e) z) z = 2 * dist (↑e z) z
hf_maps_to : MapsTo f s s
c : ℝ := ⨆ (e : ↑s), dist (↑↑e z) z
e : PE ≃ᵢ PE
he : e ∈ s
⊢ dist (↑↑{ val := e, property := he } z) z ≤ c / 2

tactic: exact le_ciSup h_bdd ⟨f e, hf_maps_to he⟩
state_before: case H.mk
E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
hf_dist : ∀ (e : PE ≃ᵢ PE), dist (↑(f e) z) z = 2 * dist (↑e z) z
hf_maps_to : MapsTo f s s
c : ℝ := ⨆ (e : ↑s), dist (↑↑e z) z
e : PE ≃ᵢ PE
he : e ∈ s
⊢ dist
      (↑(IsometryEquiv.trans
            (IsometryEquiv.trans (IsometryEquiv.trans e (toIsometryEquiv (pointReflection ℝ (midpoint ℝ x y))))
              (IsometryEquiv.symm e))
            (toIsometryEquiv (pointReflection ℝ (midpoint ℝ x y))))
        (midpoint ℝ x y))
      (midpoint ℝ x y) ≤
    ⨆ (e : ↑{e | ↑e x = x ∧ ↑e y = y}), dist (↑↑e (midpoint ℝ x y)) (midpoint ℝ x y)

tactic: linarith
state_before: case this
E : Type u_2
PE : Type u_1
F : Type ?u.569
PF : Type ?u.572
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : MetricSpace PE
inst✝⁴ : NormedAddTorsor E PE
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace ℝ F
inst✝¹ : MetricSpace PF
inst✝ : NormedAddTorsor F PF
x y : PE
z : PE := midpoint ℝ x y
s : Set (PE ≃ᵢ PE) := {e | ↑e x = x ∧ ↑e y = y}
this✝ : Nonempty ↑s
h_bdd : BddAbove (range fun e => dist (↑↑e z) z)
R : PE ≃ᵢ PE := toIsometryEquiv (pointReflection ℝ z)
f : PE ≃ᵢ PE → PE ≃ᵢ PE :=
  fun e => IsometryEquiv.trans (IsometryEquiv.trans (IsometryEquiv.trans e R) (IsometryEquiv.symm e)) R
hf_dist : ∀ (e : PE ≃ᵢ PE), dist (↑(f e) z) z = 2 * dist (↑e z) z
hf_maps_to : MapsTo f s s
c : ℝ := ⨆ (e : ↑s), dist (↑↑e z) z
this : c ≤ c / 2
⊢ c ≤ 0