Samplinglib
Lean gate not recorded for this source state main · ed709a7f320d
Registry leaf card · quadratic-feature-law-gradient

quadratic_feature_law_gradient_angular_transport_control

compiled Samplinglib leaf Not mapped explicit smoke test

Actual ambient feature derivatives and visible operator bounds produce genuine mean integrability, potential gradient, tangent uniform bound, finite angular coupling cost and joint law/point control. Concrete feature-model inputs must still be produced. Fresh independent source/compiler and exact candidate audits accepted. Final root/reader gates and postmerge purification separate; no whole-model claim.

Plain-English statement

Actual ambient feature derivatives and visible operator bounds produce genuine mean integrability, potential gradient, tangent uniform bound, finite angular coupling cost and joint law/point control. Concrete feature-model inputs must still be produced. Fresh independent source/compiler and exact candidate audits accepted. Final root/reader gates and postmerge purification separate; no whole-model claim.

Scope guard. This card records a compiled local declaration. Its mathematical scope is exactly the Lean statement below; the Registry note and source correspondence may describe motivation but do not strengthen it.
Lean learning studio · mathematics → formal proof

Read the mathematics first, then descend into Lean

You do not need to know Lean before opening this panel. The page keeps the paper-level theorem, rigorous proof obligations, exact Lean declaration, and proof dependencies as separate layers so a first-time reader can move down one layer at a time.

BeginnerWhy this theorem exists → intuition → statement → one hand calculation. Hide proof-engineering detail.
RigorousExpose assumptions, hidden measure/limit/domain issues, proof route, and rigorous references.
Lean learnerOpen the exact declaration, proof tree/network, syntax glossary, and line-by-line explanation.

Proof architecture

Start with the tree when learning: prerequisites sit below the theorem and downstream results sit above it. Switch to the network when you want to understand where this declaration lives in the local formal library. Every mapped node is clickable.

Loading source-derived dependency evidence…

Graph rule: only dependencies found by the ASTIS source scan are drawn. Missing tactic indirection is treated as an under-approximation; the site never invents an edge just to make a prettier graph.

How to read the exact Lean declaration

Read a Lean theorem left-to-right exactly as you would unpack a mathematical sentence: name → ambient types → automatically inferred structures → explicit hypotheses → conclusion → proof. Then read the proof top-to-bottom as transformations of the current goal.

  1. NameWhat reusable mathematical fact is being created?
  2. ParametersWhich symbols are arbitrary, and which structures are inferred by typeclass search?
  3. PropositionAfter the colon, translate the Lean expression back into a paper statement.
  4. Proof actionsAfter by, ask what each tactic does to the mathematical goal—not only what syntax it uses.

Syntax used on this page

This glossary is filtered to syntax that actually occurs in the declaration above. Open a symbol only when you meet it, rather than memorizing Lean grammar in advance.

Source voice and ASTIS voice stay separate

When Samplinglib shows a short quotation from Chewi, it is labeled as a source excerpt and linked to the canonical book page. Intuition, expanded proof steps, hidden regularity assumptions, and Lean explanations are ASTIS-authored commentary. A quotation never substitutes for a formal proof, and an ASTIS explanation is never attributed to the textbook author.

Lean statement

