Documentation

PropertyKindCalculus.Examples.MiniWriteOnce

Step 1 — Start from the measurement principle: declare the kinds #

Name what each quantity is by the examination that produces it. Each is a bare KindOfProperty, named for the instrument or principle that examines it — the radar backscatter σ⁰, the optical vegetation index, the surface reflectivity, and the three Mironov-2009 dielectric fit constants used in Step 3.

Theorems about this kind

  • PropertyKindCalculus.Examples.MiniWriteOnce.cholRowQ_magnitudes

Mironov dry refractive index n.

Equations
Instances For

    Mironov dielectric relaxation time τ.

    Equations
    Instances For

      Mironov ionic conductivity σ.

      Equations
      Instances For

        A different examination principle forces a different kind, even when the name, scale, and dimension all agree: monostatic and bistatic reflectivity share id "reflectivity" and ratio scale, yet are distinct kinds because the principle that examines them differs (§7.5).

        Equations
        Instances For

          Bistatic reflectivity — same name and scale, different examination principle.

          Equations
          Instances For

            Step 2 — Pair each kind with its dimension #

            The quantities that carry the retrieval are almost all dimension one — a volume fraction, a mass fraction, a reflectivity, an index. Dimension equates them all; the kind layer keeps them apart. Volumetric and gravimetric water content are the textbook case: both volume/volume resp. mass/mass, hence dimension one, yet a units library alone would silently accept one for the other. Here they are distinct kinds, so that confusion is a type error.

            (The literal dim-functor collapse — dim vwc = dim gwc = 1 — is the Mathlib-backed dimension layer, demonstrated in the Units / Dimension chapters; this Mathlib-free example makes the point one level up, at the kind.)

            Volumetric water content (water volume / soil volume) — dimension one.

            Equations
            Instances For

              Gravimetric water content (water mass / dry-soil mass) — also dimension one.

              Equations
              Instances For

                Step 3 — Build kind-differentiated quantities #

                Write the model's constants as a record of typed quantities, each field its own kind. Authored over an abstract carrier α, the whole record re-represents at any carrier by one map, every kind preserved. This miniature keeps three of the Mironov-2009 fit constants — the pattern is the same for the full table.

                A miniature Mironov fit table: three constants, each of its own kind, over a carrier α. The elaborator refuses to pass a relaxation time where a conductivity is wanted, even though all three erase to the same α.

                Instances For

                  Re-represent the whole table at a new carrier, each constant keeping its kind.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    A concrete table at the Int carrier.

                    Equations
                    Instances For

                      Step 4 — Differentiate shared kinds: dedicate, or index by named field #

                      Two cases, on two different axes.

                      (a) Same kind, different component — dedicate #

                      When two quantities should differ because their measurement target differs — same relative-permittivity kind, different water phase — make them distinct with a dedicated kind: holding the component apart is enough to force distinct kinds, without inventing identity strings.

                      The sort of system under examination.

                      Equations
                      Instances For

                        One generic kind-of-property, shared by both phases.

                        Equations
                        Instances For

                          Bound-water static permittivity = the permittivity kind dedicated to soil-water / bound water.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            Free-water static permittivity = the same kind dedicated to soil-water / free water.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For

                              (b) Genuinely shared kind — carry position on named fields #

                              When the algebra forces one kind, the leftover distinction is positional, not metrological. A row of a lower-triangular Cholesky factor L (from A = L·Lᵀ) is row-homogeneous: every entry of a row lands at the same kind, here reflectivity, regardless of column — a kind that separated the columns would make the factorization's own row sums ill-typed. The remaining "which slot" distinction is held by the named fields, not by the kind and not by a Fin n-indexed array, and is checked off the kind axis by an erasure rfl against a bare-Float kernel.

                              (The genuine Cholesky entries also carry sqrt/division arithmetic; that — and the Gram-matrix kind bookkeeping — is the omitted detail. Kept here: the within-kind update shape, which is what exhibits the row-homogeneity and the erasure.)

                              One row of the lower-triangular factor: three same-kind named fields.

                              Instances For

                                Project the kinded row to its bare magnitudes — the erasure .magnitude per slot.

                                Equations
                                Instances For

                                  The bare-Float kernel a hand-written factorization would run: the within-kind row update on raw numbers.

                                  Equations
                                  Instances For

                                    The kinded row, built with the computational - (the executable-kernel spelling), every entry staying at reflectivity.

                                    Equations
                                    Instances For

                                      Erasure parity. The kinded factor's magnitudes are definitionally the bare kernel's outputs — .magnitude erases the whole kind overlay and the number that runs is the one a hand-written kernel would compute, bit for bit.