Documentation

Provenance.HavingExample

Worked examples: HAVING provenance and probability on a three-occurrence group #

Two fully computed examples on a group with three occurrences.

The SUM(a) ≥ 5 collapse in 𝔹[X] #

Attribute values of the three occurrences: a(u₁) = 3, a(u₂) = a(u₃) = 2.

Equations
Instances For
    Dependency graph

    Annotations: the distinct Boolean variables x₁, x₂, x₃ of 𝔹[X].

    Equations
    Instances For
      Dependency graph

      Possible-world provenance of SUM(a) ≥ 5: the -sum of the world annotations T_U(W) over the valid worlds {1,2}, {1,3}, {1,2,3} computes to x₁ ∧ (x₂ ∨ x₃).

      Dependency graph
      theorem HavingExample.sum_ge_five_minimal :
      V{WFinset.univ.powerset | 5 iW, t i} with V'V, ¬5 iV', t i, Having.A α V = BoolFunc.var 0 * (BoolFunc.var 1 + BoolFunc.var 2)

      Collapse to minimal worlds: the -sum of the monomials A_V over the two minimal valid worlds {1,2} and {1,3} computes to the same x₁ ∧ (x₂ ∨ x₃), as predicted by Having.sum_ge_collapse since 𝔹[X] is absorptive.

      Dependency graph

      The Poisson-binomial COUNT(*) ≥ 2 example #

      Independent contributor marginals p₁ = 1/2, p₂ = 1/4, p₃ = 1/3.

      Equations
      Instances For
        Dependency graph
        def HavingExample.S :
        Fin 3Finset (Fin 3)

        Per-contributor variable supports: contributor i depends on xᵢ only.

        Equations
        Instances For
          Dependency graph
          theorem HavingExample.hdep (i : Fin 3) :
          (α i).DependsOn (S i)
          Dependency graph
          theorem HavingExample.hdisj :
          Set.univ.Pairwise fun (i j : Fin 3) => Disjoint (S i) (S j)
          Dependency graph
          Dependency graph
          Dependency graph
          Dependency graph
          Dependency graph

          Base of the recurrence: over no contributors, the count is 0 with probability 1.

          Dependency graph

          Base of the recurrence: over no contributors, a positive count has probability 0.

          Dependency graph
          Dependency graph
          Dependency graph
          Dependency graph
          Dependency graph
          Dependency graph
          Dependency graph
          Dependency graph

          Point mass ρ₃(2) = 1/4: probability that exactly two of the three contributors are present.

          Dependency graph

          Point mass ρ₃(3) = 1/24: probability that all three contributors are present.

          Dependency graph
          theorem HavingExample.count_ge_two_prob :
          (P.funcProb fun (v : Fin 3Bool) => decide (2 {i : Fin 3 | α i v = true}.card)) = 7 / 24

          Pr[COUNT(*) ≥ 2] = 7/24: the tail of the Poisson-binomial CDF, assembled from the point masses ρ₃(2) + ρ₃(3) = 1/4 + 1/24.

          Dependency graph