theorem quadratic_feature_law_gradient_angular_transport_control
    {E H : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
    [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E]
    [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H]
    (F : E → H) (D : E → E →L[ℝ] H)
    (hF : ∀ w, HasFDerivAt F (D w) w)
    (M₁ M₂ : ℝ) (hM₁ : 0 ≤ M₁) (hM₂ : 0 ≤ M₂)
    (hBound : ∀ w : E, ‖w‖ ≤ 1 → ‖D w‖ ≤ M₁)
    (hLip : ∀ w u : E, ‖w‖ ≤ 1 → ‖u‖ ≤ 1 → ‖D w-D u‖ ≤ M₂*‖w-u‖)
    (y : H) :
    let S := {w : E // ‖w‖ = 1}
    let K : S → H := fun w => F w.1
    let c : S × S → ℝ := fun z => Real.arccos ⟪z.1.1,z.2.1⟫_ℝ
    let m : Measure S → H := fun μ => ∫ w, K w ∂μ
    let V : Measure S → E → ℝ := fun μ w => 2 * ⟪m μ-y,F w⟫_ℝ
    let G : Measure S → E → E := fun μ w =>
      (2 : ℝ) • ((D w).adjoint (m μ-y) - ⟪(D w).adjoint (m μ-y),w⟫_ℝ • w)
    let Q : Measure S → Measure S → ℝ≥0∞ := fun μ ν =>
      AutoSamplingTheory.TechnicalLemmas.Measure.Transport.transportCost
        (fun z => ENNReal.ofReal ((c z)^2)) μ ν
    ∃ C₁ C₂ : ℝ, 0 < C₁ ∧ 0 < C₂ ∧
      (∀ μ : Measure S, IsProbabilityMeasure μ →
        Integrable K μ ∧
        (∀ w : E, HasGradientAt (V μ) ((2 : ℝ) • (D w).adjoint (m μ-y)) w) ∧
        ∀ w : S, ⟪w.1,G μ w.1⟫_ℝ = 0 ∧ ‖G μ w.1‖ ≤ C₁) ∧
      ∀ μ ν : Measure S, IsProbabilityMeasure μ → IsProbabilityMeasure ν →
        Q μ ν ≠ ∞ ∧ ∀ w u : S,
          ‖G μ w.1-G ν u.1‖ ≤
            C₂ * ((Q μ ν ^ (1 / 2 : ℝ)).toReal + c (w,u)) := by
  let : SecondCountableTopology E := inferInstance
  let S := {w : E // ‖w‖ = 1}
  let K : S → H := fun w => F w.1
  let c : S × S → ℝ := fun z => Real.arccos ⟪z.1.1,z.2.1⟫_ℝ
  let m : Measure S → H := fun μ => ∫ w, K w ∂μ
  let V : Measure S → E → ℝ := fun μ w => 2 * ⟪m μ-y,F w⟫_ℝ
  let G : Measure S → E → E := fun μ w =>
    (2 : ℝ) • ((D w).adjoint (m μ-y) - ⟪(D w).adjoint (m μ-y),w⟫_ℝ • w)
  let Q : Measure S → Measure S → ℝ≥0∞ := fun μ ν =>
    AutoSamplingTheory.TechnicalLemmas.Measure.Transport.transportCost
      (fun z => ENNReal.ofReal ((c z)^2)) μ ν
  change ∃ C₁ C₂ : ℝ, 0 < C₁ ∧ 0 < C₂ ∧
    (∀ μ : Measure S, IsProbabilityMeasure μ →
      Integrable K μ ∧
      (∀ w : E, HasGradientAt (V μ) ((2 : ℝ) • (D w).adjoint (m μ-y)) w) ∧
      ∀ w : S, ⟪w.1,G μ w.1⟫_ℝ = 0 ∧ ‖G μ w.1‖ ≤ C₁) ∧
    ∀ μ ν : Measure S, IsProbabilityMeasure μ → IsProbabilityMeasure ν →
      Q μ ν ≠ ∞ ∧ ∀ w u : S,
        ‖G μ w.1-G ν u.1‖ ≤ C₂ * ((Q μ ν ^ (1 / 2 : ℝ)).toReal + c (w,u))
  have hFc : Continuous F := continuous_iff_continuousAt.mpr fun w => (hF w).continuousAt
  have hKsm : StronglyMeasurable K := (hFc.comp continuous_subtype_val).stronglyMeasurable
  have hChord (w u : E) (hw : ‖w‖ ≤ 1) (hu : ‖u‖ ≤ 1) :
      ‖F w-F u‖ ≤ M₁*‖w-u‖ := by
    apply (convex_closedBall (0 : E) 1).norm_image_sub_le_of_norm_hasFDerivWithin_le
      (fun z _ => (hF z).hasFDerivWithinAt) ?_
      (by simpa [Metric.mem_closedBall,dist_zero_right] using hu)
      (by simpa [Metric.mem_closedBall,dist_zero_right] using hw)
    intro z hz
    exact hBound z (by simpa [Metric.mem_closedBall,dist_zero_right] using hz)
  let B := ‖F (0:E)‖+M₁+1
  have hB : 0 ≤ B := by dsimp [B]; positivity
  have hKb (w : S) : ‖K w‖ ≤ B := by
    have hb := hChord w.1 0 w.property.le (by simp)
    have hn := norm_add_le (F w.1-F 0) (F 0)
    rw [sub_add_cancel] at hn
    simp only [sub_zero,w.property,mul_one] at hb
    change ‖F w.1‖ ≤ B
    dsimp [B]
    linarith
  have hAng := AutoSamplingTheory.TechnicalLemmas.Geometry.UnitSphereAngularCost.unit_sphere_angular_cost_properties (E := E)
  change Continuous c ∧ Measurable c ∧
    (∀ u v : S, 0 ≤ c (u,v) ∧ c (u,v) ≤ Real.pi ∧
      c (u,v) = InnerProductGeometry.angle u.1 v.1 ∧ ‖u.1-v.1‖ ≤ c (u,v) ∧
      (c (u,v) = 0 ↔ u = v) ∧ c (u,v) = c (v,u)) ∧
    ∀ u v w : S, c (u,w) ≤ c (u,v)+c (v,w) at hAng
  have hc0 (z : S × S) : 0 ≤ c z := (hAng.2.2.1 z.1 z.2).1
  have hcB (z : S × S) : c z ≤ Real.pi := (hAng.2.2.1 z.1 z.2).2.1
  have hKlip (w u : S) : ‖K w-K u‖ ≤ M₁*c (w,u) :=
    (hChord w.1 u.1 w.property.le u.property.le).trans
      (mul_le_mul_of_nonneg_left (hAng.2.2.1 w u).2.2.2.1 hM₁)
  have hMean (μ ν : Measure S) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] :=
    AutoSamplingTheory.TechnicalLemmas.Measure.BochnerMeanTransport.bounded_bochner_mean_quadratic_transport_control
      K hKsm B Real.pi M₁ hB Real.pi_pos.le hM₁ hKb c hAng.2.1 hc0 hcB hKlip μ ν
  have hTangent :=
    AutoSamplingTheory.TechnicalLemmas.Geometry.QuadraticFeatureTangentGradient.quadratic_feature_potential_tangent_gradient
      F D hF M₁ M₂ hM₁ hM₂ hBound hLip
  let R₀ := B+‖y‖
  have hR₀ : 0 ≤ R₀ := add_nonneg hB (norm_nonneg y)
  have hResidual (μ : Measure S) [IsProbabilityMeasure μ] : ‖m μ-y‖ ≤ R₀ :=
    ((hMean μ μ).2.2.2.2 y).1
  have hGrad (μ : Measure S) (w : E) :
      HasGradientAt (V μ) ((2 : ℝ) • (D w).adjoint (m μ-y)) w := by
    rw [hasGradientAt_iff_hasFDerivAt]
    have he : InnerProductSpace.toDual ℝ E ((2 : ℝ) • (D w).adjoint (m μ-y)) =
        (2 : ℝ) • innerSL ℝ ((D w).adjoint (m μ-y)) := by
      ext v
      simp [InnerProductSpace.toDual_apply_apply,innerSL_apply_apply]
    rw [he]
    exact hTangent.1 (m μ-y) w
  let A := 2*M₁^2
  let B₂ := 2*(M₂+2*M₁)*R₀
  have hA : 0 ≤ A := by dsimp [A]; positivity
  have hB₂ : 0 ≤ B₂ := by dsimp [B₂]; positivity
  refine ⟨2*M₁*R₀+1,A+B₂+1,by positivity,by positivity,?_,?_⟩
  · intro μ hμ
    let : IsProbabilityMeasure μ := hμ
    refine ⟨(hMean μ μ).1,hGrad μ,?_⟩
    intro w
    have ht := hTangent.2.1 (m μ-y) w.1 w.property
    refine ⟨ht.1,?_⟩
    exact ht.2.2.trans ((mul_le_mul_of_nonneg_left (hResidual μ) (by positivity)).trans (by linarith))
  · intro μ ν hμ hν
    let : IsProbabilityMeasure μ := hμ
    let : IsProbabilityMeasure ν := hν
    refine ⟨(hMean μ ν).2.2.1,?_⟩
    intro w u
    have hm : ‖(m μ-y)-(m ν-y)‖ ≤ M₁*(Q μ ν ^ (1 / 2 : ℝ)).toReal := by
      simpa only [sub_sub_sub_cancel_right] using (hMean μ ν).2.2.2.1
    have hr := hResidual ν
    have ht := hTangent.2.2 (m μ-y) (m ν-y) w.1 u.1 w.property u.property
    have hpoint := (hAng.2.2.1 w u).2.2.2.1
    have ht' : ‖G μ w.1-G ν u.1‖ ≤
        A*(Q μ ν ^ (1 / 2 : ℝ)).toReal+B₂*c (w,u) := by
      calc
        _ ≤ 2*M₁*‖(m μ-y)-(m ν-y)‖+
            2*(M₂+2*M₁)*‖m ν-y‖*‖w.1-u.1‖ := ht
        _ ≤ 2*M₁*(M₁*(Q μ ν ^ (1 / 2 : ℝ)).toReal)+
            2*(M₂+2*M₁)*R₀*c (w,u) := by
          gcongr
        _ = _ := by dsimp [A,B₂]; ring
    apply ht'.trans
    have hs : 0 ≤ (Q μ ν ^ (1 / 2 : ℝ)).toReal := ENNReal.toReal_nonneg
    have hc := hc0 (w,u)
    nlinarith [mul_nonneg hA hc,mul_nonneg hB₂ hs]

end AutoSamplingTheory.TechnicalLemmas.Geometry.QuadraticFeatureLawGradient

Proof architecture

Generic geometric optimisation and law-dependent feature prerequisites; actual model compositions remain separate

Lean proof walkthrough

  • Read the quantified variables and typeclass brackets as part of the mathematical statement; inferred arguments are not missing assumptions.
  • `intro` introduces quantified hypotheses into the local proof context.
  • `have` creates a named intermediate mathematical fact.
  • `calc` records an equality or inequality chain matching a paper calculation.
  • `rw` rewrites by an established identity.
  • `simp` normalizes through registered definitional and theorem rewrites.
  • `apply` reduces the goal to the hypotheses of a reusable theorem.
  • `refine` instantiates a reusable theorem while leaving explicit subgoals.

Why the statement has this shape

The declaration is kept at the reusable level recorded by its Registry tags and direct consumers. Explicit measures, spaces, wrappers, and regularity hypotheses expose interfaces that paper notation often infers. A theorem card explains those interfaces but never widens the compiled statement.

Hidden assumptions and non-claims

  • Measurability is represented explicitly or must be supplied by a dependency.
  • Integrability is an input or proved output; a displayed integral alone does not supply it.
  • Totalized `fderiv` values must not be read as a differentiability theorem.
Common pitfall. A wrapper or display identity is not a new analytic theorem merely because it has its own Lean name. Check the statement, hypotheses, and downstream consumers before interpreting its mathematical contribution.