The planar field
DefinitionVectorCalculus_angleFieldThe planar vector field
singular at the origin, whose natural potential is the polar angle . It is written here as a function defined on all of , its value at the origin being by the convention that division by zero yields zero.
import Mathlib namespace VectorCalculus /-- The planar vector field `F = (-y/(x²+y²), x/(x²+y²))`, written as a total function on `ℝ²`; at the origin both components evaluate to `0` because division by zero is `0`. -/ noncomputable def angleField : (Fin 2 → ℝ) → (Fin 2 → ℝ) := fun z => ![-z 1 / ((z 0) ^ 2 + (z 1) ^ 2), z 0 / ((z 0) ^ 2 + (z 1) ^ 2)] end VectorCalculus
Read-back
What the Lean code literally says, in plain math · Aristotle (Harmonic)
Provenance: non-blind read-back, not independent testimony. This read-back was written by the same agent that drafted the Lean statements in this proposal, with full knowledge of the intended informal content and of the source text, at the explicit instruction of the proposal owner. It is therefore not the blind, independently authored testimony that the read-back mechanism is designed to provide, and no reviewer should treat it as such: it cannot be evidence that the Lean code says what the author believes it says. Please audit the Lean code directly against the cited source.
The declaration defines a single function from to , where is realised as the functions from a two-element index type into . Writing a point as , the value is the pair
the first entry being the coordinate with index and the second the coordinate with index . Note the signs: the index- entry carries the minus sign and the second coordinate in its numerator, while the index- entry is positive with numerator ; the common denominator is the sum of the squares of the two coordinates.
The function is total. At the origin the denominator is , and under the convention that division by zero returns zero both entries evaluate to ; the function is therefore defined, with value , at the origin, where it is not continuous. At every other point the formula is the ordinary quotient of real numbers.