A discrete instance (TODO.md, discrete sorts) #
The generic development needs a σ-finite reference measure per sort and nothing else, so
discrete sorts under counting measure fit as they are: there a density is a probability mass
function. This module is a minimal instance with two sorts, int (ℤ) and bool, both under
counting measure:
| operation | inv = false | inv = true | log-weight |
|---|---|---|---|
add | x + q | x - q | 0 |
xor | x ^^ q | (itself) | 0 |
and the conditioners mul and parity, which have no semi-inverse. Every leaf is a bijection
of a countable type, which preserves counting measure (measurePreserving_count). The examples
at the end are integer and binary additive couplings (as in integer discrete flows); their
densities are pmfs by Prog.density.
Sorts #
The sorts: integers and booleans, each under counting measure.
Instances For
Equations
- RoleFlow.Discrete.instReprDS.repr RoleFlow.Discrete.DS.int prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "RoleFlow.Discrete.DS.int")).group prec✝
- RoleFlow.Discrete.instReprDS.repr RoleFlow.Discrete.DS.bool prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "RoleFlow.Discrete.DS.bool")).group prec✝
Instances For
Equations
- RoleFlow.Discrete.instReprDS = { reprPrec := RoleFlow.Discrete.instReprDS.repr }
The space of a sort.
Equations
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
A bijection of a countable type preserves counting measure.
Operations #
A semi-inverse solving the first argument from the result and the second argument.
Instances For
Equations
Instances For
Equations
- RoleFlow.Discrete.discSig = { Op := RoleFlow.Discrete.DOp, bs_ne := @RoleFlow.Discrete.discSig._proof_1, inv := fun {as bs : List RoleFlow.Discrete.DS} => RoleFlow.Discrete.DOp.inv }
Instances For
The model #
Equations
Instances For
The integer operations, at the type of the sort.
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
- RoleFlow.Discrete.zpar x = decide (RoleFlow.Discrete.toZ x % 2 = 1)
Instances For
Equations
- One or more equations did not get rendered due to their size.
- RoleFlow.Discrete.semOp RoleFlow.Discrete.DOp.parity = fun (v : RoleFlow.Val [RoleFlow.Discrete.DS.int]) => RoleFlow.Discrete.one (RoleFlow.Discrete.zpar v.head)
Instances For
On a discrete sort, a measurable map is any map.
The left law of an operation that consumes its first argument.
A leaf of weight 1 from a bijection of the consumed argument at each parameter.
The left law of o with the semi-inverse si.
Equations
- RoleFlow.Discrete.LeftLaw o si = ∀ (c : RoleFlow.Val si.cs) (p : RoleFlow.Val si.ps), RoleFlow.Discrete.semOp si.op ((RoleFlow.Discrete.semOp o (si.glue c p)).append p) = c
Instances For
Equations
- One or more equations did not get rendered due to their size.