Samplinglib
Lean gate passed 2026-08-19T06:32:39.895922+00:00 · 7bcd37294df1
production module

AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion

41 named declarations scanned from AutoSamplingTheory/TechnicalLemmas/StochasticProcesses/ItoTerminalCompletion.lean.

Imports
Imported by
Placeholder scan
0 declaration(s) flagged
Gate status
Compiled

Declarations

def AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.integrandToLp Compiled Not mapped

- Product-space representative of a progressive integrand, with finiteness obtained from the Brownian probability contract.

noncomputable def integrandToLp
    (eta : ProgressiveL2Integrand filtration mu T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    Lp ℝ 2 (ElementaryItoIntegral.processTimeMeasure mu T) := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  exact eta.toLp

/-- Canonical elementary terminal approximation. -/
def AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.terminalApprox Compiled Not mapped

- Canonical elementary terminal approximation.

noncomputable def terminalApprox
    (eta : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) (n : ℕ) :
    Lp ℝ 2 mu := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  exact terminalToLp (canonicalElementaryApprox eta hT n) hB

/-- Canonical elementary process approximation in product-space `L2`. -/
def AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.processApprox Compiled Not mapped

- Canonical elementary process approximation in product-space `L2`.

noncomputable def processApprox
    (eta : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) (n : ℕ) :
    Lp ℝ 2 (ElementaryItoIntegral.processTimeMeasure mu T) := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  exact processToLp (canonicalElementaryApprox eta hT n) hB
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.tendsto_processApprox Compiled Not mapped

No declaration docstring.

theorem tendsto_processApprox
    (eta : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    Tendsto (processApprox eta hT hB) atTop (nhds (integrandToLp eta hB)) := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  change Tendsto (fun n ↦ (canonicalElementaryApprox eta hT n).toLp mu)
    atTop (nhds eta.toLp)
  exact tendsto_canonicalElementaryApprox_toLp eta hT
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.norm_terminalApprox_sub Compiled Not mapped

No declaration docstring.

theorem norm_terminalApprox_sub
    (eta : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) (n k : ℕ) :
    ‖terminalApprox eta hT hB n - terminalApprox eta hT hB k‖ =
      ‖processApprox eta hT hB n - processApprox eta hT hB k‖ := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  simpa only [terminalApprox, processApprox] using
    norm_terminal_sub_eq_process_sub
      (canonicalElementaryApprox eta hT n)
      (canonicalElementaryApprox eta hT k) hB
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.terminalApprox_cauchy Compiled Not mapped

No declaration docstring.

theorem terminalApprox_cauchy
    (eta : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    CauchySeq (terminalApprox eta hT hB) := by
  rw [Metric.cauchySeq_iff]
  intro epsilon hepsilon
  obtain ⟨N, hN⟩ :=
    (Metric.cauchySeq_iff.mp (tendsto_processApprox eta hT hB).cauchySeq)
      epsilon hepsilon
  exact ⟨N, fun n hn k hk ↦ by
    simpa only [dist_eq_norm, norm_terminalApprox_sub] using hN n hn k hk⟩

/-- Terminal Ito integral as the complete-space limit of elementary terminal
integrals. -/
def AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.itoIntegralTerminal Compiled Not mapped

- Terminal Ito integral as the complete-space limit of elementary terminal integrals.

noncomputable def itoIntegralTerminal
    (eta : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) : Lp ℝ 2 mu :=
  atTop.limUnder (terminalApprox eta hT hB)
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.tendsto_terminalApprox Compiled Not mapped

No declaration docstring.

theorem tendsto_terminalApprox
    (eta : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    Tendsto (terminalApprox eta hT hB) atTop
      (nhds (itoIntegralTerminal eta hT hB)) := by
  apply tendsto_nhds_limUnder
  exact cauchySeq_tendsto_of_complete (terminalApprox_cauchy eta hT hB)

/-- Every elementary approximation converging to the integrand in product
`L2` has terminal integrals converging to the completed terminal integral. -/
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.tendsto_terminal_of_tendsto_elementary Compiled Not mapped

- Every elementary approximation converging to the integrand in product `L2` has terminal integrals converging to the completed terminal integral.

theorem tendsto_terminal_of_tendsto_elementary
    (eta : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu)
    (approx : ℕ → DyadicElementaryProcess filtration T)
    (happrox : Tendsto (fun n ↦ processToLp (approx n) hB) atTop
      (nhds (integrandToLp eta hB))) :
    Tendsto (fun n ↦ terminalToLp (approx n) hB) atTop
      (nhds (itoIntegralTerminal eta hT hB)) := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  rw [Metric.tendsto_atTop]
  intro epsilon hepsilon
  obtain ⟨Nterminal, hNterminal⟩ :=
    (Metric.tendsto_atTop.mp (tendsto_terminalApprox eta hT hB))
      (epsilon / 2) (by positivity)
  obtain ⟨Napprox, hNapprox⟩ :=
    (Metric.tendsto_atTop.mp happrox) (epsilon / 4) (by positivity)
  obtain ⟨Ncanonical, hNcanonical⟩ :=
    (Metric.tendsto_atTop.mp (tendsto_processApprox eta hT hB))
      (epsilon / 4) (by positivity)
  refine ⟨max Nterminal (max Napprox Ncanonical), fun n hn ↦ ?_⟩
  have hnTerminal : Nterminal ≤ n := (le_max_left _ _).trans hn
  have hnApprox : Napprox ≤ n :=
    (le_max_left _ _).trans ((le_max_right _ _).trans hn)
  have hnCanonical : Ncanonical ≤ n :=
    (le_max_right _ _).trans ((le_max_right _ _).trans hn)
  have hterminal := hNterminal n hnTerminal
  have happrox' := hNapprox n hnApprox
  have hcanonical := hNcanonical n hnCanonical
  calc
    dist (terminalToLp (approx n) hB) (itoIntegralTerminal eta hT hB) ≤
        dist (terminalToLp (approx n) hB) (terminalApprox eta hT hB n) +
          dist (terminalApprox eta hT hB n) (itoIntegralTerminal eta hT hB) :=
      dist_triangle _ _ _
    _ = dist (processToLp (approx n) hB) (processApprox eta hT hB n) +
          dist (terminalApprox eta hT hB n) (itoIntegralTerminal eta hT hB) := by
      congr 1
      rw [dist_eq_norm, dist_eq_norm]
      simpa only [terminalApprox, processApprox] using
        norm_terminal_sub_eq_process_sub (approx n)
          (canonicalElementaryApprox eta hT n) hB
    _ ≤ (dist (processToLp (approx n) hB) (integrandToLp eta hB) +
          dist (integrandToLp eta hB) (processApprox eta hT hB n)) +
          dist (terminalApprox eta hT hB n) (itoIntegralTerminal eta hT hB) :=
      add_le_add (dist_triangle _ _ _) le_rfl
-- Source excerpt truncated; follow the exact source link.

Excerpt truncated; the exact source link is authoritative.

theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.norm_terminalToLp_eq_processToLp Compiled Not mapped

No declaration docstring.

theorem norm_terminalToLp_eq_processToLp
    (eta : DyadicElementaryProcess filtration T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    ‖terminalToLp eta hB‖ = ‖processToLp eta hB‖ := by
  rw [terminalToLp, ← elementaryProcessToLp_eq_processToLp eta hB]
  exact ElementaryItoL2.norm_elementaryItoTerminalToLp eta.process hB T

/-- Completed terminal Ito isometry. -/
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.itoIntegralTerminal_norm Compiled Compiled

- Completed terminal Ito isometry.

theorem itoIntegralTerminal_norm
    (eta : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    ‖itoIntegralTerminal eta hT hB‖ = ‖integrandToLp eta hB‖ := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  have hterminal := (tendsto_terminalApprox eta hT hB).norm
  have hprocess := (tendsto_processApprox eta hT hB).norm
  have heq : (fun n ↦ ‖terminalApprox eta hT hB n‖) =
      fun n ↦ ‖processApprox eta hT hB n‖ := by
    funext n
    exact norm_terminalToLp_eq_processToLp
      (canonicalElementaryApprox eta hT n) hB
  rw [heq] at hterminal
  exact tendsto_nhds_unique hterminal hprocess

/-- Same-grid sum after refining both operands to their least common dyadic
level. -/
def AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.commonLeftProcess Compiled Not mapped

- Same-grid sum after refining both operands to their least common dyadic level.

noncomputable def commonLeftProcess
    (eta xi : DyadicElementaryProcess filtration T) :
    ElementaryItoIntegral.ElementaryAdaptedProcess filtration
      (2 ^ commonDyadicLevel eta xi) :=
  (refineDyadic eta (commonDyadicLevel eta xi) (le_max_left _ _)).process
def AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.commonRightProcess Compiled Not mapped

No declaration docstring.

noncomputable def commonRightProcess
    (eta xi : DyadicElementaryProcess filtration T) :
    ElementaryItoIntegral.ElementaryAdaptedProcess filtration
      (2 ^ commonDyadicLevel eta xi) :=
  (refineDyadic xi (commonDyadicLevel eta xi) (le_max_right _ _)).process
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.commonProcess_times_eq Compiled Not mapped

No declaration docstring.

theorem commonProcess_times_eq
    (eta xi : DyadicElementaryProcess filtration T) :
    (commonLeftProcess eta xi).times = (commonRightProcess eta xi).times := by
  rfl
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.commonLeftProcess_terminalToLp_eq Compiled Not mapped

No declaration docstring.

theorem commonLeftProcess_terminalToLp_eq
    (eta xi : DyadicElementaryProcess filtration T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    elementaryItoTerminalToLp (commonLeftProcess eta xi) hB T = terminalToLp eta hB := by
  unfold commonLeftProcess terminalToLp
  exact refineDyadic_terminalToLp_eq eta (commonDyadicLevel eta xi)
    (le_max_left _ _) hB T
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.commonRightProcess_terminalToLp_eq Compiled Not mapped

No declaration docstring.

theorem commonRightProcess_terminalToLp_eq
    (eta xi : DyadicElementaryProcess filtration T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    elementaryItoTerminalToLp (commonRightProcess eta xi) hB T = terminalToLp xi hB := by
  unfold commonRightProcess terminalToLp
  exact refineDyadic_terminalToLp_eq xi (commonDyadicLevel eta xi)
    (le_max_right _ _) hB T
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.commonLeftProcess_processToLp_eq Compiled Not mapped

No declaration docstring.

theorem commonLeftProcess_processToLp_eq
    (eta xi : DyadicElementaryProcess filtration T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    elementaryProcessToLp (commonLeftProcess eta xi) hB T = processToLp eta hB := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  unfold commonLeftProcess elementaryProcessToLp processToLp
  dsimp only
  exact refineDyadic_toLp_eq eta (commonDyadicLevel eta xi) (le_max_left _ _)
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.commonRightProcess_processToLp_eq Compiled Not mapped

No declaration docstring.

theorem commonRightProcess_processToLp_eq
    (eta xi : DyadicElementaryProcess filtration T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    elementaryProcessToLp (commonRightProcess eta xi) hB T = processToLp xi hB := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  unfold commonRightProcess elementaryProcessToLp processToLp
  dsimp only
  exact refineDyadic_toLp_eq xi (commonDyadicLevel eta xi) (le_max_right _ _)
def AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.addDyadic Compiled Not mapped

No declaration docstring.

noncomputable def addDyadic
    (eta xi : DyadicElementaryProcess filtration T) :
    DyadicElementaryProcess filtration T where
  level := commonDyadicLevel eta xi
  process := ElementaryItoAlgebra.add
    (commonLeftProcess eta xi) (commonRightProcess eta xi)
    (commonProcess_times_eq eta xi)
  times_eq := (refineDyadic eta (commonDyadicLevel eta xi) (le_max_left _ _)).times_eq

/-- Scalar multiple on the same dyadic grid. -/
def AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.smulDyadic Compiled Not mapped

- Scalar multiple on the same dyadic grid.

noncomputable def smulDyadic (c : ℝ)
    (eta : DyadicElementaryProcess filtration T) :
    DyadicElementaryProcess filtration T where
  level := eta.level
  process := ElementaryItoAlgebra.smul c eta.process
  times_eq := eta.times_eq
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.terminalToLp_addDyadic Compiled Not mapped

No declaration docstring.

theorem terminalToLp_addDyadic
    (eta xi : DyadicElementaryProcess filtration T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    terminalToLp (addDyadic eta xi) hB =
      terminalToLp eta hB + terminalToLp xi hB := by
  unfold terminalToLp addDyadic
  dsimp only
  rw [elementaryItoTerminalToLp_add]
  rw [commonLeftProcess_terminalToLp_eq eta xi hB,
    commonRightProcess_terminalToLp_eq eta xi hB]
  rfl
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.processToLp_addDyadic Compiled Not mapped

No declaration docstring.

theorem processToLp_addDyadic
    (eta xi : DyadicElementaryProcess filtration T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    processToLp (addDyadic eta xi) hB =
      processToLp eta hB + processToLp xi hB := by
  rw [← elementaryProcessToLp_eq_processToLp (addDyadic eta xi) hB]
  unfold addDyadic
  dsimp only
  rw [elementaryProcessToLp_add]
  rw [commonLeftProcess_processToLp_eq eta xi hB,
    commonRightProcess_processToLp_eq eta xi hB]
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.terminalToLp_smulDyadic Compiled Not mapped

No declaration docstring.

theorem terminalToLp_smulDyadic
    (c : ℝ) (eta : DyadicElementaryProcess filtration T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    terminalToLp (smulDyadic c eta) hB = c • terminalToLp eta hB := by
  change elementaryItoTerminalToLp (ElementaryItoAlgebra.smul c eta.process) hB T =
    c • elementaryItoTerminalToLp eta.process hB T
  apply Lp.ext
  filter_upwards [
    (elementaryItoIntegral_memLp_two
      (ElementaryItoAlgebra.smul c eta.process) hB T).coeFn_toLp,
    Lp.coeFn_smul c (elementaryItoTerminalToLp eta.process hB T),
    (elementaryItoIntegral_memLp_two eta.process hB T).coeFn_toLp]
      with omega hsmul hscale heta
  simp only [elementaryItoTerminalToLp] at hscale ⊢
  rw [hsmul, hscale]
  simp only [Pi.smul_apply, smul_eq_mul]
  rw [heta]
  exact ElementaryItoAlgebra.elementaryItoIntegral_smul c eta.process B T omega
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.processToLp_smulDyadic Compiled Not mapped

No declaration docstring.

theorem processToLp_smulDyadic
    (c : ℝ) (eta : DyadicElementaryProcess filtration T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    processToLp (smulDyadic c eta) hB = c • processToLp eta hB := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  change (toProgressiveL2 (ElementaryItoAlgebra.smul c eta.process) mu T).toLp =
    c • (toProgressiveL2 eta.process mu T).toLp
  exact toLp_smul c eta.process mu T
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.integrandToLp_add Compiled Not mapped

No declaration docstring.

theorem integrandToLp_add
    (eta xi : ProgressiveL2Integrand filtration mu T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    integrandToLp (ProgressiveL2Algebra.add eta xi) hB =
      integrandToLp eta hB + integrandToLp xi hB := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  exact ProgressiveL2Algebra.toLp_add eta xi
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.integrandToLp_neg Compiled Not mapped

No declaration docstring.

theorem integrandToLp_neg
    (eta : ProgressiveL2Integrand filtration mu T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    integrandToLp (ProgressiveL2Algebra.neg eta) hB = -integrandToLp eta hB := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  exact ProgressiveL2Algebra.toLp_neg eta
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.integrandToLp_sub Compiled Not mapped

No declaration docstring.

theorem integrandToLp_sub
    (eta xi : ProgressiveL2Integrand filtration mu T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    integrandToLp (ProgressiveL2Algebra.sub eta xi) hB =
      integrandToLp eta hB - integrandToLp xi hB := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  exact ProgressiveL2Algebra.toLp_sub eta xi
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.integrandToLp_smul Compiled Not mapped

No declaration docstring.

theorem integrandToLp_smul
    (c : ℝ) (eta : ProgressiveL2Integrand filtration mu T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    integrandToLp (ProgressiveL2Algebra.smul c eta) hB = c • integrandToLp eta hB := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  exact ProgressiveL2Algebra.toLp_smul c eta
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.itoIntegralTerminal_congr_toLp Compiled Not mapped

No declaration docstring.

theorem itoIntegralTerminal_congr_toLp
    (eta xi : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu)
    (hEq : integrandToLp eta hB = integrandToLp xi hB) :
    itoIntegralTerminal eta hT hB = itoIntegralTerminal xi hT hB := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  have hxi := tendsto_terminal_of_tendsto_elementary xi hT hB
    (canonicalElementaryApprox eta hT) (by
      change Tendsto (processApprox eta hT hB) atTop (nhds (integrandToLp xi hB))
      simpa only [hEq] using tendsto_processApprox eta hT hB)
  exact tendsto_nhds_unique (tendsto_terminalApprox eta hT hB) hxi
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.itoIntegralTerminal_add Compiled Not mapped

No declaration docstring.

theorem itoIntegralTerminal_add
    (eta xi : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    itoIntegralTerminal (ProgressiveL2Algebra.add eta xi) hT hB =
      itoIntegralTerminal eta hT hB + itoIntegralTerminal xi hT hB := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  let approx : ℕ → DyadicElementaryProcess filtration T := fun n ↦
    addDyadic (canonicalElementaryApprox eta hT n)
      (canonicalElementaryApprox xi hT n)
  have hprocess : Tendsto (fun n ↦ processToLp (approx n) hB) atTop
      (nhds (integrandToLp (ProgressiveL2Algebra.add eta xi) hB)) := by
    have hsum := (tendsto_processApprox eta hT hB).add
      (tendsto_processApprox xi hT hB)
    rw [integrandToLp_add eta xi hB]
    convert hsum using 1
    funext n
    simpa only [approx, processApprox] using
      processToLp_addDyadic (canonicalElementaryApprox eta hT n)
        (canonicalElementaryApprox xi hT n) hB
  have hcompleted := tendsto_terminal_of_tendsto_elementary
    (ProgressiveL2Algebra.add eta xi) hT hB approx hprocess
  have hsum := (tendsto_terminalApprox eta hT hB).add
    (tendsto_terminalApprox xi hT hB)
  have hsequence : (fun n ↦ terminalToLp (approx n) hB) =
      fun n ↦ terminalApprox eta hT hB n + terminalApprox xi hT hB n := by
    funext n
    simpa only [approx, terminalApprox] using
      terminalToLp_addDyadic (canonicalElementaryApprox eta hT n)
        (canonicalElementaryApprox xi hT n) hB
  rw [hsequence] at hcompleted
  exact tendsto_nhds_unique hcompleted hsum
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.itoIntegralTerminal_smul Compiled Not mapped

No declaration docstring.

theorem itoIntegralTerminal_smul
    (c : ℝ) (eta : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    itoIntegralTerminal (ProgressiveL2Algebra.smul c eta) hT hB =
      c • itoIntegralTerminal eta hT hB := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  let approx : ℕ → DyadicElementaryProcess filtration T := fun n ↦
    smulDyadic c (canonicalElementaryApprox eta hT n)
  have hprocess : Tendsto (fun n ↦ processToLp (approx n) hB) atTop
      (nhds (integrandToLp (ProgressiveL2Algebra.smul c eta) hB)) := by
    have hsmul := (tendsto_processApprox eta hT hB).const_smul c
    rw [integrandToLp_smul c eta hB]
    convert hsmul using 1
    funext n
    simpa only [approx, processApprox] using
      processToLp_smulDyadic c (canonicalElementaryApprox eta hT n) hB
  have hcompleted := tendsto_terminal_of_tendsto_elementary
    (ProgressiveL2Algebra.smul c eta) hT hB approx hprocess
  have hsmul := (tendsto_terminalApprox eta hT hB).const_smul c
  have hsequence : (fun n ↦ terminalToLp (approx n) hB) =
      fun n ↦ c • terminalApprox eta hT hB n := by
    funext n
    simpa only [approx, terminalApprox] using
      terminalToLp_smulDyadic c (canonicalElementaryApprox eta hT n) hB
  rw [hsequence] at hcompleted
  exact tendsto_nhds_unique hcompleted hsmul
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.itoIntegralTerminal_zero Compiled Not mapped

No declaration docstring.

theorem itoIntegralTerminal_zero
    (hT : 0 < T) (hB : IsBrownianMotionWithFiltration B filtration mu) :
    itoIntegralTerminal
      (ProgressiveL2Algebra.zero : ProgressiveL2Integrand filtration mu T) hT hB = 0 := by
  apply norm_eq_zero.mp
  rw [itoIntegralTerminal_norm]
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  exact norm_zero
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.itoIntegralTerminal_neg Compiled Not mapped

No declaration docstring.

theorem itoIntegralTerminal_neg
    (eta : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    itoIntegralTerminal (ProgressiveL2Algebra.neg eta) hT hB =
      -itoIntegralTerminal eta hT hB := by
  have hcongr := itoIntegralTerminal_congr_toLp
    (ProgressiveL2Algebra.neg eta) (ProgressiveL2Algebra.smul (-1) eta) hT hB (by
      rw [integrandToLp_neg, integrandToLp_smul]
      simp)
  rw [hcongr, itoIntegralTerminal_smul]
  simp
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.itoIntegralTerminal_sub Compiled Not mapped

No declaration docstring.

theorem itoIntegralTerminal_sub
    (eta xi : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    itoIntegralTerminal (ProgressiveL2Algebra.sub eta xi) hT hB =
      itoIntegralTerminal eta hT hB - itoIntegralTerminal xi hT hB := by
  have hcongr := itoIntegralTerminal_congr_toLp
    (ProgressiveL2Algebra.sub eta xi)
    (ProgressiveL2Algebra.add eta (ProgressiveL2Algebra.neg xi)) hT hB (by
      rw [integrandToLp_sub, integrandToLp_add, integrandToLp_neg]
      rfl)
  rw [hcongr, itoIntegralTerminal_add, itoIntegralTerminal_neg]
  simp only [sub_eq_add_neg]

/-- Progressive integrand induced by an elementary process in the Brownian
probability environment. -/
def AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.elementaryIntegrand Compiled Not mapped

- Progressive integrand induced by an elementary process in the Brownian probability environment.

noncomputable def elementaryIntegrand
    (eta : DyadicElementaryProcess filtration T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    ProgressiveL2Integrand filtration mu T := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  exact toProgressiveL2 eta.process mu T
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.itoIntegralTerminal_elementary Compiled Not mapped

No declaration docstring.

theorem itoIntegralTerminal_elementary
    (eta : DyadicElementaryProcess filtration T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    itoIntegralTerminal (elementaryIntegrand eta hB)
        (DyadicElementaryProcess.horizon_pos eta) hB = terminalToLp eta hB := by
  let _ : IsProbabilityMeasure mu := hB.isProbabilityMeasure
  have hprocess : Tendsto (fun _ : ℕ ↦ processToLp eta hB) atTop
      (nhds (integrandToLp (elementaryIntegrand eta hB) hB)) := by
    have heq : processToLp eta hB =
        integrandToLp (elementaryIntegrand eta hB) hB := rfl
    simpa only [heq] using
      (tendsto_const_nhds : Tendsto (fun _ : ℕ ↦ processToLp eta hB) atTop
        (nhds (processToLp eta hB)))
  have hcompleted := tendsto_terminal_of_tendsto_elementary
    (elementaryIntegrand eta hB) (DyadicElementaryProcess.horizon_pos eta)
      hB (fun _ ↦ eta) hprocess
  exact tendsto_nhds_unique hcompleted tendsto_const_nhds

/-- Distance form of the completed Ito isometry. -/
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.itoIntegralTerminal_isometry_sub Compiled Not mapped

- Distance form of the completed Ito isometry.

theorem itoIntegralTerminal_isometry_sub
    (eta xi : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    ‖itoIntegralTerminal eta hT hB - itoIntegralTerminal xi hT hB‖ =
      ‖integrandToLp eta hB - integrandToLp xi hB‖ := by
  rw [← itoIntegralTerminal_sub, itoIntegralTerminal_norm, integrandToLp_sub]

/-- The completed terminal map preserves the real Hilbert inner product. -/
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.itoIntegralTerminal_inner Compiled Not mapped

- The completed terminal map preserves the real Hilbert inner product.

theorem itoIntegralTerminal_inner
    (eta xi : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    ⟪itoIntegralTerminal eta hT hB, itoIntegralTerminal xi hT hB⟫_ℝ =
      ⟪integrandToLp eta hB, integrandToLp xi hB⟫_ℝ := by
  rw [real_inner_eq_norm_add_mul_self_sub_norm_mul_self_sub_norm_mul_self_div_two,
    real_inner_eq_norm_add_mul_self_sub_norm_mul_self_sub_norm_mul_self_div_two,
    ← itoIntegralTerminal_add, ← integrandToLp_add,
    itoIntegralTerminal_norm, itoIntegralTerminal_norm, itoIntegralTerminal_norm]

/-- Total horizon interface: the positive-horizon completion and the unique
zero integral on a degenerate horizon. -/
def AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.itoIntegralTerminalOnHorizon Compiled Not mapped

- Total horizon interface: the positive-horizon completion and the unique zero integral on a degenerate horizon.

noncomputable def itoIntegralTerminalOnHorizon
    (eta : ProgressiveL2Integrand filtration mu T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) : Lp ℝ 2 mu :=
  if hT : 0 < T then itoIntegralTerminal eta hT hB else 0
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.itoIntegralTerminalOnHorizon_of_pos Compiled Not mapped

No declaration docstring.

theorem itoIntegralTerminalOnHorizon_of_pos
    (eta : ProgressiveL2Integrand filtration mu T) (hT : 0 < T)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    itoIntegralTerminalOnHorizon eta hB = itoIntegralTerminal eta hT hB := by
  simp [itoIntegralTerminalOnHorizon, hT]
theorem AutoSamplingTheory.TechnicalLemmas.StochasticProcesses.ItoTerminalCompletion.itoIntegralTerminal_zero_horizon Compiled Not mapped

No declaration docstring.

theorem itoIntegralTerminal_zero_horizon
    (eta : ProgressiveL2Integrand filtration mu T) (hzero : T = 0)
    (hB : IsBrownianMotionWithFiltration B filtration mu) :
    itoIntegralTerminalOnHorizon eta hB = 0 := by
  subst T
  simp [itoIntegralTerminalOnHorizon]

end ItoTerminalCompletion
end StochasticProcesses
end TechnicalLemmas
end AutoSamplingTheory