Samplinglib
Lean gate not recorded for this source state main · 9bb7a7394ab0

Bench / geometry

sogb-016 · public-dev · editorial and formal status separate

A quadratic gradient through the actual sphere differential

Riemannian Optimisation · natural-language: L3 / lean: L3 (author-assigned; calibration pending)

Why this difficulty?

Combine a genuine derivative of a symmetric quadratic, the actual sphere-inclusion differential and an explicit orthogonal projection, then establish both directions of the tangent-vector characterization. The level reflects these mechanisms, not tactic length.

Editorial review and exact formal-coverage boundary

AI editorial review accepted. This is not canonical theorem publication, full Lean coverage or empirical difficulty calibration.

  • Conclusion-only coverage means the exact displayed representation equivalence is the artifact being checked. Natural-language pedagogical completeness, the four separate rubric awards and provisional difficulty labels are not additional Lean propositions; local derivative and chain-rule mechanisms are nevertheless formally present in the proof and inspected dependencies.
  • The separate stationarity/eigenvector equivalences, arbitrary-manifold or arbitrary-metric generalizations, textbook-wide alignment, optimization algorithms and convergence rates are not established by this QA. The packet explicitly excludes these, so this is a scope boundary rather than a repair request.

Content-bound review status and evidence hashes · Independent reports and frozen inputs. Historical rejected wording is audit material, not training gold.

Assumptions and conventions

  • \(E\) is a finite-dimensional real inner-product space with \(\dim E=n+1\), where \(n\in\mathbb N\). Let \(S=\{x\in E:\|x\|=1\}\) have its standard smooth sphere structure.
  • \(A:E\to E\) is a symmetric continuous linear map and \(q(y)=\langle y,Ay\rangle\). Fix \(x\in S\), let \(i:S\hookrightarrow E\) be the actual inclusion, and put \(K=(\mathbb R x)^\perp\).
  • Tangent directions \(w\in T_xS\) are paired through \(D i_x w\in K\) using the ambient inner product. No default inner product on chart coordinates is identified with this induced pairing.

Natural-language question

For every z in K, prove that D(q restricted to S)_x(w)=⟨D \(i_{x}(w),z⟩\) for all w in \(T_{xS}\) if and only if \(z=2(Ax-⟨x,Ax⟩x)\). Justify the ambient derivative, the unit-normal projection and the uniqueness direction. Use genuine differentiability, not the totalized derivative's fallback value.

Reference mathematical proof
  1. Symmetry gives the genuine ambient derivative \[Dq_x(v)=\langle v,Ax\rangle+\langle x,Av\rangle=2\langle v,Ax\rangle.\] Hence the real gradient is \(g=2Ax\). The bounded linear map and quadratic operations supply differentiability; the equality is not an inference from a totalized zero derivative.

  2. For the actual inclusion, \(\operatorname{range}(D i_x)=K\). The chain rule therefore gives \[D(q|_S)_x(w)=\langle D i_x(w),g\rangle.\] This uses the inclusion-induced pairing, not an assumed isometry from an arbitrary chart metric.

  3. Because \(\|x\|=1\), orthogonal projection onto K satisfies \[P_Ku=u-\langle x,u\rangle x.\] Substituting g yields the tangent vector \[G=P_K(2Ax)=2(Ax-\langle x,Ax\rangle x).\]

  4. Every \(D i_x(w)\) lies in K, so orthogonal projection preserves its pairing with g. Thus G represents the restricted differential. Conversely, if a tangent vector z has the same pairing for every w, surjectivity onto K makes \(z-G\) orthogonal to every vector in K. Taking its inner product with itself gives \(z=G\), proving the equivalence.

How the Lean proof follows these steps

The task retains the exact ambient variables and finrank Fact from the source section. The proof first constructs HasGradientAt, using the symmetric quadratic derivative, rather than interpreting a totalized value as differentiability. It then computes the orthogonal projection using unit sphere membership and specializes the imported sphere-gradient characterization. The final subtype/coercion steps identify ambient tangent vectors in both directions. No proof of the target theorem is supplied in the context, and its module is not imported.

/- SamplingOptimisationGeometryBench public-dev reference.
   Reuses the existing project proof; retain LICENSE and NOTICE. -/
import AutoSamplingTheory.TechnicalLemmas.Geometry.SphereGradient
import Mathlib.Analysis.InnerProductSpace.Rayleigh

noncomputable section
open Metric InnerProductSpace
open scoped Manifold InnerProductSpace
open AutoSamplingTheory.TechnicalLemmas.Geometry
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
  [FiniteDimensional ℝ E]

