[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
⊢ ContDiffOn ℝ ⊤ (stereoToFun v) {x | ↑(↑(innerSL ℝ) v) x ≠ 1}
[PROOFSTEP]
refine' ContDiffOn.smul _ (orthogonalProjection (ℝ ∙ v)ᗮ).contDiff.contDiffOn
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
⊢ ContDiffOn ℝ ⊤ (fun x => 2 / (1 - ↑(↑(innerSL ℝ) v) x)) {x | ↑(↑(innerSL ℝ) v) x ≠ 1}
[PROOFSTEP]
refine' contDiff_const.contDiffOn.div _ _
[GOAL]
case refine'_1
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
⊢ ContDiffOn ℝ ⊤ (fun x => 1 - ↑(↑(innerSL ℝ) v) x) {x | ↑(↑(innerSL ℝ) v) x ≠ 1}
[PROOFSTEP]
exact (contDiff_const.sub (innerSL ℝ v).contDiff).contDiffOn
[GOAL]
case refine'_2
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
⊢ ∀ (x : E), x ∈ {x | ↑(↑(innerSL ℝ) v) x ≠ 1} → 1 - ↑(↑(innerSL ℝ) v) x ≠ 0
[PROOFSTEP]
intro x h h'
[GOAL]
case refine'_2
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v x : E
h : x ∈ {x | ↑(↑(innerSL ℝ) v) x ≠ 1}
h' : 1 - ↑(↑(innerSL ℝ) v) x = 0
⊢ False
[PROOFSTEP]
exact h (sub_eq_zero.mp h').symm
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : E
hw : w ∈ (Submodule.span ℝ {v})ᗮ
⊢ stereoInvFunAux v w ∈ sphere 0 1
[PROOFSTEP]
have h₁ : (0 : ℝ) < ‖w‖ ^ 2 + 4 := by positivity
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : E
hw : w ∈ (Submodule.span ℝ {v})ᗮ
⊢ 0 < ‖w‖ ^ 2 + 4
[PROOFSTEP]
positivity
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : E
hw : w ∈ (Submodule.span ℝ {v})ᗮ
h₁ : 0 < ‖w‖ ^ 2 + 4
⊢ stereoInvFunAux v w ∈ sphere 0 1
[PROOFSTEP]
suffices : ‖(4 : ℝ) • w + (‖w‖ ^ 2 - 4) • v‖ = ‖w‖ ^ 2 + 4
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : E
hw : w ∈ (Submodule.span ℝ {v})ᗮ
h₁ : 0 < ‖w‖ ^ 2 + 4
this : ‖4 • w + (‖w‖ ^ 2 - 4) • v‖ = ‖w‖ ^ 2 + 4
⊢ stereoInvFunAux v w ∈ sphere 0 1
[PROOFSTEP]
simp only [mem_sphere_zero_iff_norm, norm_smul, Real.norm_eq_abs, abs_inv, this, abs_of_pos h₁, stereoInvFunAux_apply,
  inv_mul_cancel h₁.ne']
[GOAL]
case this
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : E
hw : w ∈ (Submodule.span ℝ {v})ᗮ
h₁ : 0 < ‖w‖ ^ 2 + 4
⊢ ‖4 • w + (‖w‖ ^ 2 - 4) • v‖ = ‖w‖ ^ 2 + 4
[PROOFSTEP]
suffices : ‖(4 : ℝ) • w + (‖w‖ ^ 2 - 4) • v‖ ^ 2 = (‖w‖ ^ 2 + 4) ^ 2
[GOAL]
case this
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : E
hw : w ∈ (Submodule.span ℝ {v})ᗮ
h₁ : 0 < ‖w‖ ^ 2 + 4
this : ‖4 • w + (‖w‖ ^ 2 - 4) • v‖ ^ 2 = (‖w‖ ^ 2 + 4) ^ 2
⊢ ‖4 • w + (‖w‖ ^ 2 - 4) • v‖ = ‖w‖ ^ 2 + 4
[PROOFSTEP]
simpa [sq_eq_sq_iff_abs_eq_abs, abs_of_pos h₁] using this
[GOAL]
case this
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : E
hw : w ∈ (Submodule.span ℝ {v})ᗮ
h₁ : 0 < ‖w‖ ^ 2 + 4
⊢ ‖4 • w + (‖w‖ ^ 2 - 4) • v‖ ^ 2 = (‖w‖ ^ 2 + 4) ^ 2
[PROOFSTEP]
rw [Submodule.mem_orthogonal_singleton_iff_inner_left] at hw
[GOAL]
case this
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : E
hw : inner w v = 0
h₁ : 0 < ‖w‖ ^ 2 + 4
⊢ ‖4 • w + (‖w‖ ^ 2 - 4) • v‖ ^ 2 = (‖w‖ ^ 2 + 4) ^ 2
[PROOFSTEP]
simp [norm_add_sq_real, norm_smul, inner_smul_left, inner_smul_right, hw, mul_pow, Real.norm_eq_abs, hv]
[GOAL]
case this
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : E
hw : inner w v = 0
h₁ : 0 < ‖w‖ ^ 2 + 4
⊢ 4 ^ 2 * ‖w‖ ^ 2 + (‖w‖ ^ 2 - 4) ^ 2 = (‖w‖ ^ 2 + 4) ^ 2
[PROOFSTEP]
ring
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
⊢ HasFDerivAt (stereoInvFunAux v) (ContinuousLinearMap.id ℝ E) 0
[PROOFSTEP]
have h₀ : HasFDerivAt (fun w : E => ‖w‖ ^ 2) (0 : E →L[ℝ] ℝ) 0 :=
  by
  convert (hasStrictFDerivAt_norm_sq (0 : E)).hasFDerivAt
  simp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
⊢ HasFDerivAt (fun w => ‖w‖ ^ 2) 0 0
[PROOFSTEP]
convert (hasStrictFDerivAt_norm_sq (0 : E)).hasFDerivAt
[GOAL]
case h.e'_10
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
⊢ 0 = 2 • ↑(innerSL ℝ) 0
[PROOFSTEP]
simp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
h₀ : HasFDerivAt (fun w => ‖w‖ ^ 2) 0 0
⊢ HasFDerivAt (stereoInvFunAux v) (ContinuousLinearMap.id ℝ E) 0
[PROOFSTEP]
have h₁ : HasFDerivAt (fun w : E => (‖w‖ ^ 2 + 4)⁻¹) (0 : E →L[ℝ] ℝ) 0 := by
  convert (hasFDerivAt_inv _).comp _ (h₀.add (hasFDerivAt_const 4 0)) <;> simp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
h₀ : HasFDerivAt (fun w => ‖w‖ ^ 2) 0 0
⊢ HasFDerivAt (fun w => (‖w‖ ^ 2 + 4)⁻¹) 0 0
[PROOFSTEP]
convert (hasFDerivAt_inv _).comp _ (h₀.add (hasFDerivAt_const 4 0))
[GOAL]
case h.e'_10.h.h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
h₀ : HasFDerivAt (fun w => ‖w‖ ^ 2) 0 0
e_7✝ : Real.normedAddCommGroup = NonUnitalNormedRing.toNormedAddCommGroup
he✝ : InnerProductSpace.toNormedSpace = NormedField.toNormedSpace
⊢ 0 = ContinuousLinearMap.comp (ContinuousLinearMap.smulRight 1 (-((‖0‖ ^ 2 + 4) ^ 2)⁻¹)) (0 + 0)
[PROOFSTEP]
simp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
h₀ : HasFDerivAt (fun w => ‖w‖ ^ 2) 0 0
⊢ ‖0‖ ^ 2 + 4 ≠ 0
[PROOFSTEP]
simp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
h₀ : HasFDerivAt (fun w => ‖w‖ ^ 2) 0 0
h₁ : HasFDerivAt (fun w => (‖w‖ ^ 2 + 4)⁻¹) 0 0
⊢ HasFDerivAt (stereoInvFunAux v) (ContinuousLinearMap.id ℝ E) 0
[PROOFSTEP]
have h₂ : HasFDerivAt (fun w => (4 : ℝ) • w + (‖w‖ ^ 2 - 4) • v) ((4 : ℝ) • ContinuousLinearMap.id ℝ E) 0
[GOAL]
case h₂
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
h₀ : HasFDerivAt (fun w => ‖w‖ ^ 2) 0 0
h₁ : HasFDerivAt (fun w => (‖w‖ ^ 2 + 4)⁻¹) 0 0
⊢ HasFDerivAt (fun w => 4 • w + (‖w‖ ^ 2 - 4) • v) (4 • ContinuousLinearMap.id ℝ E) 0
[PROOFSTEP]
convert
  ((hasFDerivAt_const (4 : ℝ) 0).smul (hasFDerivAt_id 0)).add
    ((h₀.sub (hasFDerivAt_const (4 : ℝ) 0)).smul (hasFDerivAt_const v 0)) using
  1
[GOAL]
case h.e'_10
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
h₀ : HasFDerivAt (fun w => ‖w‖ ^ 2) 0 0
h₁ : HasFDerivAt (fun w => (‖w‖ ^ 2 + 4)⁻¹) 0 0
⊢ 4 • ContinuousLinearMap.id ℝ E =
    4 • ContinuousLinearMap.id ℝ E + ContinuousLinearMap.smulRight 0 (id 0) +
      ((‖0‖ ^ 2 - 4) • 0 + ContinuousLinearMap.smulRight (0 - 0) v)
[PROOFSTEP]
ext w
[GOAL]
case h.e'_10.h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
h₀ : HasFDerivAt (fun w => ‖w‖ ^ 2) 0 0
h₁ : HasFDerivAt (fun w => (‖w‖ ^ 2 + 4)⁻¹) 0 0
w : E
⊢ ↑(4 • ContinuousLinearMap.id ℝ E) w =
    ↑(4 • ContinuousLinearMap.id ℝ E + ContinuousLinearMap.smulRight 0 (id 0) +
          ((‖0‖ ^ 2 - 4) • 0 + ContinuousLinearMap.smulRight (0 - 0) v))
      w
[PROOFSTEP]
simp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
h₀ : HasFDerivAt (fun w => ‖w‖ ^ 2) 0 0
h₁ : HasFDerivAt (fun w => (‖w‖ ^ 2 + 4)⁻¹) 0 0
h₂ : HasFDerivAt (fun w => 4 • w + (‖w‖ ^ 2 - 4) • v) (4 • ContinuousLinearMap.id ℝ E) 0
⊢ HasFDerivAt (stereoInvFunAux v) (ContinuousLinearMap.id ℝ E) 0
[PROOFSTEP]
convert h₁.smul h₂ using 1
[GOAL]
case h.e'_10
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
h₀ : HasFDerivAt (fun w => ‖w‖ ^ 2) 0 0
h₁ : HasFDerivAt (fun w => (‖w‖ ^ 2 + 4)⁻¹) 0 0
h₂ : HasFDerivAt (fun w => 4 • w + (‖w‖ ^ 2 - 4) • v) (4 • ContinuousLinearMap.id ℝ E) 0
⊢ ContinuousLinearMap.id ℝ E =
    (‖0‖ ^ 2 + 4)⁻¹ • 4 • ContinuousLinearMap.id ℝ E + ContinuousLinearMap.smulRight 0 (4 • 0 + (‖0‖ ^ 2 - 4) • v)
[PROOFSTEP]
ext w
[GOAL]
case h.e'_10.h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
h₀ : HasFDerivAt (fun w => ‖w‖ ^ 2) 0 0
h₁ : HasFDerivAt (fun w => (‖w‖ ^ 2 + 4)⁻¹) 0 0
h₂ : HasFDerivAt (fun w => 4 • w + (‖w‖ ^ 2 - 4) • v) (4 • ContinuousLinearMap.id ℝ E) 0
w : E
⊢ ↑(ContinuousLinearMap.id ℝ E) w =
    ↑((‖0‖ ^ 2 + 4)⁻¹ • 4 • ContinuousLinearMap.id ℝ E + ContinuousLinearMap.smulRight 0 (4 • 0 + (‖0‖ ^ 2 - 4) • v)) w
[PROOFSTEP]
simp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
⊢ HasFDerivAt (stereoInvFunAux v ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {v})ᗮ) 0
[PROOFSTEP]
have : HasFDerivAt (stereoInvFunAux v) (ContinuousLinearMap.id ℝ E) ((ℝ ∙ v)ᗮ.subtypeL 0) :=
  hasFDerivAt_stereoInvFunAux v
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
this : HasFDerivAt (stereoInvFunAux v) (ContinuousLinearMap.id ℝ E) (↑(Submodule.subtypeL (Submodule.span ℝ {v})ᗮ) 0)
⊢ HasFDerivAt (stereoInvFunAux v ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {v})ᗮ) 0
[PROOFSTEP]
convert this.comp (0 : (ℝ ∙ v)ᗮ) (by apply ContinuousLinearMap.hasFDerivAt)
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ v : E
this : HasFDerivAt (stereoInvFunAux v) (ContinuousLinearMap.id ℝ E) (↑(Submodule.subtypeL (Submodule.span ℝ {v})ᗮ) 0)
⊢ HasFDerivAt ↑(Submodule.subtypeL (Submodule.span ℝ {v})ᗮ) ?m.163288 0
[PROOFSTEP]
apply ContinuousLinearMap.hasFDerivAt
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
⊢ ContDiff ℝ ⊤ (stereoInvFunAux v)
[PROOFSTEP]
have h₀ : ContDiff ℝ ⊤ fun w : E => ‖w‖ ^ 2 := contDiff_norm_sq ℝ
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
h₀ : ContDiff ℝ ⊤ fun w => ‖w‖ ^ 2
⊢ ContDiff ℝ ⊤ (stereoInvFunAux v)
[PROOFSTEP]
have h₁ : ContDiff ℝ ⊤ fun w : E => (‖w‖ ^ 2 + 4)⁻¹ :=
  by
  refine' (h₀.add contDiff_const).inv _
  intro x
  nlinarith
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
h₀ : ContDiff ℝ ⊤ fun w => ‖w‖ ^ 2
⊢ ContDiff ℝ ⊤ fun w => (‖w‖ ^ 2 + 4)⁻¹
[PROOFSTEP]
refine' (h₀.add contDiff_const).inv _
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
h₀ : ContDiff ℝ ⊤ fun w => ‖w‖ ^ 2
⊢ ∀ (x : E), ‖x‖ ^ 2 + 4 ≠ 0
[PROOFSTEP]
intro x
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
h₀ : ContDiff ℝ ⊤ fun w => ‖w‖ ^ 2
x : E
⊢ ‖x‖ ^ 2 + 4 ≠ 0
[PROOFSTEP]
nlinarith
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
h₀ : ContDiff ℝ ⊤ fun w => ‖w‖ ^ 2
h₁ : ContDiff ℝ ⊤ fun w => (‖w‖ ^ 2 + 4)⁻¹
⊢ ContDiff ℝ ⊤ (stereoInvFunAux v)
[PROOFSTEP]
have h₂ : ContDiff ℝ ⊤ fun w => (4 : ℝ) • w + (‖w‖ ^ 2 - 4) • v :=
  by
  refine' (contDiff_const.smul contDiff_id).add _
  refine' (h₀.sub contDiff_const).smul contDiff_const
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
h₀ : ContDiff ℝ ⊤ fun w => ‖w‖ ^ 2
h₁ : ContDiff ℝ ⊤ fun w => (‖w‖ ^ 2 + 4)⁻¹
⊢ ContDiff ℝ ⊤ fun w => 4 • w + (‖w‖ ^ 2 - 4) • v
[PROOFSTEP]
refine' (contDiff_const.smul contDiff_id).add _
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
h₀ : ContDiff ℝ ⊤ fun w => ‖w‖ ^ 2
h₁ : ContDiff ℝ ⊤ fun w => (‖w‖ ^ 2 + 4)⁻¹
⊢ ContDiff ℝ ⊤ fun w => (‖w‖ ^ 2 - 4) • v
[PROOFSTEP]
refine' (h₀.sub contDiff_const).smul contDiff_const
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
h₀ : ContDiff ℝ ⊤ fun w => ‖w‖ ^ 2
h₁ : ContDiff ℝ ⊤ fun w => (‖w‖ ^ 2 + 4)⁻¹
h₂ : ContDiff ℝ ⊤ fun w => 4 • w + (‖w‖ ^ 2 - 4) • v
⊢ ContDiff ℝ ⊤ (stereoInvFunAux v)
[PROOFSTEP]
exact h₁.smul h₂
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
⊢ v ∈ sphere 0 1
[PROOFSTEP]
simp [hv]
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
⊢ stereoInvFun hv w ≠ { val := v, property := (_ : v ∈ sphere 0 1) }
[PROOFSTEP]
refine' Subtype.ne_of_val_ne _
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
⊢ ↑(stereoInvFun hv w) ≠ ↑{ val := v, property := (_ : v ∈ sphere 0 1) }
[PROOFSTEP]
rw [← inner_lt_one_iff_real_of_norm_one _ hv]
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
⊢ inner (↑(stereoInvFun hv w)) v < 1
[PROOFSTEP]
have hw : ⟪v, w⟫_ℝ = 0 := Submodule.mem_orthogonal_singleton_iff_inner_right.mp w.2
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hw : inner v ↑w = 0
⊢ inner (↑(stereoInvFun hv w)) v < 1
[PROOFSTEP]
have hw' : (‖(w : E)‖ ^ 2 + 4)⁻¹ * (‖(w : E)‖ ^ 2 - 4) < 1 :=
  by
  refine' (inv_mul_lt_iff' _).mpr _
  · nlinarith
  linarith
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hw : inner v ↑w = 0
⊢ (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - 4) < 1
[PROOFSTEP]
refine' (inv_mul_lt_iff' _).mpr _
[GOAL]
case refine'_1
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hw : inner v ↑w = 0
⊢ 0 < ‖↑w‖ ^ 2 + 4
[PROOFSTEP]
nlinarith
[GOAL]
case refine'_2
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hw : inner v ↑w = 0
⊢ ‖↑w‖ ^ 2 - 4 < 1 * (‖↑w‖ ^ 2 + 4)
[PROOFSTEP]
linarith
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hw : inner v ↑w = 0
hw' : (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - 4) < 1
⊢ inner (↑(stereoInvFun hv w)) v < 1
[PROOFSTEP]
simpa [real_inner_comm, inner_add_right, inner_smul_right, real_inner_self_eq_norm_mul_norm, hw, hv] using hw'
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
⊢ ‖↑(stereoInvFun hv w)‖ = 1
[PROOFSTEP]
simpa using stereoInvFunAux_mem hv w.2
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
⊢ stereoInvFun hv (stereoToFun v ↑x) = x
[PROOFSTEP]
ext
[GOAL]
case a
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
⊢ ↑(stereoInvFun hv (stereoToFun v ↑x)) = ↑x
[PROOFSTEP]
simp only [stereoToFun_apply, stereoInvFun_apply, smul_add]
  -- name two frequently-occuring quantities and write down their basic properties
