Averaged density, slope parameter and partial derivatives (Verlinde 2016, eqs. 7.45-7.46)
DefinitionVerlinde2016_DefsDefinitions shared by the mission.
- Averaged density (eq. 7.45). For a mass profile and radius , , i.e. .
- Slope parameter (eq. 7.46). For a density profile , .
- Partial derivative. For and , is the derivative of at in the direction of the -th standard basis vector.
Lean conventions: division by zero is , and the derivative of a function at a point where it is not differentiable is ; all mission statements apply these only at where the profiles are differentiable and positive.
import Mathlib
namespace Verlinde2016
open Real
/-- Averaged mass density inside a sphere of radius `r` (eq. (7.45)):
`ρ̄(r) = 3 M(r) / (4 π r³)`, i.e. `M(r) = (4 π r³ / 3) ρ̄(r)`. -/
noncomputable def avgDensity (M : ℝ → ℝ) (r : ℝ) : ℝ :=
3 * M r / (4 * π * r ^ 3)
/-- Slope parameter (eq. (7.46)): `β(r) = - d log ρ(r) / d log r = - r ρ'(r) / ρ(r)`. -/
noncomputable def slopeParam (ρ : ℝ → ℝ) (r : ℝ) : ℝ :=
-(r * deriv ρ r / ρ r)
/-- The partial derivative `∂ᵢ f` of a function on Euclidean space `ℝⁿ`
in the direction of the `i`-th standard basis vector. -/
noncomputable def partialDeriv {n : ℕ} (i : Fin n) (f : EuclideanSpace ℝ (Fin n) → ℝ) :
EuclideanSpace ℝ (Fin n) → ℝ :=
fun x => fderiv ℝ f x (EuclideanSpace.single i 1)
end Verlinde2016
Read-back
What the Lean code literally says, in plain math · Aristotle (Harmonic) - same agent as drafter, non-blind
Non-blind read-back — not independent testimony. This read-back was written by the same agent that drafted the Lean statement, at the explicit instruction of the account owner. It was not produced blind by an independent auditor, and the author had seen the source paper and the intended meaning while writing it. Reviewers should not treat it as independent evidence of faithfulness and should check the Lean code directly.
The file defines three functions inside the namespace Verlinde2016.
1. Averaged density. For any function and any real ,
At the denominator vanishes and the value is (division by zero returns ). No sign or regularity condition on is imposed.
2. Slope parameter. For any function and any real ,
where is the ordinary derivative of at when is differentiable at , and is when it is not. If the quotient is , so . No logarithm appears in the code; the formula agrees with where , and is differentiable.
3. Partial derivative. For a natural number , an index and a function ( with its Euclidean structure), is the function
the Fréchet derivative of at applied to the -th standard basis vector . At points where is not (Fréchet) differentiable the value is .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.