21.8. Why it matters: classification and metrological consistency at the quantity level
Formalizing a remark's mathematics is not decoration. It earns its keep by turning the quantity-kind into a working classifier and by moving metrological checking down to the quantity level, where the type system enforces it.
Classifying quantities. The surface-area formula does not return a bare real number:
its output is, by construction, a magnitude of the one catalogued kind area. Any
quantity a downstream model computes this way — the area of a field, a footprint, a
cross-section — is automatically classified as the same kind, dimension L², unit the
square metre. The kind is the genus under which every such quantity falls, and the
defining relation is what places it there. So formalizing the remark gives users a
principled answer to "what is this quantity?" — it is a value of area, because the
relation that produced it is area's defining relation.
Verifying metrological consistency. Because the kind carries its dimension and its own
scalar unit, the consistency checks happen at the quantity level and cannot be skipped.
Two areas combine — addition is defined on the area carrier — but an area and a length
are different types, so adding them does not type-check: the dimensionless numeric
conflation a spreadsheet would silently allow is rejected. An area is not measurable in
metres, because the square metre and the metre are not commensurable, a fact of the
types rather than a runtime guard. And the dimensional invariant L² travels with
every value of the kind. The remark's mathematics, the kind, and these consistency
guarantees are thus one chain: the relation anchors the kind, the kind classifies the
quantity, and the classification is the metrological check.
These claims are exercised as checked facts in the DimensionExamples library: a
surface area built from the analytic element and classified as an area quantity, the
L² invariant, the area-plus-area combination, and the rejected area-versus-length and
square-metre-versus-metre conflations.
This is the verified instantiation requirement (R12): a classification is a certificate that a quantity satisfies its kind's defining relation, not a bare tag. For area, the defining relation is the surface element above, and it yields two concrete certificate forms.
A rectangle's area is verified-classified by construction. rectangleArea w h is built
as the product of two lengths (area = length · length), so its area-classification
certificate holds by construction.
Lean code for Theorem21.8.1●1 theorem
Associated Lean declarations
-
theoremdefined in PropertyKindCalculus/Iso80000/Part3/AreaClassification.leancomplete
theorem PropertyKindCalculus.Iso80000.Part3.AreaClassification.rectangleArea_isProduct (w h : PropertyKindCalculus.Quantity (PropertyKindCalculus.Iso80000.Part3.length.kind LTMCTDimensionBase) ℝ) : PropertyKindCalculus.Quantity.IsProduct PropertyKindCalculus.Iso80000.Part3.AreaClassification.area_is_length_times_length (PropertyKindCalculus.Iso80000.Part3.AreaClassification.rectangleArea w h) w h
theorem PropertyKindCalculus.Iso80000.Part3.AreaClassification.rectangleArea_isProduct (w h : PropertyKindCalculus.Quantity (PropertyKindCalculus.Iso80000.Part3.length.kind LTMCTDimensionBase) ℝ) : PropertyKindCalculus.Quantity.IsProduct PropertyKindCalculus.Iso80000.Part3.AreaClassification.area_is_length_times_length (PropertyKindCalculus.Iso80000.Part3.AreaClassification.rectangleArea w h) w h
The rectangle-area certificate holds by construction.
rectangleArea w h := Quantity.mul area_is_length_times_length w h, and
rectangleArea_isProduct is rfl — the certificate of the constructed product.
Property transport. Every certified surface area is non-negative — the surface element
is ≥ 0 (a property of area's defining relation), instantiated at the quantity level
through the certificate.
Lean code for Theorem21.8.2●1 theorem
Associated Lean declarations
-
theoremdefined in PropertyKindCalculus/Iso80000/Part3/AreaClassification.leancomplete
theorem PropertyKindCalculus.Iso80000.Part3.AreaClassification.certified_surfaceArea_nonneg {q : PropertyKindCalculus.Quantity (PropertyKindCalculus.Iso80000.Part3.area.kind LTMCTDimensionBase) ℝ} {t : ℝ × ℝ → Fin 2 → EuclideanSpace ℝ (Fin 2)} {s : Set (ℝ × ℝ)} (hs : MeasurableSet s) (h : PropertyKindCalculus.Iso80000.Part3.AreaClassification.IsSurfaceArea q t s) : 0 ≤ q.magnitude
theorem PropertyKindCalculus.Iso80000.Part3.AreaClassification.certified_surfaceArea_nonneg {q : PropertyKindCalculus.Quantity (PropertyKindCalculus.Iso80000.Part3.area.kind LTMCTDimensionBase) ℝ} {t : ℝ × ℝ → Fin 2 → EuclideanSpace ℝ (Fin 2)} {s : Set (ℝ × ℝ)} (hs : MeasurableSet s) (h : PropertyKindCalculus.Iso80000.Part3.AreaClassification.IsSurfaceArea q t s) : 0 ≤ q.magnitude
**Property transport (R12).** *Every* certified surface area is non-negative — a property of area's defining relation, instantiated at the quantity level via the certificate.
certified_surfaceArea_nonneg rewrites the certificate q.magnitude = surfaceArea t s
and applies surfaceArea_nonneg (the integral of a non-negative element, by
setIntegral_nonneg and areaElement_nonneg).