[GOAL]
case a
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
⊢ (‖(2 / (1 - ↑(↑(innerSL ℝ) v) ↑x)) • ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x‖ ^ 2 + 4)⁻¹ •
        ↑(4 • (2 / (1 - ↑(↑(innerSL ℝ) v) ↑x)) • ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x) +
      (‖(2 / (1 - ↑(↑(innerSL ℝ) v) ↑x)) • ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x‖ ^ 2 + 4)⁻¹ •
        (‖(2 / (1 - ↑(↑(innerSL ℝ) v) ↑x)) • ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x‖ ^ 2 - 4) • v =
    ↑x
[PROOFSTEP]
set a : ℝ := innerSL _ v x
[GOAL]
case a
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
⊢ (‖(2 / (1 - a)) • ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x‖ ^ 2 + 4)⁻¹ •
        ↑(4 • (2 / (1 - a)) • ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x) +
      (‖(2 / (1 - a)) • ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x‖ ^ 2 + 4)⁻¹ •
        (‖(2 / (1 - a)) • ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x‖ ^ 2 - 4) • v =
    ↑x
[PROOFSTEP]
set y := orthogonalProjection (ℝ ∙ v)ᗮ x
[GOAL]
case a
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
⊢ (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • ↑(4 • (2 / (1 - a)) • y) +
      (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • (‖(2 / (1 - a)) • y‖ ^ 2 - 4) • v =
    ↑x
[PROOFSTEP]
have split : ↑x = a • v + ↑y :=
  by
  convert (orthogonalProjection_add_orthogonalProjection_orthogonal (ℝ ∙ v) x).symm
  exact (orthogonalProjection_unit_singleton ℝ hv x).symm
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
⊢ ↑x = a • v + ↑y
[PROOFSTEP]
convert (orthogonalProjection_add_orthogonalProjection_orthogonal (ℝ ∙ v) x).symm
[GOAL]
case h.e'_3.h.e'_5
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
⊢ a • v = ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) ↑x)
[PROOFSTEP]
exact (orthogonalProjection_unit_singleton ℝ hv x).symm
[GOAL]
case a
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
⊢ (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • ↑(4 • (2 / (1 - a)) • y) +
      (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • (‖(2 / (1 - a)) • y‖ ^ 2 - 4) • v =
    ↑x
[PROOFSTEP]
have hvy : ⟪v, y⟫_ℝ = 0 := Submodule.mem_orthogonal_singleton_iff_inner_right.mp y.2
[GOAL]
case a
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
⊢ (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • ↑(4 • (2 / (1 - a)) • y) +
      (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • (‖(2 / (1 - a)) • y‖ ^ 2 - 4) • v =
    ↑x
[PROOFSTEP]
have pythag : 1 = a ^ 2 + ‖y‖ ^ 2 :=
  by
  have hvy' : ⟪a • v, y⟫_ℝ = 0 := by simp only [inner_smul_left, hvy, mul_zero]
  convert norm_add_sq_eq_norm_sq_add_norm_sq_of_inner_eq_zero _ _ hvy' using 2
    -- Porting note: was simp [← split] but wasn't finding `norm_eq_of_mem_sphere`
  · simp only [norm_eq_of_mem_sphere, Nat.cast_one, mul_one, ← split]
  · simp [norm_smul, hv, ← sq, sq_abs]
  ·
    exact
      sq
        _
          -- Porting note : added to work around cancel_denoms and nlinarith failures
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
⊢ ↑1 = a ^ 2 + ‖y‖ ^ 2
[PROOFSTEP]
have hvy' : ⟪a • v, y⟫_ℝ = 0 := by simp only [inner_smul_left, hvy, mul_zero]
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
⊢ inner (a • v) ↑y = 0
[PROOFSTEP]
simp only [inner_smul_left, hvy, mul_zero]
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
hvy' : inner (a • v) ↑y = 0
⊢ ↑1 = a ^ 2 + ‖y‖ ^ 2
[PROOFSTEP]
convert norm_add_sq_eq_norm_sq_add_norm_sq_of_inner_eq_zero _ _ hvy' using 2
  -- Porting note: was simp [← split] but wasn't finding `norm_eq_of_mem_sphere`
[GOAL]
case h.e'_2
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
hvy' : inner (a • v) ↑y = 0
⊢ ↑1 = ‖a • v + ↑y‖ * ‖a • v + ↑y‖
[PROOFSTEP]
simp only [norm_eq_of_mem_sphere, Nat.cast_one, mul_one, ← split]
[GOAL]
case h.e'_3.h.e'_5
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
hvy' : inner (a • v) ↑y = 0
⊢ a ^ 2 = ‖a • v‖ * ‖a • v‖
[PROOFSTEP]
simp [norm_smul, hv, ← sq, sq_abs]
[GOAL]
case h.e'_3.h.e'_6
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
hvy' : inner (a • v) ↑y = 0
⊢ ‖y‖ ^ 2 = ‖↑y‖ * ‖↑y‖
[PROOFSTEP]
exact
  sq
    _
      -- Porting note : added to work around cancel_denoms and nlinarith failures
[GOAL]
case a
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
⊢ (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • ↑(4 • (2 / (1 - a)) • y) +
      (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • (‖(2 / (1 - a)) • y‖ ^ 2 - 4) • v =
    ↑x
[PROOFSTEP]
have duh : ‖y.val‖ ^ 2 = 1 - a ^ 2 := by rw [← Submodule.coe_norm, pythag];
  ring
    -- two facts which will be helpful for clearing denominators in the main calculation
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
⊢ ‖↑y‖ ^ 2 = ↑1 - a ^ 2
[PROOFSTEP]
rw [← Submodule.coe_norm, pythag]
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
⊢ ‖y‖ ^ 2 = a ^ 2 + ‖y‖ ^ 2 - a ^ 2
[PROOFSTEP]
ring
  -- two facts which will be helpful for clearing denominators in the main calculation
[GOAL]
case a
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
⊢ (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • ↑(4 • (2 / (1 - a)) • y) +
      (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • (‖(2 / (1 - a)) • y‖ ^ 2 - 4) • v =
    ↑x
[PROOFSTEP]
have ha : 1 - a ≠ 0 :=
  by
  have : a < 1 := (inner_lt_one_iff_real_of_norm_one hv (by simp)).mpr hx.symm
  linarith
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
⊢ 1 - a ≠ 0
[PROOFSTEP]
have : a < 1 := (inner_lt_one_iff_real_of_norm_one hv (by simp)).mpr hx.symm
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
⊢ ‖↑x‖ = 1
[PROOFSTEP]
simp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : a < 1
⊢ 1 - a ≠ 0
[PROOFSTEP]
linarith
[GOAL]
case a
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
⊢ (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • ↑(4 • (2 / (1 - a)) • y) +
      (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • (‖(2 / (1 - a)) • y‖ ^ 2 - 4) • v =
    ↑x
[PROOFSTEP]
have : 2 ^ 2 * ‖y‖ ^ 2 + 4 * (1 - a) ^ 2 ≠ 0 := by
  refine' ne_of_gt _
  have : (0 : ℝ) < (1 - a) ^ 2 := sq_pos_of_ne_zero (1 - a) ha
  change 0 < 4 * _ + 4 * _
  nlinarith
    -- the core of the problem is these two algebraic identities:
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
⊢ ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
[PROOFSTEP]
refine' ne_of_gt _
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
⊢ 0 < ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2
[PROOFSTEP]
have : (0 : ℝ) < (1 - a) ^ 2 := sq_pos_of_ne_zero (1 - a) ha
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
this : 0 < (1 - a) ^ 2
⊢ 0 < ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2
[PROOFSTEP]
change 0 < 4 * _ + 4 * _
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
this : 0 < (1 - a) ^ 2
⊢ 0 < 4 * ‖y‖ ^ 2 + 4 * (1 - a) ^ 2
[PROOFSTEP]
nlinarith
  -- the core of the problem is these two algebraic identities:
[GOAL]
case a
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
⊢ (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • ↑(4 • (2 / (1 - a)) • y) +
      (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • (‖(2 / (1 - a)) • y‖ ^ 2 - 4) • v =
    ↑x
[PROOFSTEP]
have h₁ : (2 ^ 2 / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1 := by
  -- Porting note: used to be `field_simp; simp only [Submodule.coe_norm] at *; nlinarith`
      -- but cancel_denoms does not seem to be working and
      -- nlinarith cannot close the goal even if it did
      -- clear_value because field_simp does zeta-reduction (by design?) and is annoying
  clear_value a y
  field_simp
  rw [div_eq_iff, duh]
  · ring
  · apply mul_ne_zero_iff.mpr ⟨?_, ha⟩
    convert this using 2; rw [Submodule.coe_norm]; ring
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
⊢ (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
[PROOFSTEP]
clear_value a y
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
⊢ (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
[PROOFSTEP]
field_simp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
⊢ (1 - a) ^ 2 * 4 * 2 / ((2 ^ 2 * ‖↑y‖ ^ 2 + 4 * (1 - a) ^ 2) * (1 - a)) = 1
[PROOFSTEP]
rw [div_eq_iff, duh]
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
⊢ (1 - a) ^ 2 * 4 * 2 = 1 * ((2 ^ 2 * (↑1 - a ^ 2) + 4 * (1 - a) ^ 2) * (1 - a))
[PROOFSTEP]
ring
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
⊢ (2 ^ 2 * ‖↑y‖ ^ 2 + 4 * (1 - a) ^ 2) * (1 - a) ≠ 0
[PROOFSTEP]
apply mul_ne_zero_iff.mpr ⟨?_, ha⟩
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
⊢ 2 ^ 2 * ‖↑y‖ ^ 2 + 4 * (1 - a) ^ 2 ≠ 0
[PROOFSTEP]
convert this using 2
[GOAL]
case h.e'_2.h.e'_5
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
⊢ 2 ^ 2 * ‖↑y‖ ^ 2 = ↑(2 ^ 2) * ‖y‖ ^ 2
[PROOFSTEP]
rw [Submodule.coe_norm]
[GOAL]
case h.e'_2.h.e'_5
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
⊢ 2 ^ 2 * ‖↑y‖ ^ 2 = ↑(2 ^ 2) * ‖↑y‖ ^ 2
[PROOFSTEP]
ring
[GOAL]
case a
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
⊢ (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • ↑(4 • (2 / (1 - a)) • y) +
      (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • (‖(2 / (1 - a)) • y‖ ^ 2 - 4) • v =
    ↑x
[PROOFSTEP]
have h₂ : (2 ^ 2 / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * (2 ^ 2 / (1 - a) ^ 2 * ‖y‖ ^ 2 - 4) = a := by
  -- Porting note: field_simp is not behaving as in ml3
      -- see porting note above; previous proof used trans and was comparably complicated
  clear_value a y
  field_simp
  rw [div_eq_iff, duh]
  ring_nf
    -- Porting note: shouldn't repeat myself but getting the coercion right is annoying
  apply mul_ne_zero_iff.mpr ⟨?_, ?_⟩
  · convert this using 2; rw [Submodule.coe_norm]; ring
  · apply pow_ne_zero _ ha
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
⊢ (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 - 4) = a
[PROOFSTEP]
clear_value a y
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
⊢ (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 - 4) = a
[PROOFSTEP]
field_simp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
⊢ (1 - a) ^ 2 * (2 ^ 2 * ‖↑y‖ ^ 2 - (1 - a) ^ 2 * 4) / ((2 ^ 2 * ‖↑y‖ ^ 2 + 4 * (1 - a) ^ 2) * (1 - a) ^ 2) = a
[PROOFSTEP]
rw [div_eq_iff, duh]
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
⊢ (1 - a) ^ 2 * (2 ^ 2 * (↑1 - a ^ 2) - (1 - a) ^ 2 * 4) = a * ((2 ^ 2 * (↑1 - a ^ 2) + 4 * (1 - a) ^ 2) * (1 - a) ^ 2)
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
⊢ (2 ^ 2 * ‖↑y‖ ^ 2 + 4 * (1 - a) ^ 2) * (1 - a) ^ 2 ≠ 0
[PROOFSTEP]
ring_nf
  -- Porting note: shouldn't repeat myself but getting the coercion right is annoying
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
⊢ (2 ^ 2 * ‖↑y‖ ^ 2 + 4 * (1 - a) ^ 2) * (1 - a) ^ 2 ≠ 0
[PROOFSTEP]
apply mul_ne_zero_iff.mpr ⟨?_, ?_⟩
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
⊢ 2 ^ 2 * ‖↑y‖ ^ 2 + 4 * (1 - a) ^ 2 ≠ 0
[PROOFSTEP]
convert this using 2
[GOAL]
case h.e'_2.h.e'_5
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
⊢ 2 ^ 2 * ‖↑y‖ ^ 2 = ↑(2 ^ 2) * ‖y‖ ^ 2
[PROOFSTEP]
rw [Submodule.coe_norm]
[GOAL]
case h.e'_2.h.e'_5
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
⊢ 2 ^ 2 * ‖↑y‖ ^ 2 = ↑(2 ^ 2) * ‖↑y‖ ^ 2
[PROOFSTEP]
ring
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
hvy : inner v ↑y = 0
a : ℝ
ha : 1 - a ≠ 0
split : ↑x = a • v + ↑y
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
⊢ (1 - a) ^ 2 ≠ 0
[PROOFSTEP]
apply pow_ne_zero _ ha
[GOAL]
case a
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
h₂ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 - 4) = a
⊢ (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • ↑(4 • (2 / (1 - a)) • y) +
      (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • (‖(2 / (1 - a)) • y‖ ^ 2 - 4) • v =
    ↑x
[PROOFSTEP]
convert congr_arg₂ Add.add (congr_arg (fun t => t • (y : E)) h₁) (congr_arg (fun t => t • v) h₂) using 1
[GOAL]
case h.e'_2
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
h₂ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 - 4) = a
⊢ (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • ↑(4 • (2 / (1 - a)) • y) +
      (‖(2 / (1 - a)) • y‖ ^ 2 + 4)⁻¹ • (‖(2 / (1 - a)) • y‖ ^ 2 - 4) • v =
    Add.add ((fun t => t • ↑y) ((↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a))))
      ((fun t => t • v) ((↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 - 4)))
[PROOFSTEP]
simp [inner_add_right, inner_smul_right, hvy, real_inner_self_eq_norm_mul_norm, hv, mul_smul, mul_pow, Real.norm_eq_abs,
  sq_abs, norm_smul]
  -- Porting note: used to be simp only [split, add_comm] but get maxRec errors
[GOAL]
case h.e'_2
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
h₂ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 - 4) = a
⊢ (2 ^ 2 / (1 - inner v ↑x) ^ 2 * ‖↑x - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) ↑x)‖ ^ 2 + 4)⁻¹ •
        4 • (2 / (1 - inner v ↑x)) • (↑x - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) ↑x)) +
      (2 ^ 2 / (1 - inner v ↑x) ^ 2 * ‖↑x - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) ↑x)‖ ^ 2 + 4)⁻¹ •
        (2 ^ 2 / (1 - inner v ↑x) ^ 2 * ‖↑x - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) ↑x)‖ ^ 2 - 4) • v =
    Add.add
      ((2 ^ 2 / (1 - inner v ↑x) ^ 2 * ‖↑x - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) ↑x)‖ ^ 2 + 4)⁻¹ •
        4 • (2 / (1 - inner v ↑x)) • (↑x - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) ↑x)))
      ((2 ^ 2 / (1 - inner v ↑x) ^ 2 * ‖↑x - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) ↑x)‖ ^ 2 + 4)⁻¹ •
        (2 ^ 2 / (1 - inner v ↑x) ^ 2 * ‖↑x - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) ↑x)‖ ^ 2 - 4) • v)
[PROOFSTEP]
rw [split, add_comm]
[GOAL]
case h.e'_2
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
h₂ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 - 4) = a
⊢ (2 ^ 2 / (1 - inner v (a • v + ↑y)) ^ 2 *
              ‖a • v + ↑y - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) (a • v + ↑y))‖ ^ 2 +
            4)⁻¹ •
        (2 ^ 2 / (1 - inner v (a • v + ↑y)) ^ 2 *
              ‖a • v + ↑y - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) (a • v + ↑y))‖ ^ 2 -
            4) •
          v +
      (2 ^ 2 / (1 - inner v (a • v + ↑y)) ^ 2 *
              ‖a • v + ↑y - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) (a • v + ↑y))‖ ^ 2 +
            4)⁻¹ •
        4 •
          (2 / (1 - inner v (a • v + ↑y))) •
            (a • v + ↑y - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) (a • v + ↑y))) =
    Add.add
      ((2 ^ 2 / (1 - inner v (a • v + ↑y)) ^ 2 *
              ‖a • v + ↑y - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) (a • v + ↑y))‖ ^ 2 +
            4)⁻¹ •
        4 •
          (2 / (1 - inner v (a • v + ↑y))) •
            (a • v + ↑y - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) (a • v + ↑y))))
      ((2 ^ 2 / (1 - inner v (a • v + ↑y)) ^ 2 *
              ‖a • v + ↑y - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) (a • v + ↑y))‖ ^ 2 +
            4)⁻¹ •
        (2 ^ 2 / (1 - inner v (a • v + ↑y)) ^ 2 *
              ‖a • v + ↑y - ↑(↑(orthogonalProjection (Submodule.span ℝ {v})) (a • v + ↑y))‖ ^ 2 -
            4) •
          v)