example
    (n : ℕ) [Fact (Module.finrank ℝ E = n + 1)]
    (A : E →L[ℝ] E) (hA : A.IsSymmetric) (x : sphere (0 : E) 1) :
    ∀ z : (ℝ ∙ (x : E))ᗮ,
      ((∀ w : TangentSpace (𝓡 n) x,
        mvfderiv (𝓡 n) (fun y : sphere (0 : E) 1 => ⟪(y : E), A (y : E)⟫_ℝ) x w =
          ⟪mvfderiv (𝓡 n) ((↑) : sphere (0 : E) 1 → E) x w, (z : E)⟫_ℝ) ↔
        (z : E) = (2 : ℝ) • (A (x : E) - ⟪(x : E), A (x : E)⟫_ℝ • (x : E))) := by
  have hx : ‖(x : E)‖ = 1 := mem_sphere_zero_iff_norm.mp x.property
  have hg : HasGradientAt (fun y : E => ⟪y, A y⟫_ℝ) ((2 : ℝ) • A (x : E)) (x : E) := by
    apply hasGradientAt_iff_hasFDerivAt.mpr
    have hraw := (hA.hasStrictFDerivAt_reApplyInnerSelf (x : E)).hasFDerivAt
    have hfun : (fun y : E => ⟪y, A y⟫_ℝ) = A.reApplyInnerSelf := by
      funext y
      simp [ContinuousLinearMap.reApplyInnerSelf_apply, real_inner_comm]
    have hlin : toDual ℝ E ((2 : ℝ) • A (x : E)) =
        (2 : ℕ) • innerSL ℝ (A (x : E)) := by
      ext v
      simp [toDual_apply_apply, two_smul]
    rw [hfun, hlin]
    exact hraw
  let K := (ℝ ∙ (x : E))ᗮ
  have hproj (u : E) : (K.orthogonalProjectionOnto u : E) =
      u - ⟪(x : E), u⟫_ℝ • (x : E) := by
    change (ℝ ∙ (x : E))ᗮ.starProjection u = _
    rw [Submodule.starProjection_orthogonal_val,
      Submodule.starProjection_unit_singleton ℝ hx]
  have hp : (K.orthogonalProjectionOnto ((2 : ℝ) • A (x : E)) : E) =
      (2 : ℝ) • (A (x : E) - ⟪(x : E), A (x : E)⟫_ℝ • (x : E)) := by
    rw [hproj]
    simp [inner_smul_right, smul_sub, smul_smul]
  intro z
  rw [SphereGradient.sphere_gradient_characterization n x hg z]
  constructor
  · intro hz
    exact (congrArg (fun v : K => (v : E)) hz).trans hp
  · intro hz
    apply Subtype.ext
    exact hz.trans hp.symm

Download runnable reference

Assessment rubric · 4 points
  1. Uses symmetry and genuine differentiability to obtain ambient gradient 2Ax with the correct factor two. (1 point)
  2. Uses the actual sphere inclusion differential and its range K, retaining the induced pairing rather than assuming a chart metric. (1 point)
  3. Uses unit norm to derive the projection and the exact Rayleigh coefficient ⟨x,Ax⟩. (1 point)
  4. Proves both representation and uniqueness using tangent directions and the range of the inclusion derivative. (1 point)

Lean question

Keep the target and context fixed; replace the comment slot with your proof. Ancestor libraries are allowed, but the target module is not imported directly.

Show fixed Lean task
/- SamplingOptimisationGeometryBench public-dev reference.
   Reuses the existing project proof; retain LICENSE and NOTICE. -/
import AutoSamplingTheory.TechnicalLemmas.Geometry.SphereGradient
import Mathlib.Analysis.InnerProductSpace.Rayleigh

noncomputable section
open Metric InnerProductSpace
open scoped Manifold InnerProductSpace
open AutoSamplingTheory.TechnicalLemmas.Geometry
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
  [FiniteDimensional ℝ E]

example
    (n : ℕ) [Fact (Module.finrank ℝ E = n + 1)]
    (A : E →L[ℝ] E) (hA : A.IsSymmetric) (x : sphere (0 : E) 1) :
    ∀ z : (ℝ ∙ (x : E))ᗮ,
      ((∀ w : TangentSpace (𝓡 n) x,
        mvfderiv (𝓡 n) (fun y : sphere (0 : E) 1 => ⟪(y : E), A (y : E)⟫_ℝ) x w =
          ⟪mvfderiv (𝓡 n) ((↑) : sphere (0 : E) 1 → E) x w, (z : E)⟫_ℝ) ↔
        (z : E) = (2 : ℝ) • (A (x : E) - ⟪(x : E), A (x : E)⟫_ℝ • (x : E))) := by
  -- Replace this comment with your proof.

Download task template

Reference Lean and explanation

The task retains the exact ambient variables and finrank Fact from the source section. The proof first constructs HasGradientAt, using the symmetric quadratic derivative, rather than interpreting a totalized value as differentiability. It then computes the orthogonal projection using unit sphere membership and specializes the imported sphere-gradient characterization. The final subtype/coercion steps identify ambient tangent vectors in both directions. No proof of the target theorem is supplied in the context, and its module is not imported.

