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

The trace of a rank-one derivative term is its scalar evaluation

AutoSamplingTheory.TechnicalLemmas.Analysis.Calculus.Divergence.sum_smulRight_apply_pi_single_eq_apply · theorem · Teaching coverage

Read this first

Mathematical statement

For a finite coordinate type ι, a continuous real linear functional ℓ:(ι→ℝ)→ℝ and a vector g∈(ι→ℝ), the diagonal sum of the rank-one operator v↦ℓ(v)g equals ℓ(g).

\[\sum_i\bigl((\ell\otimes g)e_i\bigr)_i=\ell(g),\qquad(\ell\otimes g)(v):=\ell(v)g.\]
Lean statement · sum_smulRight_apply_pi_single_eq_apply

`smulRight G` constructs the rank-one continuous linear map. The prime in χ′ is merely a variable name here; no scalar function with that derivative is assumed.

Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

theorem sum_smulRight_apply_pi_single_eq_apply
    {ι : Type*} [Fintype ι] [DecidableEq ι]
    (χ' : (ι → ℝ) →L[ℝ] ℝ) (G : ι → ℝ) :
    ∑ i, ((χ'.smulRight G) (Pi.single i (1 : ℝ))) i = χ' G

Exact module and namespace context

Proof roadmap

  1. 1Identify each diagonal term

    The i-th component of ℓ(e_i)g is ℓ(e_i)g_i. By linearity and commutativity of real multiplication this equals ℓ(g_i e_i).

  2. 2Reassemble the vector inside the linear functional

    Move the finite sum inside ℓ. The standard coordinate expansion gives Σ_i g_i e_i=g, yielding ℓ(g).

Full assumptions and notation

All objects and hypotheses

  • ι is a finite type with Fintype and DecidableEq; empty ι is allowed.
  • P=(ι→ℝ), ℓ:P→L[ℝ]ℝ, and g∈P; no differentiability or measure.

Mathematical proof

1. Identify each diagonal term

The i-th component of ℓ(e_i)g is ℓ(e_i)g_i. By linearity and commutativity of real multiplication this equals ℓ(g_i e_i).

\[\bigl((\ell\otimes g)e_i\bigr)_i=\ell(e_i)g_i=\ell(g_i e_i).\]
Corresponding Lean step

ContinuousLinearMap.smulRight_apply; Pi.smul_apply; smul_eq_mul; mul_comm.

2. Reassemble the vector inside the linear functional

Move the finite sum inside ℓ. The standard coordinate expansion gives Σ_i g_i e_i=g, yielding ℓ(g).

\[\sum_i\ell(g_i e_i)=\ell\!\left(\sum_i g_i e_i\right)=\ell(g).\]
Corresponding Lean step

map_sum; pi_eq_sum_univ' G.

Lean verification

The exact proof begins folded immediately after the mathematical argument; the statement is folded beside the claim above.

Lean proof · sum_smulRight_apply_pi_single_eq_apply

The source first the i-th component of ℓ(e_i)g is ℓ(e_i)g_i. By linearity and commutativity of real multiplication this equals ℓ(g_i e_i). It finishes as follows: Move the finite sum inside ℓ. The standard coordinate expansion gives Σ_i g_i e_i=g, yielding ℓ(g). Intermediate steps below identify the actual helper calls and the conditions each one needs.

Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

Download module (.lean)
theorem sum_smulRight_apply_pi_single_eq_apply
    {ι : Type*} [Fintype ι] [DecidableEq ι]
    (χ' : (ι → ℝ) →L[ℝ] ℝ) (G : ι → ℝ) :
    ∑ i, ((χ'.smulRight G) (Pi.single i (1 : ℝ))) i = χ' G := by
  calc
    ∑ i, ((χ'.smulRight G) (Pi.single i (1 : ℝ))) i =
        ∑ i, χ' ((G i) • Pi.single (M := fun _ : ι => ℝ) i (1 : ℝ)) := by
      apply Finset.sum_congr rfl
      intro i _hi
      simp [ContinuousLinearMap.smulRight_apply, Pi.smul_apply, smul_eq_mul,
        mul_comm]
    _ = χ' (∑ i, (G i) • Pi.single (M := fun _ : ι => ℝ) i (1 : ℝ)) := by
      rw [map_sum]
    _ = χ' G := by rw [← pi_eq_sum_univ' G]

Exact module and namespace context

Scope and omitted-condition boundaries
  • Pure linear algebra, not a divergence product theorem by itself.
Sources, dependencies, and reuse

Source and reuse

Samplinglib parents called

    Mathlib API called (external library)

    • ContinuousLinearMap.smulRight_apply
    • map_sum
    • pi_eq_sum_univ'

    Mathematical sources

    Samplinglib prose is not a quotation or a source-equivalence certificate. Definitions and aliases are explained as constructions, not counted as new mathematical proofs.