[PROOFSTEP]
ac_rfl
  -- Porting note: this branch did not exit in ml3
[GOAL]
case h.e'_3
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
h₂ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 - 4) = a
⊢ ↑x = Add.add ((fun t => t • ↑y) 1) ((fun t => t • v) a)
[PROOFSTEP]
rw [split, add_comm]
[GOAL]
case h.e'_3
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
h₂ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 - 4) = a
⊢ ↑y + a • v = Add.add ((fun t => t • ↑y) 1) ((fun t => t • v) a)
[PROOFSTEP]
congr!
[GOAL]
case h.e'_3.h.e'_1
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
h₂ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 - 4) = a
⊢ ↑y = (fun t => t • ↑y) 1
[PROOFSTEP]
dsimp
[GOAL]
case h.e'_3.h.e'_1
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : ↑x ≠ v
a : ℝ := ↑(↑(innerSL ℝ) v) ↑x
y : { x // x ∈ (Submodule.span ℝ {v})ᗮ } := ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x
split : ↑x = a • v + ↑y
hvy : inner v ↑y = 0
pythag : ↑1 = a ^ 2 + ‖y‖ ^ 2
duh : ‖↑y‖ ^ 2 = ↑1 - a ^ 2
ha : 1 - a ≠ 0
this : ↑(2 ^ 2) * ‖y‖ ^ 2 + ↑4 * (1 - a) ^ 2 ≠ 0
h₁ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * 4 * (2 / (1 - a)) = 1
h₂ : (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 + 4)⁻¹ * (↑(2 ^ 2) / (1 - a) ^ 2 * ‖y‖ ^ 2 - 4) = a
⊢ ↑(↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x) = 1 • ↑(↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑x)
[PROOFSTEP]
rw [one_smul]
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
⊢ stereoToFun v ↑(stereoInvFun hv w) = w
[PROOFSTEP]
have : 2 / (1 - (‖(w : E)‖ ^ 2 + 4)⁻¹ * (‖(w : E)‖ ^ 2 - 4)) * (‖(w : E)‖ ^ 2 + 4)⁻¹ * 4 = 1 :=
  by
  have : ‖(w : E)‖ ^ 2 + 4 ≠ 0 := by nlinarith
  have : (4 : ℝ) + 4 ≠ 0 := by nlinarith
  field_simp
  ring
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
⊢ ↑2 / (↑1 - (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - ↑4)) * (‖↑w‖ ^ 2 + 4)⁻¹ * 4 = 1
[PROOFSTEP]
have : ‖(w : E)‖ ^ 2 + 4 ≠ 0 := by nlinarith
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
⊢ ‖↑w‖ ^ 2 + 4 ≠ 0
[PROOFSTEP]
nlinarith
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
this : ‖↑w‖ ^ 2 + 4 ≠ 0
⊢ ↑2 / (↑1 - (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - ↑4)) * (‖↑w‖ ^ 2 + 4)⁻¹ * 4 = 1
[PROOFSTEP]
have : (4 : ℝ) + 4 ≠ 0 := by nlinarith
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
this : ‖↑w‖ ^ 2 + 4 ≠ 0
⊢ 4 + 4 ≠ 0
[PROOFSTEP]
nlinarith
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
this✝ : ‖↑w‖ ^ 2 + 4 ≠ 0
this : 4 + 4 ≠ 0
⊢ ↑2 / (↑1 - (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - ↑4)) * (‖↑w‖ ^ 2 + 4)⁻¹ * 4 = 1
[PROOFSTEP]
field_simp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
this✝ : ‖↑w‖ ^ 2 + 4 ≠ 0
this : 4 + 4 ≠ 0
⊢ 2 * (‖↑w‖ ^ 2 + 4) * 4 = (4 + 4) * (‖↑w‖ ^ 2 + 4)
[PROOFSTEP]
ring
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
this : ↑2 / (↑1 - (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - ↑4)) * (‖↑w‖ ^ 2 + 4)⁻¹ * 4 = 1
⊢ stereoToFun v ↑(stereoInvFun hv w) = w
[PROOFSTEP]
convert congr_arg (· • w) this
[GOAL]
case h.e'_2
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
this : ↑2 / (↑1 - (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - ↑4)) * (‖↑w‖ ^ 2 + 4)⁻¹ * 4 = 1
⊢ stereoToFun v ↑(stereoInvFun hv w) = (↑2 / (↑1 - (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - ↑4)) * (‖↑w‖ ^ 2 + 4)⁻¹ * 4) • w
[PROOFSTEP]
have h₁ : orthogonalProjection (ℝ ∙ v)ᗮ v = 0 := orthogonalProjection_orthogonalComplement_singleton_eq_zero v
[GOAL]
case h.e'_2
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
this : ↑2 / (↑1 - (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - ↑4)) * (‖↑w‖ ^ 2 + 4)⁻¹ * 4 = 1
h₁ : ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) v = 0
⊢ stereoToFun v ↑(stereoInvFun hv w) = (↑2 / (↑1 - (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - ↑4)) * (‖↑w‖ ^ 2 + 4)⁻¹ * 4) • w
[PROOFSTEP]
have h₃ : inner v w = (0 : ℝ) :=
  Submodule.mem_orthogonal_singleton_iff_inner_right.mp
    w.2
      -- Porting note: was innerSL _ and now just inner