/- SamplingOptimisationGeometryBench public-dev reference.
   Reuses the existing project proof; retain LICENSE and NOTICE. -/
import AutoSamplingTheory.TechnicalLemmas.Geometry.SphereGradient
import Mathlib.Analysis.InnerProductSpace.Rayleigh

noncomputable section
open Metric InnerProductSpace
open scoped Manifold InnerProductSpace
open AutoSamplingTheory.TechnicalLemmas.Geometry
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
  [FiniteDimensional ℝ E]

example
    (n : ℕ) [Fact (Module.finrank ℝ E = n + 1)]
    (A : E →L[ℝ] E) (hA : A.IsSymmetric) (x : sphere (0 : E) 1) :
    ∀ z : (ℝ ∙ (x : E))ᗮ,
      ((∀ w : TangentSpace (𝓡 n) x,
        mvfderiv (𝓡 n) (fun y : sphere (0 : E) 1 => ⟪(y : E), A (y : E)⟫_ℝ) x w =
          ⟪mvfderiv (𝓡 n) ((↑) : sphere (0 : E) 1 → E) x w, (z : E)⟫_ℝ) ↔
        (z : E) = (2 : ℝ) • (A (x : E) - ⟪(x : E), A (x : E)⟫_ℝ • (x : E))) := by
  have hx : ‖(x : E)‖ = 1 := mem_sphere_zero_iff_norm.mp x.property
  have hg : HasGradientAt (fun y : E => ⟪y, A y⟫_ℝ) ((2 : ℝ) • A (x : E)) (x : E) := by
    apply hasGradientAt_iff_hasFDerivAt.mpr
    have hraw := (hA.hasStrictFDerivAt_reApplyInnerSelf (x : E)).hasFDerivAt
    have hfun : (fun y : E => ⟪y, A y⟫_ℝ) = A.reApplyInnerSelf := by
      funext y
      simp [ContinuousLinearMap.reApplyInnerSelf_apply, real_inner_comm]
    have hlin : toDual ℝ E ((2 : ℝ) • A (x : E)) =
        (2 : ℕ) • innerSL ℝ (A (x : E)) := by
      ext v
      simp [toDual_apply_apply, two_smul]
    rw [hfun, hlin]
    exact hraw
  let K := (ℝ ∙ (x : E))ᗮ
  have hproj (u : E) : (K.orthogonalProjectionOnto u : E) =
      u - ⟪(x : E), u⟫_ℝ • (x : E) := by
    change (ℝ ∙ (x : E))ᗮ.starProjection u = _
    rw [Submodule.starProjection_orthogonal_val,
      Submodule.starProjection_unit_singleton ℝ hx]
  have hp : (K.orthogonalProjectionOnto ((2 : ℝ) • A (x : E)) : E) =
      (2 : ℝ) • (A (x : E) - ⟪(x : E), A (x : E)⟫_ℝ • (x : E)) := by
    rw [hproj]
    simp [inner_smul_right, smul_sub, smul_smul]
  intro z
  rw [SphereGradient.sphere_gradient_characterization n x hg z]
  constructor
  · intro hz
    exact (congrArg (fun v : K => (v : E)) hz).trans hp
  · intro hz
    apply Subtype.ext
    exact hz.trans hp.symm

Download runnable reference

No current trusted-reference compiler receipt recorded in this build.

What this does—and does not—verify

The Lean conclusion is the displayed representation equivalence for each tangent vector. Stationarity/eigenvector equivalences, optimization rates and arbitrary-manifold or arbitrary-metric claims are separate results. The surrounding explanation is not an additional formal theorem.

Existing library mathematics reused; no new mathematical leaf or paper-completion credit. The editorial panel records the exact current review scope and remaining unformalized explanation.

Sources, graph location and dependencies

Original QA over the existing sphere-Rayleigh API. Its module places the result at Boumal Example 3.62, and the subsequent sphere_rayleigh_stationary_iff consumes it. This exercise checks the local characterization, not a whole textbook chapter or convergence theorem.

Exact local source and full context · Locate the existing Lean declaration

AutoSamplingTheory.TechnicalLemmas.Geometry.SphereRayleigh.sphere_rayleigh_characterization

ASTIS definitions / proof calls

  • AutoSamplingTheory.TechnicalLemmas.Geometry.SphereGradient.sphere_gradient_characterization

Mathlib facts / definitions

  • LinearMap.IsSymmetric.hasStrictFDerivAt_reApplyInnerSelf
  • hasGradientAt_iff_hasFDerivAt
  • Submodule.starProjection_orthogonal_val
  • Submodule.starProjection_unit_singleton
  • Subtype.ext

Binding SHA-256: 69fee45c9a7a53e9d1a4ec5295d530811736ff3e8dec9fbd435f1293d9bc1cd7