Documentation

Determinize.Proof.Symbolic.Syntax

Symbolic language and reduction #

Expressions carry affine functions of earlier expectation-affinity samples. The symbolic reducer records those samples while preserving a fixed residual shape.

@[reducible, inline]

Symbolic expressions over sampleCount E-affinity draws: the paper syntax with every real literal an affine form in those draws.

Equations
Instances For
    noncomputable def Determinize.Proof.Paper.Symbolic.Affine.primitiveMean {n : ℕ} (op : Spec.Paper.Op) (affineArgs : Fin (Spec.Paper.affineArity op) → Affine n) (generalArgs : Fin (Spec.Paper.generalArity op) → ℝ) :
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem Determinize.Proof.Paper.Symbolic.Affine.eval_primitiveMean {n : ℕ} (op : Spec.Paper.Op) (affineArgs : Fin (Spec.Paper.affineArity op) → Affine n) (generalArgs : Fin (Spec.Paper.generalArity op) → ℝ) (environment : Env n) :
      (primitiveMean op affineArgs generalArgs).eval environment = Spec.Paper.meanValue op (fun (i : Fin (Spec.Paper.affineArity op)) => (affineArgs i).eval environment, generalArgs)
      @[reducible, inline]

      The skeleton of every realization, which does not depend on the environment (realize_skeleton).

      Equations
      Instances For
        @[simp]
        theorem Determinize.Proof.Paper.Symbolic.AffineExpr.Affine.eval_const {n : ℕ} (constant : ℝ) (environment : Env n) :
        Affine.eval (constant, 0) environment = constant

        The same expression over one more draw, which it does not mention (Affine.weaken).

        Equations
        Instances For
          noncomputable def Determinize.Proof.Paper.Symbolic.AffineExpr.meanAffine {n : ℕ} (op : Spec.Paper.Op) (affine : List (Affine n)) (general : List ℝ) :

          Evaluate a primitive mean as an affine formula in the existing E samples.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            Instances For
              theorem Determinize.Proof.Paper.Symbolic.AffineExpr.WellTyped.realize_typed {context : List Spec.Paper.Ty} {ty : Spec.Paper.Ty} {sampleCount : ℕ} {expression : AffineExpr sampleCount} (typed : WellTyped context expression ty) (environment : Env sampleCount) :
              Spec.Paper.Typed context (realize environment expression) ty
              theorem Determinize.Proof.Paper.Symbolic.AffineExpr.WellTyped.mapAffine {context : List Spec.Paper.Ty} {ty : Spec.Paper.Ty} {n m : ℕ} {expression : AffineExpr n} (typed : WellTyped context expression ty) (transform : Affine n → Affine m) (preservesZero : ∀ (affine : Affine n), affine.2 = 0 → (transform affine).2 = 0) :
              WellTyped context (AffineExpr.mapAffine transform expression) ty
              theorem Determinize.Proof.Paper.Symbolic.AffineExpr.WellTyped.weakenSamples {context : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {expression : AffineExpr sampleCount✝} {ty : Spec.Paper.Ty} (typed : WellTyped context expression ty) :
              WellTyped context expression.weakenSamples ty
              @[reducible, inline]
              abbrev Determinize.Proof.Paper.Symbolic.AffineExpr.shift {sampleCount : ℕ} (amount cutoff : ℕ) (expression : AffineExpr sampleCount) :
              Spec.Paper.Expr (Affine sampleCount)
              Equations
              Instances For
                @[reducible, inline]
                abbrev Determinize.Proof.Paper.Symbolic.AffineExpr.substAt {sampleCount : ℕ} (depth : ℕ) (replacement expression : AffineExpr sampleCount) :
                Spec.Paper.Expr (Affine sampleCount)
                Equations
                Instances For
                  @[reducible, inline]
                  abbrev Determinize.Proof.Paper.Symbolic.AffineExpr.substHead {sampleCount : ℕ} (body replacement : AffineExpr sampleCount) :
                  Spec.Paper.Expr (Affine sampleCount)
                  Equations
                  Instances For
                    @[reducible, inline]
                    abbrev Determinize.Proof.Paper.Symbolic.AffineExpr.substTwo {sampleCount : ℕ} (body argument function : AffineExpr sampleCount) :
                    Spec.Paper.Expr (Affine sampleCount)
                    Equations
                    Instances For
                      theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_shift {before suffix : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {expression : AffineExpr sampleCount✝} {ty : Spec.Paper.Ty} {inserted : List Spec.Paper.Ty} (h : WellTyped (before ++ suffix) expression ty) :
                      WellTyped (before ++ inserted ++ suffix) (shift inserted.length before.length expression) ty
                      theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_substAt {before : List Spec.Paper.Ty} {binder : Spec.Paper.Ty} {suffix : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {expression : AffineExpr sampleCount✝} {ty : Spec.Paper.Ty} {replacement : AffineExpr sampleCount✝} (h : WellTyped (before ++ binder :: suffix) expression ty) (replacementTyped : WellTyped suffix replacement binder) :
                      WellTyped (before ++ suffix) (substAt before.length replacement expression) ty
                      theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_substHead {binder : Spec.Paper.Ty} {suffix : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {body : AffineExpr sampleCount✝} {ty : Spec.Paper.Ty} {replacement : AffineExpr sampleCount✝} (bodyTyped : WellTyped (binder :: suffix) body ty) (replacementTyped : WellTyped suffix replacement binder) :
                      WellTyped suffix (body.substHead replacement) ty
                      theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_substTwo {argumentTy functionTy : Spec.Paper.Ty} {suffix : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {body : AffineExpr sampleCount✝} {resultTy : Spec.Paper.Ty} {argument function : AffineExpr sampleCount✝} (bodyTyped : WellTyped (argumentTy :: functionTy :: suffix) body resultTy) (argumentTyped : WellTyped suffix argument argumentTy) (functionTyped : WellTyped suffix function functionTy) :
                      WellTyped suffix (body.substTwo argument function) resultTy
                      theorem Determinize.Proof.Paper.Symbolic.AffineExpr.realize_skeleton {sampleCount : ℕ} (expression : AffineExpr sampleCount) (environment : Env sampleCount) :
                      (realize environment expression).skeleton = expression.skeleton
                      theorem Determinize.Proof.Paper.Symbolic.AffineExpr.realize_coordinates {sampleCount : ℕ} (expression : AffineExpr sampleCount) (environment : Env sampleCount) :
                      (realize environment expression).realCoordinates = List.map (fun (x : Affine sampleCount) => x.eval environment) expression.coordinates
                      theorem Determinize.Proof.Paper.Symbolic.AffineExpr.realize_shift {sampleCount : ℕ} (expression : AffineExpr sampleCount) (environment : Env sampleCount) (amount cutoff : ℕ) :
                      Spec.Paper.Expr.realize environment (shift amount cutoff expression) = Spec.Paper.Expr.shift amount cutoff (realize environment expression)
                      theorem Determinize.Proof.Paper.Symbolic.AffineExpr.realize_substAt {sampleCount : ℕ} (expression replacement : AffineExpr sampleCount) (environment : Env sampleCount) (depth : ℕ) :
                      Spec.Paper.Expr.realize environment (substAt depth replacement expression) = Spec.Paper.Expr.substAt depth (realize environment replacement) (realize environment expression)
                      theorem Determinize.Proof.Paper.Symbolic.AffineExpr.realize_substHead {sampleCount : ℕ} (body replacement : AffineExpr sampleCount) (environment : Env sampleCount) :
                      Spec.Paper.Expr.realize environment (body.substHead replacement) = (realize environment body).substHead (realize environment replacement)
                      theorem Determinize.Proof.Paper.Symbolic.AffineExpr.realize_substTwo {sampleCount : ℕ} (body argument function : AffineExpr sampleCount) (environment : Env sampleCount) :
                      Spec.Paper.Expr.realize environment (body.substTwo argument function) = (realize environment body).substTwo (realize environment argument) (realize environment function)
                      theorem Determinize.Proof.Paper.Symbolic.AffineExpr.realize_mapAffine {n m : ℕ} (expression : AffineExpr n) (transform : Affine n → Affine m) (sourceEnvironment : Env n) (targetEnvironment : Env m) (eval_transform : ∀ (affine : Affine n), (transform affine).eval targetEnvironment = affine.eval sourceEnvironment) :
                      realize targetEnvironment (mapAffine transform expression) = realize sourceEnvironment expression
                      @[simp]
                      theorem Determinize.Proof.Paper.Symbolic.AffineExpr.realize_weakenSamples {n : ℕ} (expression : AffineExpr n) (head : ℝ) (environment : Env n) :
                      realize (Env.cons head environment) expression.weakenSamples = realize environment expression
                      @[simp]
                      theorem Determinize.Proof.Paper.Symbolic.AffineExpr.realize_isValue {n : ℕ} (expression : AffineExpr n) (environment : Env n) :
                      (realize environment expression).isValue = expression.isValue

                      The value of a G-affinity literal, an affine form with zero coefficients; none for a literal that depends on a draw and for any other expression.

                      Equations
                      Instances For

                        The affine coordinates of a list value of reals, a cons-chain of real ending in nil: the symbolic counterpart of realListValue?.

                        Equations
                        Instances For

                          The constants of a list value of general-affinity reals, the counterpart of constantValue?.

                          Equations
                          Instances For
                            theorem Determinize.Proof.Paper.Symbolic.AffineExpr.realListValue?_realize {n : ℕ} (expression : AffineExpr n) (environment : Env n) :
                            Spec.Paper.realListValue? (realize environment expression) = Option.map (List.map fun (x : Affine n) => x.eval environment) expression.affineListValue?

                            Realization evaluates the coordinates of a list value pointwise.

                            The arity a discrete site reads off the skeleton of its weights is the length of their affine coordinate list.

                            theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_arr_value_typed {context : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {expression : AffineExpr sampleCount✝} {argument result : Spec.Paper.Ty} (typed : WellTyped context expression (argument.arr result)) (value : expression.isValue = true) :
                            (∃ (a : Spec.Paper.Ty) (r : Spec.Paper.Ty) (body : Spec.Paper.Expr (Affine sampleCount✝)), expression = body.lam Spec.Paper.DistributionAction ∧ argument.Sub a ∧ r.Sub result ∧ WellTyped (a :: context) body r) ∨ ∃ (a : Spec.Paper.Ty) (r : Spec.Paper.Ty) (body : Spec.Paper.Expr (Affine sampleCount✝)), expression = body.fix Spec.Paper.DistributionAction ∧ argument.Sub a ∧ r.Sub result ∧ WellTyped (a :: a.arr r :: context) body r
                            theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_prod_value_typed {context : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {expression : AffineExpr sampleCount✝} {leftTy rightTy : Spec.Paper.Ty} (typed : WellTyped context expression (leftTy.prod rightTy)) (value : expression.isValue = true) :
                            ∃ (left : Spec.Paper.Expr (Affine sampleCount✝)) (right : Spec.Paper.Expr (Affine sampleCount✝)), expression = left.pair Spec.Paper.DistributionAction right ∧ WellTyped context left leftTy ∧ WellTyped context right rightTy
                            theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_sum_value_typed {context : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {expression : AffineExpr sampleCount✝} {leftTy rightTy : Spec.Paper.Ty} (typed : WellTyped context expression (leftTy.sum rightTy)) (value : expression.isValue = true) :
                            (∃ (body : Spec.Paper.Expr (Affine sampleCount✝)), expression = body.inl Spec.Paper.DistributionAction ∧ WellTyped context body leftTy) ∨ ∃ (body : Spec.Paper.Expr (Affine sampleCount✝)), expression = body.inr Spec.Paper.DistributionAction ∧ WellTyped context body rightTy
                            theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_list_value_typed {context : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {expression : AffineExpr sampleCount✝} {element : Spec.Paper.Ty} (typed : WellTyped context expression element.list) (value : expression.isValue = true) :
                            expression = Spec.Paper.Expr.nil ∨ ∃ (head : Spec.Paper.Expr (Affine sampleCount✝)) (tail : Spec.Paper.Expr (Affine sampleCount✝)), expression = head.cons Spec.Paper.DistributionAction tail ∧ WellTyped context head element ∧ WellTyped context tail element.list
                            theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_bool_value {context : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {expression : AffineExpr sampleCount✝} (typed : WellTyped context expression Spec.Paper.Ty.bool) (value : expression.isValue = true) :
                            ∃ (result : Bool), expression = Spec.Paper.Expr.bool Spec.Paper.DistributionAction result
                            theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_real_value {context : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {expression : AffineExpr sampleCount✝} {affinity : Spec.Paper.Affinity} (typed : WellTyped context expression (Spec.Paper.Ty.float affinity)) (value : expression.isValue = true) :
                            ∃ (result : Affine sampleCount✝), expression = Spec.Paper.Expr.real Spec.Paper.DistributionAction result
                            theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_arr_value {context : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {expression : AffineExpr sampleCount✝} {argument result : Spec.Paper.Ty} (typed : WellTyped context expression (argument.arr result)) (value : expression.isValue = true) :
                            (∃ (body : Spec.Paper.Expr (Affine sampleCount✝)), expression = body.lam Spec.Paper.DistributionAction) ∨ ∃ (body : Spec.Paper.Expr (Affine sampleCount✝)), expression = body.fix Spec.Paper.DistributionAction
                            theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_prod_value {context : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {expression : AffineExpr sampleCount✝} {leftTy rightTy : Spec.Paper.Ty} (typed : WellTyped context expression (leftTy.prod rightTy)) (value : expression.isValue = true) :
                            ∃ (l : Spec.Paper.Expr (Affine sampleCount✝)) (r : Spec.Paper.Expr (Affine sampleCount✝)), expression = l.pair Spec.Paper.DistributionAction r
                            theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_sum_value {context : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {expression : AffineExpr sampleCount✝} {leftTy rightTy : Spec.Paper.Ty} (typed : WellTyped context expression (leftTy.sum rightTy)) (value : expression.isValue = true) :
                            (∃ (body : Spec.Paper.Expr (Affine sampleCount✝)), expression = body.inl Spec.Paper.DistributionAction) ∨ ∃ (body : Spec.Paper.Expr (Affine sampleCount✝)), expression = body.inr Spec.Paper.DistributionAction
                            theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_list_value {context : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {expression : AffineExpr sampleCount✝} {element : Spec.Paper.Ty} (typed : WellTyped context expression element.list) (value : expression.isValue = true) :
                            expression = Spec.Paper.Expr.nil ∨ ∃ (h : Spec.Paper.Expr (Affine sampleCount✝)) (t : Spec.Paper.Expr (Affine sampleCount✝)), expression = h.cons Spec.Paper.DistributionAction t
                            theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_cons_inv {context : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {head tail : Spec.Paper.Expr (Affine sampleCount✝)} {element : Spec.Paper.Ty} (typed : WellTyped context (head.cons Spec.Paper.DistributionAction tail) element.list) :
                            WellTyped context head element ∧ WellTyped context tail element.list
                            theorem Determinize.Proof.Paper.Symbolic.AffineExpr.constantValue?_eq_some_of_wellTypedG {context : List Spec.Paper.Ty} {sampleCount✝ : ℕ} {expression : AffineExpr sampleCount✝} (typed : WellTyped context expression (Spec.Paper.Ty.float Spec.Paper.Affinity.G)) (value : expression.isValue = true) :
                            ∃ (result : ℝ), expression.constantValue? = some result
                            theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_list_value_affine {n : ℕ} {context : List Spec.Paper.Ty} {affinity : Spec.Paper.Affinity} {expression : AffineExpr n} (typed : WellTyped context expression (Spec.Paper.Ty.float affinity).list) (value : expression.isValue = true) :
                            ∃ (coordinates : List (Affine n)), expression.affineListValue? = some coordinates

                            A list value of floats is a cons-chain of real coordinates.

                            theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_list_value_constant {n : ℕ} {context : List Spec.Paper.Ty} {expression : AffineExpr n} (typed : WellTyped context expression (Spec.Paper.Ty.float Spec.Paper.Affinity.G).list) (value : expression.isValue = true) :
                            ∃ (constants : List ℝ), expression.constantListValue? = some constants ∧ expression.affineListValue? = some (List.map (fun (constant : ℝ) => (constant, 0)) constants)

                            A list value of general-affinity floats has constant coordinates.

                            Equations
                            Instances For

                              The quotient of two affine forms when the denominator is constant and nonzero; none otherwise.

                              Equations
                              Instances For
                                theorem Determinize.Proof.Paper.Symbolic.AffineExpr.Affine.eval_mul_of_eq_some {n : ℕ} {left right result : Affine n} (equality : mul? left right = some result) (environment : Env n) :
                                result.eval environment = left.eval environment * right.eval environment
                                theorem Determinize.Proof.Paper.Symbolic.AffineExpr.Affine.mul?_eq_some_of_left {n : ℕ} {left right : Affine n} (constant : left.2 = 0) :
                                ∃ (result : Affine n), mul? left right = some result
                                Instances For

                                  The concrete action at environment: a sampleE site draws from the primitive fiber at the evaluated parameters and its continuation sees the draw as the fresh coordinate.

                                  Equations
                                  Instances For

                                    Continue a symbolic step under an evaluation context. The continuation of a sampleE lives in n + 1 variables, hence the second, lifted context.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      theorem Determinize.Proof.Paper.Symbolic.AffineExpr.SymbolicAction.realize_wrap {n : ℕ} {ExprContext : Spec.Paper.Expr → Spec.Paper.Expr} (action : SymbolicAction n) (environment : Env n) (context : AffineExpr n → AffineExpr n) (liftedContext : AffineExpr (n + 1) → AffineExpr (n + 1)) (context_realize : ∀ (expression : AffineExpr n), AffineExpr.realize environment (context expression) = ExprContext (AffineExpr.realize environment expression)) (lifted_realize : ∀ (expression : AffineExpr (n + 1)) (value : ℝ), AffineExpr.realize (Env.cons value environment) (liftedContext expression) = ExprContext (AffineExpr.realize (Env.cons value environment) expression)) :
                                      realize environment (wrap context liftedContext action) = Spec.Paper.Action.wrap ExprContext (realize environment action)

                                      Typing of a symbolic step at ty: its expression or continuations are closed and well typed, a sampleE carries the right number of parameters, and a sampleG is a G-affinity site with a primitive fiber at constant parameters.

                                      Instances For
                                        theorem Determinize.Proof.Paper.Symbolic.AffineExpr.SymbolicAction.WellTyped.sub {a : Spec.Paper.Ty} {sampleCount✝ : ℕ} {action : SymbolicAction sampleCount✝} {b : Spec.Paper.Ty} (typed : WellTyped a action) (h : a.Sub b) :
                                        WellTyped b action
                                        @[simp]
                                        theorem Determinize.Proof.Paper.Symbolic.AffineExpr.SymbolicAction.wellTyped_sampleE_iff {ty : Spec.Paper.Ty} {n : ℕ} {op : Spec.Paper.Op} {affine : List (Affine n)} {general : List ℝ} {continuation : AffineExpr (n + 1)} :
                                        WellTyped ty (sampleE op affine general continuation) ↔ affine.length = Spec.Paper.affineArity op ∧ general.length = Spec.Paper.generalArity op ∧ AffineExpr.WellTyped [] continuation ty
                                        @[simp]
                                        theorem Determinize.Proof.Paper.Symbolic.AffineExpr.SymbolicAction.wellTyped_mean_iff {ty : Spec.Paper.Ty} {n : ℕ} {op : Spec.Paper.Op} {affine : List (Affine n)} {general : List ℝ} {continuation : Affine n → AffineExpr n} :
                                        WellTyped ty (mean op affine general continuation) ↔ affine.length = Spec.Paper.affineArity op ∧ general.length = Spec.Paper.generalArity op ∧ AffineExpr.WellTyped [] (continuation (meanAffine op affine general)) ty ∧ ∀ (value : Affine n) (environment : Env n), AffineExpr.realize environment (continuation value) = AffineExpr.realize environment (continuation (value.eval environment, 0))
                                        @[simp]
                                        theorem Determinize.Proof.Paper.Symbolic.AffineExpr.SymbolicAction.WellTyped.wrap {n : ℕ} {childTy : Spec.Paper.Ty} {context : AffineExpr n → AffineExpr n} {resultTy : Spec.Paper.Ty} {liftedContext : AffineExpr (n + 1) → AffineExpr (n + 1)} {action : SymbolicAction n} (typed : WellTyped childTy action) (contextTyped : ∀ (expression : AffineExpr n), AffineExpr.WellTyped [] expression childTy → AffineExpr.WellTyped [] (context expression) resultTy) (liftedTyped : ∀ (expression : AffineExpr (n + 1)), AffineExpr.WellTyped [] expression childTy → AffineExpr.WellTyped [] (liftedContext expression) resultTy) (context_congr : ∀ (left right : AffineExpr n) (environment : Env n), AffineExpr.realize environment left = AffineExpr.realize environment right → AffineExpr.realize environment (context left) = AffineExpr.realize environment (context right) := by intros; simp_all only [AffineExpr.realize]) :
                                        WellTyped resultTy (SymbolicAction.wrap context liftedContext action)
                                        theorem Determinize.Proof.Paper.Symbolic.AffineExpr.symbolicReduce_uniform_eq {n : ℕ} (kind : Spec.Paper.DistributionAction) (lower upper : AffineExpr n) :
                                        theorem Determinize.Proof.Paper.Symbolic.AffineExpr.symbolicReduce_gaussian_eq {n : ℕ} (kind : Spec.Paper.DistributionAction) (mean variance : AffineExpr n) :
                                        theorem Determinize.Proof.Paper.Symbolic.AffineExpr.symbolicReduce_beta_eq {n : ℕ} (kind : Spec.Paper.DistributionAction) (alpha betaParam : AffineExpr n) :
                                        theorem Determinize.Proof.Paper.Symbolic.AffineExpr.symbolicReduce_gamma_eq {n : ℕ} (kind : Spec.Paper.DistributionAction) (shape rate : AffineExpr n) :
                                        theorem Determinize.Proof.Paper.Symbolic.AffineExpr.symbolicReduce_realize {n : ℕ} {context : List Spec.Paper.Ty} {ty : Spec.Paper.Ty} {expression : AffineExpr n} (typed : WellTyped context expression ty) (environment : Env n) :
                                        SymbolicAction.realize environment expression.symbolicReduce = Spec.Paper.reduce (realize environment expression)
                                        theorem Determinize.Proof.Paper.Symbolic.AffineExpr.wellTyped_ofExpr_of_typed {context : List Spec.Paper.Ty} {ty : Spec.Paper.Ty} {expression : Spec.Paper.Expr} (typed : Spec.Paper.Typed context expression ty) :
                                        WellTyped context (ofExpr expression) ty
                                        theorem Determinize.Proof.Paper.Symbolic.AffineExpr.measurable_affine_eval {sampleCount : ℕ} (expression : Affine sampleCount) :
                                        Measurable expression.eval
                                        def Determinize.Proof.Paper.Symbolic.AffineExpr.realizeFamily {sampleCount : ℕ} (expression : AffineExpr sampleCount) :
                                        MeasurableFamily (Env sampleCount) fun (environment : Env sampleCount) => realize environment expression

                                        realize as a measurable family over environments: the skeleton is fixed and every coordinate is an affine function of the environment.

                                        Equations
                                        Instances For
                                          theorem Determinize.Proof.Paper.Symbolic.AffineExpr.measurable_realize {sampleCount : ℕ} (expression : AffineExpr sampleCount) :
                                          Measurable fun (environment : Env sampleCount) => realize environment expression
                                          theorem Determinize.Proof.Paper.Symbolic.AffineExpr.actualMeasure_snoc {laws : PrimitiveLaws} {n : ℕ} (history : SampleEnv laws n) (op : Spec.Paper.Op) (affineArgs : Fin (Spec.Paper.affineArity op) → Affine n) (generalArgs : Fin (Spec.Paper.generalArity op) → ℝ) :
                                          SampleEnv.actualMeasure laws (history.snoc op affineArgs generalArgs) = (SampleEnv.actualMeasure laws history).bind fun (environment : Env n) => MeasureTheory.Measure.map (fun (value : ℝ) => Env.cons value environment) ((laws.kernel op) (fun (i : Fin (Spec.Paper.affineArity op)) => (affineArgs i).eval environment, generalArgs))