[GOAL]
case h.e'_2
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
this : ↑2 / (↑1 - (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - ↑4)) * (‖↑w‖ ^ 2 + 4)⁻¹ * 4 = 1
h₁ : ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) v = 0
h₃ : inner v ↑w = 0
⊢ stereoToFun v ↑(stereoInvFun hv w) = (↑2 / (↑1 - (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - ↑4)) * (‖↑w‖ ^ 2 + 4)⁻¹ * 4) • w
[PROOFSTEP]
have h₄ : inner v v = (1 : ℝ) := by simp [real_inner_self_eq_norm_mul_norm, hv]
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
this : ↑2 / (↑1 - (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - ↑4)) * (‖↑w‖ ^ 2 + 4)⁻¹ * 4 = 1
h₁ : ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) v = 0
h₃ : inner v ↑w = 0
⊢ inner v v = 1
[PROOFSTEP]
simp [real_inner_self_eq_norm_mul_norm, hv]
[GOAL]
case h.e'_2
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
this : ↑2 / (↑1 - (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - ↑4)) * (‖↑w‖ ^ 2 + 4)⁻¹ * 4 = 1
h₁ : ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) v = 0
h₃ : inner v ↑w = 0
h₄ : inner v v = 1
⊢ stereoToFun v ↑(stereoInvFun hv w) = (↑2 / (↑1 - (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - ↑4)) * (‖↑w‖ ^ 2 + 4)⁻¹ * 4) • w
[PROOFSTEP]
simp [h₁, h₃, h₄, ContinuousLinearMap.map_add, ContinuousLinearMap.map_smul, mul_smul]
[GOAL]
case h.e'_3
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }
this : ↑2 / (↑1 - (‖↑w‖ ^ 2 + 4)⁻¹ * (‖↑w‖ ^ 2 - ↑4)) * (‖↑w‖ ^ 2 + 4)⁻¹ * 4 = 1
⊢ w = 1 • w
[PROOFSTEP]
simp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
⊢ v ∈ sphere 0 1
[PROOFSTEP]
simp [hv]
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
⊢ ∀ ⦃x : ↑(sphere 0 1)⦄, x ∈ {{ val := v, property := ?m.709780 }}ᶜ → (stereoToFun v ∘ Subtype.val) x ∈ Set.univ
[PROOFSTEP]
simp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
x : ↑(sphere 0 1)
hx : x ∈ {{ val := v, property := ?m.709780 }}ᶜ
h : ↑x = v
⊢ x ∈ {{ val := v, property := ?m.709780 }}
[PROOFSTEP]
rw [← h] at hv
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv✝ : ‖v‖ = 1
x : ↑(sphere 0 1)
hv : ‖↑x‖ = 1
hx : x ∈ {{ val := v, property := ?m.709780 }}ᶜ
h : ↑x = v
⊢ x ∈ {{ val := v, property := ?m.709780 }}
[PROOFSTEP]
apply Subtype.ext
[GOAL]
case a
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv✝ : ‖v‖ = 1
x : ↑(sphere 0 1)
hv : ‖↑x‖ = 1
hx : x ∈ {{ val := v, property := ?m.709780 }}ᶜ
h : ↑x = v
⊢ ↑x = ↑{ val := v, property := ?m.709780 }
[PROOFSTEP]
dsimp
[GOAL]
case a
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv✝ : ‖v‖ = 1
x : ↑(sphere 0 1)
hv : ‖↑x‖ = 1
hx : x ∈ {{ val := v, property := ?m.709780 }}ᶜ
h : ↑x = v
⊢ ↑x = v
[PROOFSTEP]
exact h
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : ↑(sphere 0 1)
h :
  w ∈
    { toFun := stereoToFun v ∘ Subtype.val, invFun := stereoInvFun hv, source := {{ val := v, property := ?m.709780 }}ᶜ,
        target := Set.univ,
        map_source' :=
          (_ :
            ∀ (a : ↑(sphere 0 1)),
              a ∈ {{ val := v, property := ?m.709780 }}ᶜ →
                (2 / (1 - inner v ↑a)) • ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑a ∈ Set.univ),
        map_target' :=
          (_ :
            ∀ {w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }},
              w ∈ Set.univ → stereoInvFun hv w ∈ {{ val := v, property := ?m.709780 }} → False),
        left_inv' :=
          (_ :
            ∀ (x : ↑(sphere 0 1)), x ∈ {{ val := v, property := ?m.709780 }}ᶜ → stereoInvFun hv (stereoToFun v ↑x) = x),
        right_inv' :=
          (_ :
            ∀ (w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }),
              w ∈ Set.univ → stereoToFun v ↑(stereoInvFun hv w) = w) }.source
⊢ ↑w ∈ {x | ↑(↑(innerSL ℝ) v) x ≠ 1}
[PROOFSTEP]
dsimp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : ↑(sphere 0 1)
h :
  w ∈
    { toFun := stereoToFun v ∘ Subtype.val, invFun := stereoInvFun hv, source := {{ val := v, property := ?m.709780 }}ᶜ,
        target := Set.univ,
        map_source' :=
          (_ :
            ∀ (a : ↑(sphere 0 1)),
              a ∈ {{ val := v, property := ?m.709780 }}ᶜ →
                (2 / (1 - inner v ↑a)) • ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑a ∈ Set.univ),
        map_target' :=
          (_ :
            ∀ {w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }},
              w ∈ Set.univ → stereoInvFun hv w ∈ {{ val := v, property := ?m.709780 }} → False),
        left_inv' :=
          (_ :
            ∀ (x : ↑(sphere 0 1)), x ∈ {{ val := v, property := ?m.709780 }}ᶜ → stereoInvFun hv (stereoToFun v ↑x) = x),
        right_inv' :=
          (_ :
            ∀ (w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }),
              w ∈ Set.univ → stereoToFun v ↑(stereoInvFun hv w) = w) }.source
