Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Chapter EulerGenericDensity

Definition
ChapterEulerGenericDensity

by leonardopedro · Oct 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

definitionsformalizationtimepiece

Formal definitions for the timepiece Lean 4 formalization (source chapter BookProof/ChapterEulerGenericDensity.lean): generated def bundle for ChapterEulerGenericDensity. See BookProof/ChapterEulerGenericDensity.lean for full context.

Definition code
import Mathlib


/-!
# Chapter — Euler's formula for a generic phase-space (density-matrix recursion)

Formalization of the *density-matrix* identity in `book.tex`, chapter
*"Wave-function collapse versus Euler's formula"*, §§*"Euler's formula for a
phase-space with 4 states"* and *"Euler's formula for a generic phase-space"*
(`book.tex` lines ~3478 and ~3565).

The book parametrizes a normalized wave-function recursively as
`vₙ = cₙ·lₙ + sₙ·vₙ₊₁`, with `cₙ = cos θₙ`, `sₙ = sin θₙ`, and `{lₙ}` an
orthonormal basis, and writes the projector `vₙ vₙ†` in *Euler form*:

> `vₙ vₙ† = ½ + ½(lₙ lₙ† − vₙ₊₁ vₙ₊₁†)(cos 2θₙ + Jₙ sin 2θₙ)`,
>   where `Jₙ = lₙ vₙ₊₁† − vₙ₊₁ lₙ†` plays the role of the imaginary unit in the
>   2-dimensional subspace generated by `{lₙ, vₙ₊₁}`,

and describes collapse as *"suppressing the off-diagonal `Jₙ`-proportional
terms"*, leaving the diagonal operator
`diag(vₙ vₙ†) = cₙ² lₙ lₙ† + sₙ² vₙ₊₁ vₙ₊₁†` representing the classical
conditional-probability recursion.

This module formalizes the self-contained algebraic core of that "single
recursion step" for *arbitrary* orthonormal real vectors `l, w` in `Fin d → ℝ`
(any finite dimension `d`), where `w` plays the role of `vₙ₊₁`.  It generalizes
`BookProof.ChapterEulerDensityMatrix` (the concrete 2-state `2×2` case) to the
recursion step over an arbitrary orthonormal pair in any dimension.

All results are `sorry`-free and `axiom`-clean (only `propext`,
`Classical.choice`, `Quot.sound`).

## Definitions

* `eulerVec θ l w` — the wave-function `v = cos θ · l + sin θ · w`.
* `Jgen l w` — the "imaginary unit" `J = l wᵀ − w lᵀ` of the `{l, w}` subspace.

## Results

* `vecMulVec_mul_vecMulVec` — outer-product multiplication
  `(u vᵀ)(x yᵀ) = (v · x)·(u yᵀ)`.
* `eulerVec_unit` — `v` is a unit vector (`v · v = 1`).
* `outer_eulerVec` — the density matrix expanded:
  `v vᵀ = c²·llᵀ + s²·wwᵀ + cs·(lwᵀ + wlᵀ)`.
* `Jgen_sq` — `J² = −(llᵀ + wwᵀ)` (`J` is the imaginary unit of the subspace).
* `Jgen_mul` — `(llᵀ − wwᵀ)·J = lwᵀ + wlᵀ` (the off-diagonal generator).
* **HEADLINE `density_euler_generic`** — the projector in Euler form
  `v vᵀ = ½·(llᵀ + wwᵀ) + (cos 2θ)/2·(llᵀ − wwᵀ) + (sin 2θ)/2·((llᵀ − wwᵀ)·J)`.
* **`density_collapse_generic`** — removing the `J`-proportional part yields the
  diagonal recursion `cos²θ·llᵀ + sin²θ·wwᵀ` (the book's collapse rule).
* `density_trace` (`tr = 1`), `density_symm` (`ρᵀ = ρ`), `density_idempotent`
  (`ρ² = ρ`: a projector / pure state).
-/

open scoped Matrix
open Matrix

namespace BookProof.ChapterEulerGenericDensity

variable {d : ℕ}



/-- The Euler wave-function `v = cos θ · l + sin θ · w` for the recursion step. -/
noncomputable def eulerVec (θ : ℝ) (l w : Fin d → ℝ) : Fin d → ℝ :=
  Real.cos θ • l + Real.sin θ • w

/-- The matrix `J = l wᵀ − w lᵀ` that plays the role of the imaginary unit in the
2-dimensional subspace generated by `{l, w}`. -/
def Jgen (l w : Fin d → ℝ) : Matrix (Fin d) (Fin d) ℝ :=
  Matrix.vecMulVec l w - Matrix.vecMulVec w l























end BookProof.ChapterEulerGenericDensity
Source
https://github.com/leonardopedro/timepiece/blob/61595bc/BookProof/ChapterEulerGenericDensity.lean

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me