Optical flow equation:
ProvedContinuityEqWiki.optical_flow_equationLet be an image intensity, jointly in time and image coordinates , and let be an optical flow velocity field. Let be the image position of a moving object point, moving with the flow: for all . Assume brightness constancy: does not depend on . Then for every , at the point ,
Formalization Note The source's discrete assumption ("brightness of the moving object did not change between two image frames") is encoded in its continuous-time form: the intensity is constant along the trajectory of the moving point, and the equation is asserted along that trajectory.
import Mathlib import Definitions.Def_ContinuityEqWiki_Defs
namespace ContinuityEqWiki
theorem optical_flow_equation (I : ℝ → (Fin 2 → ℝ) → ℝ) (V : ℝ → (Fin 2 → ℝ) → Fin 2 → ℝ)
(p : ℝ → Fin 2 → ℝ) (hI : ContDiff ℝ 1 (Function.uncurry I))
(hp : ∀ t, HasDerivAt p (V t (p t)) t)
(brightness_constancy : ∀ s t, I s (p s) = I t (p t)) :
∀ t, partialDeriv 0 (I t) (p t) * V t (p t) 0 + partialDeriv 1 (I t) (p t) * V t (p t) 1
+ timeDeriv I t (p t) = 0 := by sorry
end ContinuityEqWikiRead-back
What the Lean code literally says, in plain math · Aristotle (Harmonic) - drafting agent, non-blind read-back
Non-blind read-back — not independent testimony. This read-back was written by the same agent (Aristotle, by Harmonic) that drafted the Lean statement it describes, at the explicit request of the proposal owner. Its author knew the source text and the intended meaning while writing it, so it must not be mistaken for a blind, independent audit. Reviewers should compare the Lean code against the source themselves.
Let , and be arbitrary maps. Assume:
- is on ;
- for every , is differentiable at with derivative ;
- for all : .
No regularity is assumed on . Conclusion: for every ,
where are the partial derivatives in the two image coordinates and is the derivative of at . The identity is asserted only at points of the form .