⊢ ¬inner v ↑w = 1
[PROOFSTEP]
exact h ∘ Subtype.ext ∘ Eq.symm ∘ (inner_eq_one_iff_of_norm_one hv (by simp)).mp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
w : ↑(sphere 0 1)
h :
  w ∈
    { toFun := stereoToFun v ∘ Subtype.val, invFun := stereoInvFun hv, source := {{ val := v, property := ?m.709780 }}ᶜ,
        target := Set.univ,
        map_source' :=
          (_ :
            ∀ (a : ↑(sphere 0 1)),
              a ∈ {{ val := v, property := ?m.709780 }}ᶜ →
                (2 / (1 - inner v ↑a)) • ↑(orthogonalProjection (Submodule.span ℝ {v})ᗮ) ↑a ∈ Set.univ),
        map_target' :=
          (_ :
            ∀ {w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }},
              w ∈ Set.univ → stereoInvFun hv w ∈ {{ val := v, property := ?m.709780 }} → False),
        left_inv' :=
          (_ :
            ∀ (x : ↑(sphere 0 1)), x ∈ {{ val := v, property := ?m.709780 }}ᶜ → stereoInvFun hv (stereoToFun v ↑x) = x),
        right_inv' :=
          (_ :
            ∀ (w : { x // x ∈ (Submodule.span ℝ {v})ᗮ }),
              w ∈ Set.univ → stereoToFun v ↑(stereoInvFun hv w) = w) }.source
⊢ ‖↑w‖ = 1
[PROOFSTEP]
simp
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v : E
hv : ‖v‖ = 1
⊢ v ∈ sphere 0 1
[PROOFSTEP]
simp [hv]
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ : E
v : ↑(sphere 0 1)
⊢ ↑(stereographic (_ : ‖↑v‖ = 1)) (-v) = 0
[PROOFSTEP]
simp [stereographic_apply, orthogonalProjection_orthogonalComplement_singleton_eq_zero]
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ : E
v : ↑(sphere 0 1)
⊢ ↑(stereographic (_ : ‖↑(-v)‖ = 1)) v = 0
[PROOFSTEP]
convert stereographic_apply_neg (-v)
[GOAL]
case h.e'_2.h.e'_6
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ : E
v : ↑(sphere 0 1)
⊢ v = - -v
[PROOFSTEP]
ext1
[GOAL]
case h.e'_2.h.e'_6.a
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
v✝ : E
v : ↑(sphere 0 1)
⊢ ↑v = ↑(- -v)
[PROOFSTEP]
simp
[GOAL]
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
⊢ (stereographic' n v).toLocalEquiv.source = {v}ᶜ
[PROOFSTEP]
simp [stereographic']
[GOAL]
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
⊢ (stereographic' n v).toLocalEquiv.target = Set.univ
[PROOFSTEP]
simp [stereographic']
[GOAL]
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
⊢ v ∈ ((fun v => stereographic' n (-v)) v).source
[PROOFSTEP]
simpa using ne_neg_of_mem_unit_sphere ℝ v
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
u v : ↑(sphere 0 1)
⊢ u = v ↔ inner ↑u ↑v = 1
[PROOFSTEP]
simp [Subtype.ext_iff, inner_eq_one_iff_of_norm_one]
[GOAL]
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
x : EuclideanSpace ℝ (Fin n)
⊢ ↑(↑(LocalHomeomorph.symm (stereographic' n v)) x) =
    let U := (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v ≠ 0)).repr;
    (‖↑(↑(LinearIsometryEquiv.symm U) x)‖ ^ 2 + 4)⁻¹ • 4 • ↑(↑(LinearIsometryEquiv.symm U) x) +
      (‖↑(↑(LinearIsometryEquiv.symm U) x)‖ ^ 2 + 4)⁻¹ • (‖↑(↑(LinearIsometryEquiv.symm U) x)‖ ^ 2 - 4) • ↑v
[PROOFSTEP]
simp [real_inner_comm, stereographic, stereographic', ← Submodule.coe_norm]
[GOAL]
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
⊢ ∀ (e e' : LocalHomeomorph (↑(sphere 0 1)) (EuclideanSpace ℝ (Fin n))),
    e ∈ atlas (EuclideanSpace ℝ (Fin n)) ↑(sphere 0 1) →
      e' ∈ atlas (EuclideanSpace ℝ (Fin n)) ↑(sphere 0 1) →
        ContDiffOn ℝ ⊤
          (↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ∘
            ↑(LocalHomeomorph.symm e ≫ₕ e') ∘ ↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))))
          (↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ⁻¹'
              (LocalHomeomorph.symm e ≫ₕ e').toLocalEquiv.source ∩
            Set.range ↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)))
[PROOFSTEP]
rintro _ _ ⟨v, rfl⟩ ⟨v', rfl⟩
[GOAL]
case intro.intro
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v v' : ↑(sphere 0 1)
⊢ ContDiffOn ℝ ⊤
    (↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ∘
      ↑(LocalHomeomorph.symm (stereographic' n v) ≫ₕ stereographic' n v') ∘
        ↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))))
    (↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ⁻¹'
        (LocalHomeomorph.symm (stereographic' n v) ≫ₕ stereographic' n v').toLocalEquiv.source ∩
      Set.range ↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)))
[PROOFSTEP]
let U :=
  (
      -- Removed type ascription, and this helped for some reason with timeout issues?OrthonormalBasis.fromOrthogonalSpanSingleton
      (𝕜 := ℝ) n (ne_zero_of_mem_unit_sphere v)).repr
[GOAL]
case intro.intro
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v v' : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑v})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v ≠ 0)).repr
⊢ ContDiffOn ℝ ⊤
    (↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ∘
      ↑(LocalHomeomorph.symm (stereographic' n v) ≫ₕ stereographic' n v') ∘
        ↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))))
    (↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ⁻¹'
        (LocalHomeomorph.symm (stereographic' n v) ≫ₕ stereographic' n v').toLocalEquiv.source ∩
      Set.range ↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)))
[PROOFSTEP]
let U' :=
  (
      -- Removed type ascription, and this helped for some reason with timeout issues?OrthonormalBasis.fromOrthogonalSpanSingleton
      (𝕜 := ℝ) n (ne_zero_of_mem_unit_sphere v')).repr
[GOAL]
case intro.intro
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v v' : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑v})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v ≠ 0)).repr
U' : { x // x ∈ (Submodule.span ℝ {↑v'})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v' ≠ 0)).repr
⊢ ContDiffOn ℝ ⊤
    (↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ∘
      ↑(LocalHomeomorph.symm (stereographic' n v) ≫ₕ stereographic' n v') ∘
        ↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))))
    (↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ⁻¹'
        (LocalHomeomorph.symm (stereographic' n v) ≫ₕ stereographic' n v').toLocalEquiv.source ∩
      Set.range ↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)))
[PROOFSTEP]
have := findim (E := E) n
[GOAL]
case intro.intro
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v v' : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑v})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v ≠ 0)).repr
U' : { x // x ∈ (Submodule.span ℝ {↑v'})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v' ≠ 0)).repr
this : FiniteDimensional ℝ E
⊢ ContDiffOn ℝ ⊤
    (↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ∘
      ↑(LocalHomeomorph.symm (stereographic' n v) ≫ₕ stereographic' n v') ∘
        ↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))))
    (↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ⁻¹'
        (LocalHomeomorph.symm (stereographic' n v) ≫ₕ stereographic' n v').toLocalEquiv.source ∩
      Set.range ↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)))
[PROOFSTEP]
have H₁ := U'.contDiff.comp_contDiffOn contDiffOn_stereoToFun
[GOAL]
case intro.intro
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v v' : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑v})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v ≠ 0)).repr
U' : { x // x ∈ (Submodule.span ℝ {↑v'})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v' ≠ 0)).repr
this : FiniteDimensional ℝ E
H₁ : ContDiffOn ℝ ⊤ (↑U' ∘ stereoToFun ↑v') {x | ↑(↑(innerSL ℝ) ↑v') x ≠ 1}
⊢ ContDiffOn ℝ ⊤
    (↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ∘
      ↑(LocalHomeomorph.symm (stereographic' n v) ≫ₕ stereographic' n v') ∘
        ↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))))
    (↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ⁻¹'
        (LocalHomeomorph.symm (stereographic' n v) ≫ₕ stereographic' n v').toLocalEquiv.source ∩
      Set.range ↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)))
[PROOFSTEP]
have H₂ := (contDiff_stereoInvFunAux (v := v.val) |>.comp (ℝ ∙ (v : E))ᗮ.subtypeL.contDiff).comp U.symm.contDiff
[GOAL]
case intro.intro
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v v' : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑v})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v ≠ 0)).repr
U' : { x // x ∈ (Submodule.span ℝ {↑v'})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v' ≠ 0)).repr
this : FiniteDimensional ℝ E
H₁ : ContDiffOn ℝ ⊤ (↑U' ∘ stereoToFun ↑v') {x | ↑(↑(innerSL ℝ) ↑v') x ≠ 1}
H₂ :
  ContDiff ℝ ⊤ ((stereoInvFunAux ↑v ∘ ↑(Submodule.subtypeL (Submodule.span ℝ {↑v})ᗮ)) ∘ ↑(LinearIsometryEquiv.symm U))
⊢ ContDiffOn ℝ ⊤
    (↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ∘
      ↑(LocalHomeomorph.symm (stereographic' n v) ≫ₕ stereographic' n v') ∘
        ↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))))
    (↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ⁻¹'
        (LocalHomeomorph.symm (stereographic' n v) ≫ₕ stereographic' n v').toLocalEquiv.source ∩
      Set.range ↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)))
[PROOFSTEP]
convert H₁.comp' (H₂.contDiffOn : ContDiffOn ℝ ⊤ _ Set.univ) using 1
  -- -- squeezed from `ext, simp [sphere_ext_iff, stereographic'_symm_apply, real_inner_comm]`
[GOAL]
case h.e'_11
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v v' : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑v})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v ≠ 0)).repr
U' : { x // x ∈ (Submodule.span ℝ {↑v'})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v' ≠ 0)).repr
this : FiniteDimensional ℝ E
H₁ : ContDiffOn ℝ ⊤ (↑U' ∘ stereoToFun ↑v') {x | ↑(↑(innerSL ℝ) ↑v') x ≠ 1}
H₂ :
  ContDiff ℝ ⊤ ((stereoInvFunAux ↑v ∘ ↑(Submodule.subtypeL (Submodule.span ℝ {↑v})ᗮ)) ∘ ↑(LinearIsometryEquiv.symm U))
⊢ ↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ⁻¹'
        (LocalHomeomorph.symm (stereographic' n v) ≫ₕ stereographic' n v').toLocalEquiv.source ∩
      Set.range ↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)) =
    Set.univ ∩
      (stereoInvFunAux ↑v ∘ ↑(Submodule.subtypeL (Submodule.span ℝ {↑v})ᗮ)) ∘ ↑(LinearIsometryEquiv.symm U) ⁻¹'
        {x | ↑(↑(innerSL ℝ) ↑v') x ≠ 1}
[PROOFSTEP]
simp only [LocalHomeomorph.trans_toLocalEquiv, LocalHomeomorph.symm_toLocalEquiv, LocalEquiv.trans_source,
  LocalEquiv.symm_source, stereographic'_target, stereographic'_source]
[GOAL]
case h.e'_11
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v v' : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑v})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v ≠ 0)).repr
U' : { x // x ∈ (Submodule.span ℝ {↑v'})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v' ≠ 0)).repr
this : FiniteDimensional ℝ E
H₁ : ContDiffOn ℝ ⊤ (↑U' ∘ stereoToFun ↑v') {x | ↑(↑(innerSL ℝ) ↑v') x ≠ 1}
H₂ :
  ContDiff ℝ ⊤ ((stereoInvFunAux ↑v ∘ ↑(Submodule.subtypeL (Submodule.span ℝ {↑v})ᗮ)) ∘ ↑(LinearIsometryEquiv.symm U))
⊢ ↑(ModelWithCorners.symm 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ⁻¹'
        (Set.univ ∩ ↑(LocalEquiv.symm (stereographic' n v).toLocalEquiv) ⁻¹' {v'}ᶜ) ∩
      Set.range ↑𝓘(ℝ, EuclideanSpace ℝ (Fin n)) =
    Set.univ ∩
      (stereoInvFunAux ↑v ∘ ↑(Submodule.subtypeL (Submodule.span ℝ {↑v})ᗮ)) ∘
          ↑(LinearIsometryEquiv.symm (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v ≠ 0)).repr) ⁻¹'
        {x | ↑(↑(innerSL ℝ) ↑v') x ≠ 1}
[PROOFSTEP]
simp only [modelWithCornersSelf_coe, modelWithCornersSelf_coe_symm, Set.preimage_id, Set.range_id, Set.inter_univ,
  Set.univ_inter, Set.compl_singleton_eq, Set.preimage_setOf_eq]
[GOAL]
case h.e'_11
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v v' : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑v})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v ≠ 0)).repr
U' : { x // x ∈ (Submodule.span ℝ {↑v'})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v' ≠ 0)).repr
this : FiniteDimensional ℝ E
H₁ : ContDiffOn ℝ ⊤ (↑U' ∘ stereoToFun ↑v') {x | ↑(↑(innerSL ℝ) ↑v') x ≠ 1}
H₂ :
  ContDiff ℝ ⊤ ((stereoInvFunAux ↑v ∘ ↑(Submodule.subtypeL (Submodule.span ℝ {↑v})ᗮ)) ∘ ↑(LinearIsometryEquiv.symm U))
⊢ {a | ↑(LocalEquiv.symm (stereographic' n v).toLocalEquiv) (id a) ≠ v'} =
    {a |
      ↑(↑(innerSL ℝ) ↑v')
          (((stereoInvFunAux ↑v ∘ ↑(Submodule.subtypeL (Submodule.span ℝ {↑v})ᗮ)) ∘
              ↑(LinearIsometryEquiv.symm (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v ≠ 0)).repr))
            a) ≠
        1}
[PROOFSTEP]
simp only [id.def, comp_apply, Submodule.subtypeL_apply, LocalHomeomorph.coe_coe_symm, innerSL_apply, Ne.def,
  sphere_ext_iff, real_inner_comm (v' : E)]
[GOAL]
case h.e'_11
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v v' : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑v})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v ≠ 0)).repr
U' : { x // x ∈ (Submodule.span ℝ {↑v'})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v' ≠ 0)).repr
this : FiniteDimensional ℝ E
H₁ : ContDiffOn ℝ ⊤ (↑U' ∘ stereoToFun ↑v') {x | ↑(↑(innerSL ℝ) ↑v') x ≠ 1}
H₂ :
  ContDiff ℝ ⊤ ((stereoInvFunAux ↑v ∘ ↑(Submodule.subtypeL (Submodule.span ℝ {↑v})ᗮ)) ∘ ↑(LinearIsometryEquiv.symm U))
⊢ {a | ¬inner ↑v' ↑(↑(LocalHomeomorph.symm (stereographic' n v)) a) = 1} =
    {a |
      ¬inner (↑v')
            (stereoInvFunAux ↑v
              ↑(↑(LinearIsometryEquiv.symm (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑v ≠ 0)).repr) a)) =
          1}
[PROOFSTEP]
rfl
[GOAL]
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
⊢ ContMDiff 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) 𝓘(ℝ, E) ⊤ Subtype.val
[PROOFSTEP]
have := smoothMfldWithCorners (E := E) (n := n)
[GOAL]
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
this : SmoothManifoldWithCorners 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ↑(sphere 0 1)
⊢ ContMDiff 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) 𝓘(ℝ, E) ⊤ Subtype.val
[PROOFSTEP]
rw [contMDiff_iff]
[GOAL]
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
this : SmoothManifoldWithCorners 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ↑(sphere 0 1)
⊢ Continuous Subtype.val ∧
    ∀ (x : { x // x ∈ sphere 0 1 }) (y : E),
      ContDiffOn ℝ ⊤
        (↑(extChartAt 𝓘(ℝ, E) y) ∘ Subtype.val ∘ ↑(LocalEquiv.symm (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) x)))
        ((extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) x).target ∩
          ↑(LocalEquiv.symm (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) x)) ⁻¹'
            (Subtype.val ⁻¹' (extChartAt 𝓘(ℝ, E) y).source))
[PROOFSTEP]
constructor
[GOAL]
case left
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
this : SmoothManifoldWithCorners 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ↑(sphere 0 1)
⊢ Continuous Subtype.val
[PROOFSTEP]
exact continuous_subtype_val
[GOAL]
case right
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
this : SmoothManifoldWithCorners 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ↑(sphere 0 1)
⊢ ∀ (x : { x // x ∈ sphere 0 1 }) (y : E),
    ContDiffOn ℝ ⊤
      (↑(extChartAt 𝓘(ℝ, E) y) ∘ Subtype.val ∘ ↑(LocalEquiv.symm (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) x)))
      ((extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) x).target ∩
        ↑(LocalEquiv.symm (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) x)) ⁻¹'
          (Subtype.val ⁻¹' (extChartAt 𝓘(ℝ, E) y).source))
[PROOFSTEP]
intro v _
[GOAL]
case right
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
this : SmoothManifoldWithCorners 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ↑(sphere 0 1)
v : { x // x ∈ sphere 0 1 }
y✝ : E
⊢ ContDiffOn ℝ ⊤
    (↑(extChartAt 𝓘(ℝ, E) y✝) ∘ Subtype.val ∘ ↑(LocalEquiv.symm (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v)))
    ((extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v).target ∩
      ↑(LocalEquiv.symm (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v)) ⁻¹'
        (Subtype.val ⁻¹' (extChartAt 𝓘(ℝ, E) y✝).source))
[PROOFSTEP]
let U : _ ≃ₗᵢ[ℝ] _ :=
  (
      -- Again, partially removing type ascription...OrthonormalBasis.fromOrthogonalSpanSingleton n
      (ne_zero_of_mem_unit_sphere (-v))).repr
[GOAL]
case right
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : InnerProductSpace ℝ E
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
this : SmoothManifoldWithCorners 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ↑(sphere 0 1)
v : { x // x ∈ sphere 0 1 }
y✝ : E
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
⊢ ContDiffOn ℝ ⊤
    (↑(extChartAt 𝓘(ℝ, E) y✝) ∘ Subtype.val ∘ ↑(LocalEquiv.symm (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v)))
    ((extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v).target ∩
      ↑(LocalEquiv.symm (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v)) ⁻¹'
        (Subtype.val ⁻¹' (extChartAt 𝓘(ℝ, E) y✝).source))
[PROOFSTEP]
exact ((contDiff_stereoInvFunAux.comp (ℝ ∙ (-v : E))ᗮ.subtypeL.contDiff).comp U.symm.contDiff).contDiffOn
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
⊢ ContMDiff I 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) m (Set.codRestrict (fun x => f x) (sphere 0 1) hf')
[PROOFSTEP]
rw [contMDiff_iff_target]
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
⊢ Continuous (Set.codRestrict (fun x => f x) (sphere 0 1) hf') ∧
    ∀ (y : ↑(sphere 0 1)),
      ContMDiffOn I 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) m
        (↑(extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) y) ∘ Set.codRestrict (fun x => f x) (sphere 0 1) hf')
        (Set.codRestrict (fun x => f x) (sphere 0 1) hf' ⁻¹' (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) y).source)
[PROOFSTEP]
refine' ⟨continuous_induced_rng.2 hf.continuous, _⟩
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
⊢ ∀ (y : ↑(sphere 0 1)),
    ContMDiffOn I 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) m
      (↑(extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) y) ∘ Set.codRestrict (fun x => f x) (sphere 0 1) hf')
      (Set.codRestrict (fun x => f x) (sphere 0 1) hf' ⁻¹' (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) y).source)
[PROOFSTEP]
intro v
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
v : ↑(sphere 0 1)
⊢ ContMDiffOn I 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) m
    (↑(extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v) ∘ Set.codRestrict (fun x => f x) (sphere 0 1) hf')
    (Set.codRestrict (fun x => f x) (sphere 0 1) hf' ⁻¹' (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v).source)
[PROOFSTEP]
let U : _ ≃ₗᵢ[ℝ] _ :=
  (
      -- Again, partially removing type ascription... Weird that this helps!OrthonormalBasis.fromOrthogonalSpanSingleton
      n (ne_zero_of_mem_unit_sphere (-v))).repr
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
⊢ ContMDiffOn I 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) m
    (↑(extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v) ∘ Set.codRestrict (fun x => f x) (sphere 0 1) hf')
    (Set.codRestrict (fun x => f x) (sphere 0 1) hf' ⁻¹' (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v).source)
[PROOFSTEP]
have h : ContDiffOn ℝ ⊤ _ Set.univ := U.contDiff.contDiffOn
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
h : ContDiffOn ℝ ⊤ (↑U) Set.univ
⊢ ContMDiffOn I 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) m
    (↑(extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v) ∘ Set.codRestrict (fun x => f x) (sphere 0 1) hf')
    (Set.codRestrict (fun x => f x) (sphere 0 1) hf' ⁻¹' (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v).source)
[PROOFSTEP]
have H₁ := (h.comp' contDiffOn_stereoToFun).contMDiffOn
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
h : ContDiffOn ℝ ⊤ (↑U) Set.univ
H₁ :
  ContMDiffOn 𝓘(ℝ, E) 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ⊤ (↑U ∘ stereoToFun ↑(-v))
    ({x | ↑(↑(innerSL ℝ) ↑(-v)) x ≠ 1} ∩ stereoToFun ↑(-v) ⁻¹' Set.univ)
⊢ ContMDiffOn I 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) m
    (↑(extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v) ∘ Set.codRestrict (fun x => f x) (sphere 0 1) hf')
    (Set.codRestrict (fun x => f x) (sphere 0 1) hf' ⁻¹' (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v).source)
[PROOFSTEP]
have H₂ : ContMDiffOn _ _ _ _ Set.univ := hf.contMDiffOn
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
h : ContDiffOn ℝ ⊤ (↑U) Set.univ
H₁ :
  ContMDiffOn 𝓘(ℝ, E) 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ⊤ (↑U ∘ stereoToFun ↑(-v))
    ({x | ↑(↑(innerSL ℝ) ↑(-v)) x ≠ 1} ∩ stereoToFun ↑(-v) ⁻¹' Set.univ)
H₂ : ContMDiffOn I 𝓘(ℝ, E) m f Set.univ
⊢ ContMDiffOn I 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) m
    (↑(extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v) ∘ Set.codRestrict (fun x => f x) (sphere 0 1) hf')
    (Set.codRestrict (fun x => f x) (sphere 0 1) hf' ⁻¹' (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v).source)
[PROOFSTEP]
convert (H₁.of_le le_top).comp' H₂ using 1
[GOAL]
case h.e'_23
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
h : ContDiffOn ℝ ⊤ (↑U) Set.univ
H₁ :
  ContMDiffOn 𝓘(ℝ, E) 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ⊤ (↑U ∘ stereoToFun ↑(-v))
    ({x | ↑(↑(innerSL ℝ) ↑(-v)) x ≠ 1} ∩ stereoToFun ↑(-v) ⁻¹' Set.univ)
H₂ : ContMDiffOn I 𝓘(ℝ, E) m f Set.univ
⊢ Set.codRestrict (fun x => f x) (sphere 0 1) hf' ⁻¹' (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v).source =
    Set.univ ∩ f ⁻¹' ({x | ↑(↑(innerSL ℝ) ↑(-v)) x ≠ 1} ∩ stereoToFun ↑(-v) ⁻¹' Set.univ)
[PROOFSTEP]
ext x
[GOAL]
case h.e'_23.h
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
h : ContDiffOn ℝ ⊤ (↑U) Set.univ
H₁ :
  ContMDiffOn 𝓘(ℝ, E) 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ⊤ (↑U ∘ stereoToFun ↑(-v))
    ({x | ↑(↑(innerSL ℝ) ↑(-v)) x ≠ 1} ∩ stereoToFun ↑(-v) ⁻¹' Set.univ)
H₂ : ContMDiffOn I 𝓘(ℝ, E) m f Set.univ
x : M
⊢ x ∈ Set.codRestrict (fun x => f x) (sphere 0 1) hf' ⁻¹' (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v).source ↔
    x ∈ Set.univ ∩ f ⁻¹' ({x | ↑(↑(innerSL ℝ) ↑(-v)) x ≠ 1} ∩ stereoToFun ↑(-v) ⁻¹' Set.univ)
[PROOFSTEP]
have hfxv : f x = -↑v ↔ ⟪f x, -↑v⟫_ℝ = 1 :=
  by
  have hfx : ‖f x‖ = 1 := by simpa using hf' x
  rw [inner_eq_one_iff_of_norm_one hfx]
  exact
    norm_eq_of_mem_sphere
      (-v)
        -- Porting note: unfold more
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
h : ContDiffOn ℝ ⊤ (↑U) Set.univ
H₁ :
  ContMDiffOn 𝓘(ℝ, E) 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ⊤ (↑U ∘ stereoToFun ↑(-v))
    ({x | ↑(↑(innerSL ℝ) ↑(-v)) x ≠ 1} ∩ stereoToFun ↑(-v) ⁻¹' Set.univ)
H₂ : ContMDiffOn I 𝓘(ℝ, E) m f Set.univ
x : M
⊢ f x = -↑v ↔ inner (f x) (-↑v) = 1
[PROOFSTEP]
have hfx : ‖f x‖ = 1 := by simpa using hf' x
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
h : ContDiffOn ℝ ⊤ (↑U) Set.univ
H₁ :
  ContMDiffOn 𝓘(ℝ, E) 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ⊤ (↑U ∘ stereoToFun ↑(-v))
    ({x | ↑(↑(innerSL ℝ) ↑(-v)) x ≠ 1} ∩ stereoToFun ↑(-v) ⁻¹' Set.univ)
H₂ : ContMDiffOn I 𝓘(ℝ, E) m f Set.univ
x : M
⊢ ‖f x‖ = 1
[PROOFSTEP]
simpa using hf' x
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
h : ContDiffOn ℝ ⊤ (↑U) Set.univ
H₁ :
  ContMDiffOn 𝓘(ℝ, E) 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ⊤ (↑U ∘ stereoToFun ↑(-v))
    ({x | ↑(↑(innerSL ℝ) ↑(-v)) x ≠ 1} ∩ stereoToFun ↑(-v) ⁻¹' Set.univ)
H₂ : ContMDiffOn I 𝓘(ℝ, E) m f Set.univ
x : M
hfx : ‖f x‖ = 1
⊢ f x = -↑v ↔ inner (f x) (-↑v) = 1
[PROOFSTEP]
rw [inner_eq_one_iff_of_norm_one hfx]
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
h : ContDiffOn ℝ ⊤ (↑U) Set.univ
H₁ :
  ContMDiffOn 𝓘(ℝ, E) 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ⊤ (↑U ∘ stereoToFun ↑(-v))
    ({x | ↑(↑(innerSL ℝ) ↑(-v)) x ≠ 1} ∩ stereoToFun ↑(-v) ⁻¹' Set.univ)
H₂ : ContMDiffOn I 𝓘(ℝ, E) m f Set.univ
x : M
hfx : ‖f x‖ = 1
⊢ ‖-↑v‖ = 1
[PROOFSTEP]
exact
  norm_eq_of_mem_sphere
    (-v)
      -- Porting note: unfold more
[GOAL]
case h.e'_23.h
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
h : ContDiffOn ℝ ⊤ (↑U) Set.univ
H₁ :
  ContMDiffOn 𝓘(ℝ, E) 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ⊤ (↑U ∘ stereoToFun ↑(-v))
    ({x | ↑(↑(innerSL ℝ) ↑(-v)) x ≠ 1} ∩ stereoToFun ↑(-v) ⁻¹' Set.univ)
H₂ : ContMDiffOn I 𝓘(ℝ, E) m f Set.univ
x : M
hfxv : f x = -↑v ↔ inner (f x) (-↑v) = 1
⊢ x ∈ Set.codRestrict (fun x => f x) (sphere 0 1) hf' ⁻¹' (extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v).source ↔
    x ∈ Set.univ ∩ f ⁻¹' ({x | ↑(↑(innerSL ℝ) ↑(-v)) x ≠ 1} ∩ stereoToFun ↑(-v) ⁻¹' Set.univ)
[PROOFSTEP]
dsimp [chartAt, Set.codRestrict, ChartedSpace.chartAt]
[GOAL]
case h.e'_23.h
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
m : ℕ∞
f : M → E
hf : ContMDiff I 𝓘(ℝ, E) m f
hf' : ∀ (x : M), f x ∈ sphere 0 1
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
h : ContDiffOn ℝ ⊤ (↑U) Set.univ
H₁ :
  ContMDiffOn 𝓘(ℝ, E) 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ⊤ (↑U ∘ stereoToFun ↑(-v))
    ({x | ↑(↑(innerSL ℝ) ↑(-v)) x ≠ 1} ∩ stereoToFun ↑(-v) ⁻¹' Set.univ)
H₂ : ContMDiffOn I 𝓘(ℝ, E) m f Set.univ
x : M
hfxv : f x = -↑v ↔ inner (f x) (-↑v) = 1
⊢ x ∈
      (fun x => { val := f x, property := (_ : f x ∈ sphere 0 1) }) ⁻¹' (stereographic' n (-v)).toLocalEquiv.source ∩
        Set.univ ↔
    x ∈ Set.univ ∩ ({a | ¬inner (-↑v) (f a) = 1} ∩ Set.univ)
[PROOFSTEP]
simp [not_iff_not, Subtype.ext_iff, hfxv, real_inner_comm]
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
⊢ ContMDiff 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) ⊤ fun x => -x
[PROOFSTEP]
apply ContMDiff.codRestrict_sphere
[GOAL]
case hf
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
⊢ ContMDiff 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) 𝓘(ℝ, E) ⊤ fun x => -↑x
[PROOFSTEP]
apply contDiff_neg.contMDiff.comp _
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
⊢ ContMDiff 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) 𝓘(ℝ, E) ⊤ fun x => ↑x
[PROOFSTEP]
exact contMDiff_coe_sphere
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
⊢ LinearMap.range (mfderiv 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) 𝓘(ℝ, E) Subtype.val v) = (Submodule.span ℝ {↑v})ᗮ
[PROOFSTEP]
rw [((contMDiff_coe_sphere v).mdifferentiableAt le_top).mfderiv]
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
⊢ LinearMap.range
      (fderivWithin ℝ (writtenInExtChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) 𝓘(ℝ, E) v Subtype.val)
        (Set.range ↑𝓘(ℝ, EuclideanSpace ℝ (Fin n))) (↑(extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v) v)) =
    (Submodule.span ℝ {↑v})ᗮ
[PROOFSTEP]
dsimp [chartAt]
  -- rw [LinearIsometryEquiv.toHomeomorph_symm]
    -- rw [←LinearIsometryEquiv.coe_toHomeomorph]
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
⊢ LinearMap.range
      (fderivWithin ℝ (↑(ChartedSpace.chartAt ↑v) ∘ Subtype.val ∘ ↑(LocalHomeomorph.symm (ChartedSpace.chartAt v)))
        (Set.range id) (↑(ChartedSpace.chartAt v) v)) =
    (Submodule.span ℝ {↑v})ᗮ
[PROOFSTEP]
simp only [chartAt, stereographic_neg_apply, fderivWithin_univ, LinearIsometryEquiv.toHomeomorph_symm,
  LinearIsometryEquiv.coe_toHomeomorph, LinearIsometryEquiv.map_zero, mfld_simps]
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
⊢ LinearMap.range
      (fderiv ℝ (Subtype.val ∘ ↑(LocalHomeomorph.symm (ChartedSpace.chartAt v))) (↑(ChartedSpace.chartAt v) v)) =
    (Submodule.span ℝ {↑v})ᗮ
[PROOFSTEP]
let U := (OrthonormalBasis.fromOrthogonalSpanSingleton (𝕜 := ℝ) n (ne_zero_of_mem_unit_sphere (-v))).repr
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
⊢ LinearMap.range
      (fderiv ℝ (Subtype.val ∘ ↑(LocalHomeomorph.symm (ChartedSpace.chartAt v))) (↑(ChartedSpace.chartAt v) v)) =
    (Submodule.span ℝ {↑v})ᗮ
[PROOFSTEP]
suffices : LinearMap.range (fderiv ℝ ((stereoInvFunAux (-v : E) ∘ (↑)) ∘ U.symm) 0) = (ℝ ∙ (v : E))ᗮ
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  LinearMap.range (fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0) =
    (Submodule.span ℝ {↑v})ᗮ
⊢ LinearMap.range
      (fderiv ℝ (Subtype.val ∘ ↑(LocalHomeomorph.symm (ChartedSpace.chartAt v))) (↑(ChartedSpace.chartAt v) v)) =
    (Submodule.span ℝ {↑v})ᗮ
[PROOFSTEP]
convert this using 3
[GOAL]
case h.e'_2.h.h.e'_15.h.h.e'_10
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  LinearMap.range (fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0) =
    (Submodule.span ℝ {↑v})ᗮ
e_1✝ : Submodule ℝ (TangentSpace 𝓘(ℝ, E) ↑v) = Submodule ℝ E
e_12✝ :
  (TangentSpace 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v →L[ℝ] TangentSpace 𝓘(ℝ, E) ↑v) = (EuclideanSpace ℝ (Fin n) →L[ℝ] E)
⊢ ↑(ChartedSpace.chartAt v) v = 0
[PROOFSTEP]
show stereographic' n (-v) v = 0
[GOAL]
case h.e'_2.h.h.e'_15.h.h.e'_10
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  LinearMap.range (fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0) =
    (Submodule.span ℝ {↑v})ᗮ
e_1✝ : Submodule ℝ (TangentSpace 𝓘(ℝ, E) ↑v) = Submodule ℝ E
e_12✝ :
  (TangentSpace 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v →L[ℝ] TangentSpace 𝓘(ℝ, E) ↑v) = (EuclideanSpace ℝ (Fin n) →L[ℝ] E)
⊢ ↑(stereographic' n (-v)) v = 0
[PROOFSTEP]
dsimp [stereographic']
[GOAL]
case h.e'_2.h.h.e'_15.h.h.e'_10
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  LinearMap.range (fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0) =
    (Submodule.span ℝ {↑v})ᗮ
e_1✝ : Submodule ℝ (TangentSpace 𝓘(ℝ, E) ↑v) = Submodule ℝ E
e_12✝ :
  (TangentSpace 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v →L[ℝ] TangentSpace 𝓘(ℝ, E) ↑v) = (EuclideanSpace ℝ (Fin n) →L[ℝ] E)
⊢ ↑(OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr (↑(stereographic (_ : ‖↑(-v)‖ = 1)) v) = 0
[PROOFSTEP]
simp only [AddEquivClass.map_eq_zero_iff]
[GOAL]
case h.e'_2.h.h.e'_15.h.h.e'_10
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  LinearMap.range (fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0) =
    (Submodule.span ℝ {↑v})ᗮ
e_1✝ : Submodule ℝ (TangentSpace 𝓘(ℝ, E) ↑v) = Submodule ℝ E
e_12✝ :
  (TangentSpace 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v →L[ℝ] TangentSpace 𝓘(ℝ, E) ↑v) = (EuclideanSpace ℝ (Fin n) →L[ℝ] E)
⊢ ↑(stereographic (_ : ‖↑(-v)‖ = 1)) v = 0
[PROOFSTEP]
apply stereographic_neg_apply
[GOAL]
case this
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
⊢ LinearMap.range (fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0) =
    (Submodule.span ℝ {↑v})ᗮ
[PROOFSTEP]
have :
  HasFDerivAt (stereoInvFunAux (-v : E) ∘ (Subtype.val : (ℝ ∙ (↑(-v) : E))ᗮ → E)) (ℝ ∙ (↑(-v) : E))ᗮ.subtypeL
    (U.symm 0) :=
  by
  convert hasFDerivAt_stereoInvFunAux_comp_coe (-v : E)
  simp
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
⊢ HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
[PROOFSTEP]
convert hasFDerivAt_stereoInvFunAux_comp_coe (-v : E)
[GOAL]
case h.e'_11.h
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
e_3✝ : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } = { x // x ∈ ↑(Submodule.span ℝ {-↑v})ᗮ }
⊢ ↑(LinearIsometryEquiv.symm U) 0 = 0
[PROOFSTEP]
simp
[GOAL]
case this
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
⊢ LinearMap.range (fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0) =
    (Submodule.span ℝ {↑v})ᗮ
[PROOFSTEP]
convert congrArg LinearMap.range (this.comp 0 U.symm.toContinuousLinearEquiv.hasFDerivAt).fderiv
[GOAL]
case h.e'_3
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
⊢ (Submodule.span ℝ {↑v})ᗮ =
    LinearMap.range
      (ContinuousLinearMap.comp (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
        ↑(LinearIsometryEquiv.toContinuousLinearEquiv (LinearIsometryEquiv.symm U)))
[PROOFSTEP]
symm
[GOAL]
case h.e'_3
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
⊢ LinearMap.range
      (ContinuousLinearMap.comp (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
        ↑(LinearIsometryEquiv.toContinuousLinearEquiv (LinearIsometryEquiv.symm U))) =
    (Submodule.span ℝ {↑v})ᗮ
[PROOFSTEP]
convert (U.symm : EuclideanSpace ℝ (Fin n) ≃ₗᵢ[ℝ] (ℝ ∙ (↑(-v) : E))ᗮ).range_comp (ℝ ∙ (↑(-v) : E))ᗮ.subtype using 1
[GOAL]
case h.e'_3
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
⊢ (Submodule.span ℝ {↑v})ᗮ = LinearMap.range (Submodule.subtype (Submodule.span ℝ {↑(-v)})ᗮ)
[PROOFSTEP]
simp only [Submodule.range_subtype, coe_neg_sphere]
[GOAL]
case h.e'_3
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
⊢ (Submodule.span ℝ {↑v})ᗮ = (Submodule.span ℝ {-↑v})ᗮ
[PROOFSTEP]
congr 1
  -- we must show `submodule.span ℝ {v} = submodule.span ℝ {-v}`
[GOAL]
case h.e'_3.e_K
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
⊢ Submodule.span ℝ {↑v} = Submodule.span ℝ {-↑v}
[PROOFSTEP]
apply Submodule.span_eq_span
[GOAL]
case h.e'_3.e_K.hs
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
⊢ {↑v} ⊆ ↑(Submodule.span ℝ {-↑v})
[PROOFSTEP]
simp only [Set.singleton_subset_iff, SetLike.mem_coe]
[GOAL]
case h.e'_3.e_K.hs
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
⊢ ↑v ∈ Submodule.span ℝ {-↑v}
[PROOFSTEP]
rw [← Submodule.neg_mem_iff]
[GOAL]
case h.e'_3.e_K.hs
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
⊢ -↑v ∈ Submodule.span ℝ {-↑v}
[PROOFSTEP]
exact Submodule.mem_span_singleton_self (-v : E)
[GOAL]
case h.e'_3.e_K.ht
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
⊢ {-↑v} ⊆ ↑(Submodule.span ℝ {↑v})
[PROOFSTEP]
simp only [Set.singleton_subset_iff, SetLike.mem_coe]
[GOAL]
case h.e'_3.e_K.ht
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
⊢ -↑v ∈ Submodule.span ℝ {↑v}
[PROOFSTEP]
rw [Submodule.neg_mem_iff]
[GOAL]
case h.e'_3.e_K.ht
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
⊢ ↑v ∈ Submodule.span ℝ {↑v}
[PROOFSTEP]
exact Submodule.mem_span_singleton_self (v : E)
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
⊢ Injective ↑(mfderiv 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) 𝓘(ℝ, E) Subtype.val v)
[PROOFSTEP]
rw [((contMDiff_coe_sphere v).mdifferentiableAt le_top).mfderiv]
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
⊢ Injective
    ↑(fderivWithin ℝ (writtenInExtChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) 𝓘(ℝ, E) v Subtype.val)
        (Set.range ↑𝓘(ℝ, EuclideanSpace ℝ (Fin n))) (↑(extChartAt 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v) v))
[PROOFSTEP]
simp only [chartAt, stereographic', stereographic_neg_apply, fderivWithin_univ, LinearIsometryEquiv.toHomeomorph_symm,
  LinearIsometryEquiv.coe_toHomeomorph, LinearIsometryEquiv.map_zero, mfld_simps]
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
⊢ Injective ↑(fderiv ℝ (Subtype.val ∘ ↑(LocalHomeomorph.symm (ChartedSpace.chartAt v))) (↑(ChartedSpace.chartAt v) v))
[PROOFSTEP]
let U := (OrthonormalBasis.fromOrthogonalSpanSingleton (𝕜 := ℝ) n (ne_zero_of_mem_unit_sphere (-v))).repr
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
⊢ Injective ↑(fderiv ℝ (Subtype.val ∘ ↑(LocalHomeomorph.symm (ChartedSpace.chartAt v))) (↑(ChartedSpace.chartAt v) v))
[PROOFSTEP]
suffices : Injective (fderiv ℝ ((stereoInvFunAux (-v : E) ∘ (↑)) ∘ U.symm) 0)
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this : Injective ↑(fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0)
⊢ Injective ↑(fderiv ℝ (Subtype.val ∘ ↑(LocalHomeomorph.symm (ChartedSpace.chartAt v))) (↑(ChartedSpace.chartAt v) v))
[PROOFSTEP]
convert this using 3
[GOAL]
case h.e'_3.h.h.e'_5.h.h.e'_10
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this : Injective ↑(fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0)
e_1✝¹ : TangentSpace 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v = EuclideanSpace ℝ (Fin n)
e_2✝ : TangentSpace 𝓘(ℝ, E) ↑v = E
e_1✝ :
  (TangentSpace 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v →L[ℝ] TangentSpace 𝓘(ℝ, E) ↑v) = (EuclideanSpace ℝ (Fin n) →L[ℝ] E)
⊢ ↑(ChartedSpace.chartAt v) v = 0
[PROOFSTEP]
show stereographic' n (-v) v = 0
[GOAL]
case h.e'_3.h.h.e'_5.h.h.e'_10
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this : Injective ↑(fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0)
e_1✝¹ : TangentSpace 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v = EuclideanSpace ℝ (Fin n)
e_2✝ : TangentSpace 𝓘(ℝ, E) ↑v = E
e_1✝ :
  (TangentSpace 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v →L[ℝ] TangentSpace 𝓘(ℝ, E) ↑v) = (EuclideanSpace ℝ (Fin n) →L[ℝ] E)
⊢ ↑(stereographic' n (-v)) v = 0
[PROOFSTEP]
dsimp [stereographic']
[GOAL]
case h.e'_3.h.h.e'_5.h.h.e'_10
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this : Injective ↑(fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0)
e_1✝¹ : TangentSpace 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v = EuclideanSpace ℝ (Fin n)
e_2✝ : TangentSpace 𝓘(ℝ, E) ↑v = E
e_1✝ :
  (TangentSpace 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v →L[ℝ] TangentSpace 𝓘(ℝ, E) ↑v) = (EuclideanSpace ℝ (Fin n) →L[ℝ] E)
⊢ ↑(OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr (↑(stereographic (_ : ‖↑(-v)‖ = 1)) v) = 0
[PROOFSTEP]
simp only [AddEquivClass.map_eq_zero_iff]
[GOAL]
case h.e'_3.h.h.e'_5.h.h.e'_10
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this : Injective ↑(fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0)
e_1✝¹ : TangentSpace 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v = EuclideanSpace ℝ (Fin n)
e_2✝ : TangentSpace 𝓘(ℝ, E) ↑v = E
e_1✝ :
  (TangentSpace 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) v →L[ℝ] TangentSpace 𝓘(ℝ, E) ↑v) = (EuclideanSpace ℝ (Fin n) →L[ℝ] E)
⊢ ↑(stereographic (_ : ‖↑(-v)‖ = 1)) v = 0
[PROOFSTEP]
apply stereographic_neg_apply
[GOAL]
case this
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
⊢ Injective ↑(fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0)
[PROOFSTEP]
have :
  HasFDerivAt (stereoInvFunAux (-v : E) ∘ (Subtype.val : (ℝ ∙ (↑(-v) : E))ᗮ → E)) (ℝ ∙ (↑(-v) : E))ᗮ.subtypeL
    (U.symm 0) :=
  by
  convert hasFDerivAt_stereoInvFunAux_comp_coe (-v : E)
  simp
[GOAL]
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
⊢ HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
[PROOFSTEP]
convert hasFDerivAt_stereoInvFunAux_comp_coe (-v : E)
[GOAL]
case h.e'_11.h
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
e_3✝ : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } = { x // x ∈ ↑(Submodule.span ℝ {-↑v})ᗮ }
⊢ ↑(LinearIsometryEquiv.symm U) 0 = 0
[PROOFSTEP]
simp
[GOAL]
case this
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
⊢ Injective ↑(fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0)
[PROOFSTEP]
have := congr_arg FunLike.coe <| (this.comp 0 U.symm.toContinuousLinearEquiv.hasFDerivAt).fderiv
[GOAL]
case this
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this✝ :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
this :
  ↑(fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0) =
    ↑(ContinuousLinearMap.comp (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
        ↑(LinearIsometryEquiv.toContinuousLinearEquiv (LinearIsometryEquiv.symm U)))
⊢ Injective ↑(fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0)
[PROOFSTEP]
refine Eq.subst this.symm ?_
[GOAL]
case this
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this✝ :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
this :
  ↑(fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0) =
    ↑(ContinuousLinearMap.comp (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
        ↑(LinearIsometryEquiv.toContinuousLinearEquiv (LinearIsometryEquiv.symm U)))
⊢ Injective
    ↑(ContinuousLinearMap.comp (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
        ↑(LinearIsometryEquiv.toContinuousLinearEquiv (LinearIsometryEquiv.symm U)))
[PROOFSTEP]
rw [ContinuousLinearMap.coe_comp', ContinuousLinearEquiv.coe_coe]
[GOAL]
case this
E : Type u_1
inst✝⁸ : NormedAddCommGroup E
inst✝⁷ : InnerProductSpace ℝ E
F : Type u_2
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
H : Type u_3
inst✝⁴ : TopologicalSpace H
I : ModelWithCorners ℝ F H
M : Type u_4
inst✝³ : TopologicalSpace M
inst✝² : ChartedSpace H M
inst✝¹ : SmoothManifoldWithCorners I M
n : ℕ
inst✝ : Fact (finrank ℝ E = n + 1)
v : ↑(sphere 0 1)
U : { x // x ∈ (Submodule.span ℝ {↑(-v)})ᗮ } ≃ₗᵢ[ℝ] EuclideanSpace ℝ (Fin n) :=
  (OrthonormalBasis.fromOrthogonalSpanSingleton n (_ : ↑(-v) ≠ 0)).repr
this✝ :
  HasFDerivAt (stereoInvFunAux (-↑v) ∘ Subtype.val) (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
    (↑(LinearIsometryEquiv.symm U) 0)
this :
  ↑(fderiv ℝ ((stereoInvFunAux (-↑v) ∘ Subtype.val) ∘ ↑(LinearIsometryEquiv.symm U)) 0) =
    ↑(ContinuousLinearMap.comp (Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ)
        ↑(LinearIsometryEquiv.toContinuousLinearEquiv (LinearIsometryEquiv.symm U)))
⊢ Injective
    (↑(Submodule.subtypeL (Submodule.span ℝ {↑(-v)})ᗮ) ∘
      ↑(LinearIsometryEquiv.toContinuousLinearEquiv (LinearIsometryEquiv.symm U)))
[PROOFSTEP]
simpa using Subtype.coe_injective
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
⊢ Smooth (ModelWithCorners.prod 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)))
    𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) fun p => p.fst * p.snd
[PROOFSTEP]
apply ContMDiff.codRestrict_sphere
[GOAL]
case hf
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
⊢ ContMDiff (ModelWithCorners.prod 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) 𝓘(ℝ, EuclideanSpace ℝ (Fin 1))) 𝓘(ℝ, ℂ) ⊤ fun p =>
    ↑p.fst * ↑p.snd
[PROOFSTEP]
let c : circle → ℂ := (↑)
[GOAL]
case hf
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
c : { x // x ∈ circle } → ℂ := Subtype.val
⊢ ContMDiff (ModelWithCorners.prod 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) 𝓘(ℝ, EuclideanSpace ℝ (Fin 1))) 𝓘(ℝ, ℂ) ⊤ fun p =>
    ↑p.fst * ↑p.snd
[PROOFSTEP]
have h₂ : ContMDiff (𝓘(ℝ, ℂ).prod 𝓘(ℝ, ℂ)) 𝓘(ℝ, ℂ) ∞ fun z : ℂ × ℂ => z.fst * z.snd :=
  by
  rw [contMDiff_iff]
  exact
    ⟨continuous_mul, fun x y => contDiff_mul.contDiffOn⟩
      -- Porting note: needed to fill in first 3 arguments or could not figure out typeclasses
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
c : { x // x ∈ circle } → ℂ := Subtype.val
⊢ ContMDiff (ModelWithCorners.prod 𝓘(ℝ, ℂ) 𝓘(ℝ, ℂ)) 𝓘(ℝ, ℂ) ⊤ fun z => z.fst * z.snd
[PROOFSTEP]
rw [contMDiff_iff]
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
c : { x // x ∈ circle } → ℂ := Subtype.val
⊢ (Continuous fun z => z.fst * z.snd) ∧
    ∀ (x : ℂ × ℂ) (y : ℂ),
      ContDiffOn ℝ ⊤
        (↑(extChartAt 𝓘(ℝ, ℂ) y) ∘
          (fun z => z.fst * z.snd) ∘ ↑(LocalEquiv.symm (extChartAt (ModelWithCorners.prod 𝓘(ℝ, ℂ) 𝓘(ℝ, ℂ)) x)))
        ((extChartAt (ModelWithCorners.prod 𝓘(ℝ, ℂ) 𝓘(ℝ, ℂ)) x).target ∩
          ↑(LocalEquiv.symm (extChartAt (ModelWithCorners.prod 𝓘(ℝ, ℂ) 𝓘(ℝ, ℂ)) x)) ⁻¹'
            ((fun z => z.fst * z.snd) ⁻¹' (extChartAt 𝓘(ℝ, ℂ) y).source))
[PROOFSTEP]
exact
  ⟨continuous_mul, fun x y => contDiff_mul.contDiffOn⟩
    -- Porting note: needed to fill in first 3 arguments or could not figure out typeclasses
[GOAL]
case hf
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
c : { x // x ∈ circle } → ℂ := Subtype.val
h₂ : ContMDiff (ModelWithCorners.prod 𝓘(ℝ, ℂ) 𝓘(ℝ, ℂ)) 𝓘(ℝ, ℂ) ⊤ fun z => z.fst * z.snd
⊢ ContMDiff (ModelWithCorners.prod 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) 𝓘(ℝ, EuclideanSpace ℝ (Fin 1))) 𝓘(ℝ, ℂ) ⊤ fun p =>
    ↑p.fst * ↑p.snd
[PROOFSTEP]
suffices h₁ : ContMDiff ((𝓡 1).prod (𝓡 1)) (𝓘(ℝ, ℂ).prod 𝓘(ℝ, ℂ)) ⊤ (Prod.map c c)
[GOAL]
case hf
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
c : { x // x ∈ circle } → ℂ := Subtype.val
h₂ : ContMDiff (ModelWithCorners.prod 𝓘(ℝ, ℂ) 𝓘(ℝ, ℂ)) 𝓘(ℝ, ℂ) ⊤ fun z => z.fst * z.snd
h₁ :
  ContMDiff (ModelWithCorners.prod 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)))
    (ModelWithCorners.prod 𝓘(ℝ, ℂ) 𝓘(ℝ, ℂ)) ⊤ (Prod.map c c)
⊢ ContMDiff (ModelWithCorners.prod 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) 𝓘(ℝ, EuclideanSpace ℝ (Fin 1))) 𝓘(ℝ, ℂ) ⊤ fun p =>
    ↑p.fst * ↑p.snd
[PROOFSTEP]
apply h₂.comp h₁
[GOAL]
case h₁
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
c : { x // x ∈ circle } → ℂ := Subtype.val
h₂ : ContMDiff (ModelWithCorners.prod 𝓘(ℝ, ℂ) 𝓘(ℝ, ℂ)) 𝓘(ℝ, ℂ) ⊤ fun z => z.fst * z.snd
⊢ ContMDiff (ModelWithCorners.prod 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)))
    (ModelWithCorners.prod 𝓘(ℝ, ℂ) 𝓘(ℝ, ℂ)) ⊤ (Prod.map c c)
[PROOFSTEP]
apply ContMDiff.prod_map
[GOAL]
case h₁.hf
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
c : { x // x ∈ circle } → ℂ := Subtype.val
h₂ : ContMDiff (ModelWithCorners.prod 𝓘(ℝ, ℂ) 𝓘(ℝ, ℂ)) 𝓘(ℝ, ℂ) ⊤ fun z => z.fst * z.snd
⊢ ContMDiff 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) 𝓘(ℝ, ℂ) ⊤ c
[PROOFSTEP]
exact contMDiff_coe_sphere
[GOAL]
case h₁.hg
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
c : { x // x ∈ circle } → ℂ := Subtype.val
h₂ : ContMDiff (ModelWithCorners.prod 𝓘(ℝ, ℂ) 𝓘(ℝ, ℂ)) 𝓘(ℝ, ℂ) ⊤ fun z => z.fst * z.snd
⊢ ContMDiff 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) 𝓘(ℝ, ℂ) ⊤ c
[PROOFSTEP]
exact contMDiff_coe_sphere
[GOAL]
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
⊢ Smooth 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) fun a => a⁻¹
[PROOFSTEP]
apply ContMDiff.codRestrict_sphere
[GOAL]
case hf
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
⊢ ContMDiff 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) 𝓘(ℝ, ℂ) ⊤ fun a => (↑a)⁻¹
[PROOFSTEP]
simp only [← coe_inv_circle, coe_inv_circle_eq_conj]
[GOAL]
case hf
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : InnerProductSpace ℝ E
⊢ ContMDiff 𝓘(ℝ, EuclideanSpace ℝ (Fin 1)) 𝓘(ℝ, ℂ) ⊤ fun a => ↑(starRingEnd ℂ) ↑a
[PROOFSTEP]
exact Complex.conjCle.contDiff.contMDiff.comp contMDiff_coe_sphere