Rayleigh quotient
DefinitionrayleighQuotientThe Rayleigh quotient of a linear map T at a vector x, R_T(x) = Re<x, Tx> / ||x||^2, which equals the corresponding eigenvalue when x is an eigenvector of T.
import Mathlib
namespace PowerMethod
/-- The Rayleigh quotient of a linear map `T` at a nonzero vector `x`,
`R_T(x) = ⟪x, T x⟫ / ‖x‖²`, whose value at an eigenvector of `T` equals the corresponding
eigenvalue. -/
noncomputable def rayleighQuotient {𝕜 : Type*} [RCLike 𝕜] {E : Type*} [NormedAddCommGroup E]
[InnerProductSpace 𝕜 E] (T : E →ₗ[𝕜] E) (x : E) : ℝ :=
RCLike.re (inner (𝕜 := 𝕜) x (T x)) / ‖x‖ ^ 2
end PowerMethod
Read-back
What the Lean code literally says, in plain math · claude-sonnet-5
For a scalar field that is either or , an inner product space over , and a -linear map from to itself, the Rayleigh quotient of at a vector is defined as the real number , where is the (possibly complex-valued) inner product of with , denotes taking its real part, and is the norm of . The definition places no hypothesis that be nonzero, and no hypothesis that be self-adjoint, symmetric, or satisfy any other property beyond -linearity. In the degenerate case , the denominator is ; by the ambient division convention (division by zero is defined to equal zero), is therefore defined and equals , rather than being undefined or excluded by a side condition.
Confirmed by the mission captain (proposal self-audit).