10.2. Verified classification and instantiable kind-laws (R12)
A quantity Quantity k R records its kind k as a tag:
the magnitude is an arbitrary R, so a value can be labelled with a kind it has not
earned (⟨999⟩ type-checks as an area). R12 upgrades a classification from an
assertion to a certificate: a quantity is classified under a kind by a proof that
it satisfies the kind's defining relation — the formalized ISO 80000 Remark — to
quantities of the kinds it is built from. The kind becomes a refinement (a tag plus
its earned proof), not a label.
The payoff is instantiation. Every kind-law is stated as a carrier-parametric universal over quantities with the kind-relation as a premise; "instantiating it at the quantity level" is then ordinary application, and any property of a kind's defining relation transports to every quantity certified under it. This is the inter-kind generalization of the carrier-parametric laws of R10.
-
PropertyKindCalculus.ProductKind[complete]
A product kind-law ProductKind k₁ k₂ k records that k is the product kind of
k₁ and k₂. In the core it carries the scale precondition — all three are
ratio-scale, since only ratio quantities multiply (Dybkær §13.3.5); the dimension
layer refines it with the dimensional equation k.\dim = k_1.\dim \cdot k_2.\dim.
Lean code for Definition10.2.1●1 definition
Associated Lean declarations
-
PropertyKindCalculus.ProductKind[complete]
-
PropertyKindCalculus.ProductKind[complete]
-
structuredefined in PropertyKindCalculus/QuantityClassification.leancomplete
structure PropertyKindCalculus.ProductKind (k₁ k₂ k : PropertyKindCalculus.KindOfProperty) : Prop
structure PropertyKindCalculus.ProductKind (k₁ k₂ k : PropertyKindCalculus.KindOfProperty) : Prop
**A kind-level product law.** `k` is the *product kind* of `k₁` and `k₂`: all three are ratio-scale (Dybkær §13.3.5 — only ratio quantities multiply), the precondition for forming a product quantity. The Dimension layer strengthens this with the dimensional equation `k.dim = k₁.dim * k₂.dim`; in the core it carries the scale precondition.
Fields
ratio₁ : k₁.IsRational
The first factor is ratio-scale.
ratio₂ : k₂.IsRational
The second factor is ratio-scale.
ratioProduct : k.IsRational
The product is ratio-scale.
Realized as structure ProductKind with three IsRational fields. A concrete law
such as area = length · length is the value ⟨rfl, rfl, rfl⟩.
-
PropertyKindCalculus.Quantity.IsProduct[complete]
The certificate q.IsProduct h a b states that q (of kind k) is the product of
a (of k₁) and b (of k₂): its magnitude is the product of theirs. A proof of
this certifies q's classification, rather than asserting it. It is a separate
proposition, so Quantity stays a clean tag and certificates
are carried only when needed. The smart constructor Quantity.mul yields a quantity
whose certificate holds by construction.
Lean code for Definition10.2.2●1 definition
Associated Lean declarations
-
PropertyKindCalculus.Quantity.IsProduct[complete]
-
PropertyKindCalculus.Quantity.IsProduct[complete]
-
defdefined in PropertyKindCalculus/QuantityClassification.leancomplete
def PropertyKindCalculus.Quantity.IsProduct {R : Type} [Mul R] [PropertyKindCalculus.ScalarCarrier R] {k₁ k₂ k : PropertyKindCalculus.KindOfProperty} (_h : PropertyKindCalculus.ProductKind k₁ k₂ k) (q : PropertyKindCalculus.Quantity k R) (a : PropertyKindCalculus.Quantity k₁ R) (b : PropertyKindCalculus.Quantity k₂ R) : Prop
def PropertyKindCalculus.Quantity.IsProduct {R : Type} [Mul R] [PropertyKindCalculus.ScalarCarrier R] {k₁ k₂ k : PropertyKindCalculus.KindOfProperty} (_h : PropertyKindCalculus.ProductKind k₁ k₂ k) (q : PropertyKindCalculus.Quantity k R) (a : PropertyKindCalculus.Quantity k₁ R) (b : PropertyKindCalculus.Quantity k₂ R) : Prop
**The certificate.** `q` (of kind `k`) is the product of `a` (of `k₁`) and `b` (of `k₂`): its magnitude is the product of theirs. A proof of this *certifies* `q`'s classification as `k`, rather than merely asserting it. Kept a separate `Prop` so `Quantity` stays a clean tag and certificates are carried only when needed.
Quantity.IsProduct h q a b := q.magnitude = a.magnitude * b.magnitude over a carrier
with multiplication; Quantity.mul h a b := ⟨a.magnitude * b.magnitude⟩, and
mul_isProduct is rfl.
A kind-law that instantiates at the quantity level. A quantity certified as the
product of a and b is unique — and any certified product equals the
smart-constructed one (eq_mul_of_isProduct, canonicity). Supplying concrete
quantities gives the quantity-level fact by application. Axiom-free.
Lean code for Theorem10.2.3●1 theorem
Associated Lean declarations
-
theoremdefined in PropertyKindCalculus/QuantityClassification.leancomplete
theorem PropertyKindCalculus.Quantity.isProduct_unique {R : Type} [Mul R] [PropertyKindCalculus.ScalarCarrier R] {k₁ k₂ k : PropertyKindCalculus.KindOfProperty} (h : PropertyKindCalculus.ProductKind k₁ k₂ k) {q q' : PropertyKindCalculus.Quantity k R} {a : PropertyKindCalculus.Quantity k₁ R} {b : PropertyKindCalculus.Quantity k₂ R} (hq : PropertyKindCalculus.Quantity.IsProduct h q a b) (hq' : PropertyKindCalculus.Quantity.IsProduct h q' a b) : q = q'
theorem PropertyKindCalculus.Quantity.isProduct_unique {R : Type} [Mul R] [PropertyKindCalculus.ScalarCarrier R] {k₁ k₂ k : PropertyKindCalculus.KindOfProperty} (h : PropertyKindCalculus.ProductKind k₁ k₂ k) {q q' : PropertyKindCalculus.Quantity k R} {a : PropertyKindCalculus.Quantity k₁ R} {b : PropertyKindCalculus.Quantity k₂ R} (hq : PropertyKindCalculus.Quantity.IsProduct h q a b) (hq' : PropertyKindCalculus.Quantity.IsProduct h q' a b) : q = q'
**A kind-law that instantiates at the quantity level.** A quantity certified as the product of `a` and `b` is unique — supply any concrete `a`, `b` to get the quantity-level fact by application.
isProduct_unique rewrites both magnitudes to a.magnitude * b.magnitude and closes
by structure η; eq_mul_of_isProduct is isProduct_unique against mul_isProduct.
Both depend on no axioms.
-
PropertyKindCalculus.QuotientKind[complete]
A quotient kind-law QuotientKind k₁ k₂ k records that k is the quotient kind
k = k₁ / k₂ (speed = length / duration; plane angle = arc / radius, where the lengths
cancel). Like the product, it carries the ratio-scale precondition in the core and is
refined by k.dim = k₁.dim / k₂.dim in the dimension layer. Its certificate
Quantity.IsQuotient and smart constructor Quantity.div mirror the product family
exactly, over the core Div class.
Lean code for Definition10.2.4●1 definition
Associated Lean declarations
-
PropertyKindCalculus.QuotientKind[complete]
-
PropertyKindCalculus.QuotientKind[complete]
-
structuredefined in PropertyKindCalculus/QuantityClassification.leancomplete
structure PropertyKindCalculus.QuotientKind (k₁ k₂ k : PropertyKindCalculus.KindOfProperty) : Prop
structure PropertyKindCalculus.QuotientKind (k₁ k₂ k : PropertyKindCalculus.KindOfProperty) : Prop
**A kind-level quotient law.** `k` is the *quotient kind* of `k₁` by `k₂` (`k = k₁ / k₂`): all three are ratio-scale (the precondition for dividing quantities, Dybkær §13.3.5). The Dimension layer strengthens this with `k.dim = k₁.dim / k₂.dim`.
Fields
ratio₁ : k₁.IsRational
The dividend is ratio-scale.
ratio₂ : k₂.IsRational
The divisor is ratio-scale.
ratioQuotient : k.IsRational
The quotient is ratio-scale.
structure QuotientKind with three IsRational fields; Quantity.div h a b :=
⟨a.magnitude / b.magnitude⟩, div_isQuotient is rfl, and isQuotient_unique /
eq_div_of_isQuotient are the product family's proofs transcribed. Axiom-free.
-
PropertyKindCalculus.ReciprocalKind[complete]
A reciprocal kind-law ReciprocalKind k₁ k records that k = 1 / k₁ (frequency =
1 / period; curvature = 1 / radius; repetency = 1 / wavelength) — the unary special
case, over the core Inv class, refined by k.dim = (k₁.dim)⁻¹. All three families
(product, quotient, reciprocal) stay Mathlib-free, using only toolchain-level
arithmetic classes.
Lean code for Definition10.2.5●1 definition
Associated Lean declarations
-
PropertyKindCalculus.ReciprocalKind[complete]
-
PropertyKindCalculus.ReciprocalKind[complete]
-
structuredefined in PropertyKindCalculus/QuantityClassification.leancomplete
structure PropertyKindCalculus.ReciprocalKind (k₁ k : PropertyKindCalculus.KindOfProperty) : Prop
structure PropertyKindCalculus.ReciprocalKind (k₁ k : PropertyKindCalculus.KindOfProperty) : Prop
**A kind-level reciprocal law.** `k` is the *reciprocal kind* of `k₁` (`k = 1 / k₁`): both ratio-scale (the precondition for inverting a quantity). The Dimension layer strengthens this with `k.dim = (k₁.dim)⁻¹`.
Fields
ratio₁ : k₁.IsRational
The base kind is ratio-scale.
ratioReciprocal : k.IsRational
The reciprocal is ratio-scale.
structure ReciprocalKind with two IsRational fields; Quantity.recip h a :=
⟨a.magnitude⁻¹⟩, recip_isReciprocal is rfl, with isReciprocal_unique /
eq_recip_of_isReciprocal as before. Axiom-free.