Samplinglib
Lean gate not recorded for this source state main · ed709a7f320d
Registry leaf card · pbps.actualNormalizedEndpointSector

actual_normalized_endpoint_sector_reversal

compiled Samplinglib leaf Not mapped module/build coverage

- Momentum-flipped reversal preserves every actual normalized fixed-count endpoint-pair measure.

Plain-English statement

- Momentum-flipped reversal preserves every actual normalized fixed-count endpoint-pair measure.

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 actual_normalized_endpoint_sector_reversal
    {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
    [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E]
    {V : E → ℝ} {α β : ℝ≥0} {η : ℝ}
    (hα : 0 < (α : ℝ)) (hαβ : α ≤ β) (hV : ContDiff ℝ 2 V)
    (hH : ∀ x v : E,
      (α : ℝ) * ‖v‖ ^ 2 ≤ (fderiv ℝ (fderiv ℝ V) x v) v ∧
      (fderiv ℝ (fderiv ℝ V) x v) v ≤ (β : ℝ) * ‖v‖ ^ 2)
    (hη : 0 < η) (hβη : (β : ℝ) * η ≤ 1) : actual_normalized_endpoint_sector_statement hα hαβ hV hH hη hβη := by
  classical
  unfold actual_normalized_endpoint_sector_statement
  intro c Φ S rate Λ Rec Hist Δ Prefix zAt K qReal q liveTime d weight Path Ψ Γ ρ R Vy piY gamma m y r n T A B sigma L J
  obtain ⟨rhoTime, hrho, h97⟩ :=
    AutoSamplingTheory.ExampleCases.ProximalBPS.ActualEndpointTimeReversal.actual_endpoint_time_reversal_laws
      hα hαβ hV hH hη hβη n T
  obtain ⟨rho102, hrho102, h102⟩ :=
    AutoSamplingTheory.ExampleCases.ProximalBPS.ActualWeightedSector.actual_weighted_sector_lintegral
      hα hαβ hV hH hη hβη n T
  have halign : rho102 = rhoTime := by
    funext t
    apply Subtype.ext
    funext i
    exact (hrho102 t i).trans (hrho t i).symm
  subst rho102
  rcases h97 with ⟨hTimeM, hTimeI, hTimeP, hAformula, hAjoint, hAvolume,
    hArev, hThetajoint, hThetaI, hThetaP⟩
  let Theta : (E × E) × Prefix n T → (E × E) × Prefix n T :=
    fun q => (R (A q), rhoTime q.2)
  have hemb : Measurable (fun q : (E × E) × Prefix n T => (((y, r), q.1), q.2)) :=
    (measurable_const.prodMk measurable_fst).prodMk measurable_snd
  have hA : Measurable A := hAjoint.comp hemb
  have hB : Measurable B := measurable_fst.prodMk hA
  have hR : Measurable R := measurable_fst.prodMk measurable_snd.neg
  have hJ : Measurable J := (hR.comp measurable_snd).prodMk (hR.comp measurable_fst)
  have hTheta : Measurable Theta := hThetajoint.comp hemb
  have hinter (x : (E × E) × Prefix n T) : B (Theta x) = J (B x) := by
    apply Prod.ext
    · rfl
    · exact hArev y r x.1 x.2
  obtain ⟨Z, hZ⟩ :=
    AutoSamplingTheory.ExampleCases.ProximalBPS.ActualFiniteCountPath.actual_finite_count_path_law
      hα hαβ hV hH hη hβη
  have hρjoint : Measurable (fun p : ((E × E) × (E × E)) × Prefix n T =>
      ρ p.1.1.1 p.1.1.2 p.1.2 n T p.2) := (hZ.2.2.2.2 n T).2.2.1
  have hρ := hρjoint.comp hemb
  have hρliteral : Measurable (fun x : (E × E) × Prefix n T => ρ y r x.1 n T x.2) := by
    simpa only [Function.comp_def] using hρ
  have hcons (i : Fin (n + 1)) :
      Measurable (fun t : Fin n → ℝ => (Fin.cons (0 : ℝ) t : Fin (n + 1) → ℝ) i) := by
    induction i using Fin.cases with
    | zero => exact measurable_const
    | succ i => exact measurable_pi_apply i
  have hs : MeasurableSet (Δ n T) := by
    change MeasurableSet {t : Fin n → ℝ |
      (∀ i j : Fin (n + 1), i < j → (Fin.cons (0 : ℝ) t : Fin (n + 1) → ℝ) i < (Fin.cons (0 : ℝ) t : Fin (n + 1) → ℝ) j) ∧
      ∀ i : Fin n, t i < (T : ℝ)}
    rw [Set.ofPred_and]
    apply MeasurableSet.inter
    · simpa only [← Set.ofPred_forall] using (MeasurableSet.iInter fun (i : Fin (n + 1)) =>
        MeasurableSet.iInter fun (j : Fin (n + 1)) =>
        MeasurableSet.iInter fun (_ : i < j) => measurableSet_lt (hcons i) (hcons j))
    · simpa only [← Set.ofPred_forall] using (MeasurableSet.iInter fun (i : Fin n) =>
        measurableSet_lt (measurable_pi_apply i) (measurable_const (a := (T : ℝ))))
  have hmσ : SigmaFinite ((m n T).map (fun t : Prefix n T => t.val)) := by
    change SigmaFinite ((Measure.comap (fun t : Prefix n T => t.val)
      (volume : Measure (Fin n → ℝ))).map (fun t : Prefix n T => t.val))
    rw [map_comap_subtype_coe hs]
    infer_instance
  letI : SigmaFinite (m n T) := SigmaFinite.of_map (m n T) measurable_subtype_coe.aemeasurable hmσ
  let U : E × E → ℝ := fun z => V z.1 + ‖z.1 - y‖ ^ 2 / (2 * η) + ‖z.2‖ ^ 2 / 2
  let w : E × E → ℝ := fun z => Real.exp (-U z)
  let ell : Measure (E × E) := (volume : Measure E).prod (volume : Measure E)
  let cNorm : ℝ≥0∞ := (∫⁻ z, ENNReal.ofReal (w z) ∂ell)⁻¹
  let W : (E × E) × Prefix n T → ℝ≥0∞ :=
    fun x => ENNReal.ofReal (w x.1) * ρ y r x.1 n T x.2
  have hU : Continuous U := by
    exact ((hV.continuous.comp continuous_fst).add
      (((continuous_fst.sub continuous_const).norm.pow 2).div_const (2 * η))).add
      ((continuous_snd.norm.pow 2).div_const 2)
  have hw : Measurable (fun z => ENNReal.ofReal (w z)) :=
    ENNReal.measurable_ofReal.comp (Real.continuous_exp.comp hU.neg).measurable
  have hW : Measurable W := (hw.comp measurable_fst).mul hρ
  have hf : Measurable (fun z => cNorm * ENNReal.ofReal (w z)) := measurable_const.mul hw
  have hphase : ell.withDensity (fun z => cNorm * ENNReal.ofReal (w z)) =
      (piY y).prod gamma :=
    (AutoSamplingTheory.ExampleCases.ProximalBPS.ActualPhaseNormalization.actual_phase_gibbs_normalization
      hα hαβ hV hH hη hβη y).2.2.2.2.2.2
  have hsigma : sigma = (ell.prod (m n T)).withDensity (fun x => cNorm * W x) := by
    change (((piY y).prod gamma).prod (m n T)).withDensity
      (fun x => ρ y r x.1 n T x.2) = _
    rw [← hphase, prod_withDensity_left hf,
      ← withDensity_mul _
        (f := fun x : (E × E) × Prefix n T => cNorm * ENNReal.ofReal (w x.1))
        (g := fun x => ρ y r x.1 n T x.2) (hf.comp measurable_fst) hρliteral]
    congr 1
    funext x
    exact mul_assoc _ _ _
  have hsector : MeasurePreserving Theta sigma sigma := by
    refine ⟨hTheta, ?_⟩
    apply Measure.ext_of_lintegral
    intro F hF
    rw [lintegral_map hF hTheta, hsigma]
    rw [lintegral_withDensity_eq_lintegral_mul _
        (f := fun x => cNorm * W x) (g := fun x => F (Theta x))
        (measurable_const.mul hW) (hF.comp hTheta),
      lintegral_withDensity_eq_lintegral_mul _
        (f := fun x => cNorm * W x) (g := fun x => F x)
        (measurable_const.mul hW) hF]
    simp only [Pi.mul_apply, mul_assoc]
    rw [lintegral_const_mul cNorm (f := fun x => W x * F (Theta x))
        (hW.mul (hF.comp hTheta)),
      lintegral_const_mul cNorm (f := fun x => W x * F x) (hW.mul hF)]
    exact congrArg (fun a => cNorm * a) (h102 y r F hF)
  refine ⟨hJ, ?_⟩
  change Measure.map J (Measure.map B sigma) = Measure.map B sigma
  rw [Measure.map_map hJ hB]
  calc
    Measure.map (J ∘ B) sigma = Measure.map (B ∘ Theta) sigma := by
      congr 1
      funext x
      exact (hinter x).symm
    _ = Measure.map B (Measure.map Theta sigma) := (Measure.map_map hB hTheta).symm
    _ = Measure.map B sigma := by rw [hsector.map_eq]

#print axioms actual_normalized_endpoint_sector_reversal
end
end AutoSamplingTheory.ExampleCases.ProximalBPS.ActualNormalizedEndpointSector

Proof architecture

Actual normalized endpoint-pair sector; no SALD claim

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.
  • Totalized `fderiv` values must not be read as a differentiability theorem.
  • Almost-everywhere hypotheses depend on the stated measure and representative.
  • Density statements retain normalization and absolute-continuity prerequisites.
  • A Gibbs expression is not automatically a probability law or an invariant law.
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.