Documentation

Graphon.SamplingPointwise

The point-sampling half of the First Sampling Lemma (scaffold) #

Target (PR #11):

point_sampling_event_of_large_k : ∀ ε η > 0, ∃ K, ∀ k ≥ K, ∀ [NeZero k], ∀ W : Graphon α μ, PointSamplingEvent W k ε η

matching the shape of rounding_event_of_large_k, so that PR #12 can pick one k for both events and close first_sampling_lemma via sampleGoodMassOn_of_events.

Design notes (recorded 2026-07-07) #

Layer plan (per the PR #11 decomposition) #

  1. discretized cut norm approximation — reduce d_□(W, H_{W,x}) to finitely many cut predicates in the sampled coordinates, with controlled error.
  2. bounded-differences / Azuma scaffold — the vertex-exposure decomposition for functionals of the sampled point sequence.
  3. uniform tail bound — the expectation bound (Lovász 10.6 core) + concentration, uniform in W.
  4. event packaging — the measurable witness set for PointSamplingEvent.

PR #11A architecture (settled 2026-07-07, after literature check) #

Reference mechanisms: Lovász Lemmas 10.6/10.7 (bounded kernels); the modern generalization arXiv:2203.07581 confirms the split into systematic error (expectation bound; Q-subsample ghost argument, their §6.2) and dispersion (vertex-exposure martingale + Azuma — deferred to PR #11B).

Majorant + triangle decomposition. Fix ε; let P be the Frieze–Kannan partition of W at quality ε' := ε/8 with m = m(ε') parts (uniform in W — PROVED regularity), U := stepify P W. Then

d_□(W, H_{W,x}) ≤ ε' + d_□(U, H_{U,x}) + maxcut((W−U)[x])

PR #11A execution notes (2026-07-07 survey of repo APIs) #

References #

PR #11A Layers 1+2: the point-sampling majorant and its frequency accounting #

This section builds the nonnegative, measurable, integrable majorant pointSamplingMajorant W ε' k x dominating cutDistance W (H_{W,x}) a.e., and bounds the expectation of its frequency term. The deep core term (Layer 3, the AFKK Q-subsample ghost argument) is isolated in the private lemma coreTerm_expectation_bound (fully proved; this section's layering dates from when it was the last open obligation).

The triangle decomposition through U := stepify P W (P the Frieze–Kannan partition of W at quality ε') is

d_□(W, H_{W,x}) ≤ d_□(W, U) + d_□(U, H_{U,x}) + d_□(H_{U,x}, H_{W,x}) ≤ ε' + freqTerm + coreTerm.

The chosen Frieze–Kannan partition of W at quality ε' (junk trivialPartition when ε' ≤ 0; all theorems below carry 0 < ε').

Equations
Instances For
    noncomputable def Graphon.chosenStep {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} [MeasureTheory.IsProbabilityMeasure μ] (W : Graphon α μ) (ε' : ) :
    Graphon α μ

    The chosen step-graphon approximation U := stepify P W.

    Equations
    Instances For
      noncomputable def Graphon.clampEval {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} (V : Graphon α μ) {k : } (x : Fin kα) (i j : Fin k) :

      The clamped, (min,max)-ordered evaluation of a graphon V at the sampled pair (x_i, x_j) — matching the coefficient shape of sampleWeightedGraphonOn.

      Equations
      Instances For
        noncomputable def Graphon.empFreq {α : Type u_1} {k : } (S : Set α) (x : Fin kα) :

        The empirical frequency of a cell S among the k sampled points.

        Equations
        Instances For
          noncomputable def Graphon.freqTerm {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} [MeasureTheory.IsProbabilityMeasure μ] (W : Graphon α μ) (ε' : ) (k : ) (x : Fin kα) :

          The frequency term: 2·∑_cells |empirical frequency − μ(cell)|, plus a 1/k slack absorbing the diagonal mismatch between H_{U,x} and the coarsened comparison graphon (see the domination proof).

          Equations
          Instances For
            noncomputable def Graphon.coreTerm {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace α] [MeasureTheory.NullSingletonClass μ] (W : Graphon α μ) (ε' : ) (k : ) [NeZero k] (x : Fin kα) :

            The core term: the maximum, over vertex cuts A, B ⊆ [k], of the weighted cut sum of the empirical matrix clampEval W − clampEval U on the equipartition. Its summand shape matches cutNormDiff_mkStepGraphon_le_of_cuts exactly (weights (μ cell)·(μ cell)), so the certificate applies to d_□(H_{U,x}, H_{W,x}) directly.

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

              The point-sampling majorant ε' + freqTerm + coreTerm.

              Equations
              Instances For

                Bounds and nonnegativity #

                theorem Graphon.clampEval_nonneg {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} (V : Graphon α μ) {k : } (x : Fin kα) (i j : Fin k) :
                0 V.clampEval x i j
                theorem Graphon.clampEval_le_one {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} (V : Graphon α μ) {k : } (x : Fin kα) (i j : Fin k) :
                V.clampEval x i j 1
                theorem Graphon.coreTerm_le_one {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace α] [MeasureTheory.NullSingletonClass μ] (W : Graphon α μ) (ε' : ) (k : ) [NeZero k] (x : Fin kα) :
                W.coreTerm ε' k x 1

                Crude uniform bound on the core term: coreTerm ≤ 1.

                theorem Graphon.empFreq_nonneg {α : Type u_1} {k : } (S : Set α) (x : Fin kα) :
                0 empFreq S x
                theorem Graphon.empFreq_le_one {α : Type u_1} {k : } [NeZero k] (S : Set α) (x : Fin kα) :
                empFreq S x 1
                theorem Graphon.abs_empFreq_sub_le_one {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} [StandardBorelSpace α] {k : } [NeZero k] (S : Set α) (x : Fin kα) (hS : (μ S).toReal 1) :
                |empFreq S x - (μ S).toReal| 1

                The frequency deviation of a single cell is at most 1.

                theorem Graphon.freqTerm_nonneg {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} [MeasureTheory.IsProbabilityMeasure μ] (W : Graphon α μ) (ε' : ) (k : ) [NeZero k] (x : Fin kα) :
                0 W.freqTerm ε' k x

                The nonnegativity of the majorant (given 0 ≤ ε').

                Measurability and integrability #

                theorem Graphon.measurable_clampEval {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} (V : Graphon α μ) {k : } (i j : Fin k) :
                Measurable fun (x : Fin kα) => V.clampEval x i j
                theorem Graphon.measurable_empFreq {α : Type u_1} [MeasurableSpace α] {k : } {S : Set α} (hS : MeasurableSet S) :
                Measurable fun (x : Fin kα) => empFreq S x
                theorem Graphon.measurable_freqTerm {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace α] (W : Graphon α μ) (ε' : ) (k : ) [NeZero k] :
                Measurable fun (x : Fin kα) => W.freqTerm ε' k x
                theorem Graphon.freqTerm_le {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace α] [MeasureTheory.NullSingletonClass μ] (W : Graphon α μ) (ε' : ) (k : ) [NeZero k] (x : Fin kα) :
                W.freqTerm ε' k x 2 * (W.chosenPartition ε').parts.card + 1

                Crude uniform bound on the frequency term.

                A.e. domination #

                theorem Graphon.cutDistance_W_chosenStep_le {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} [MeasureTheory.IsProbabilityMeasure μ] (W : Graphon α μ) {ε' : } (hε' : 0 < ε') :
                W.cutDistance (W.chosenStep ε') ε'

                Part a (deterministic): W is ε'-close to its step approximation.

                Part b (pointwise cut certificate): the two weighted sampled graphons differ by at most the core term. Applies cutNormDiff_mkStepGraphon_le_of_cuts on the equipartition.

                chosenStep W ε' is definitionally the step graphon on chosenPartition W ε' with the rectangle-average coefficients rectAverage W.

                For a.e. sampled x, every sampled point lies in some part of P.

                theorem Graphon.cutNormDiff_eq_zero_of_ae_eq {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} [MeasureTheory.IsProbabilityMeasure μ] (V₁ V₂ : Graphon α μ) (h : ∀ᵐ (p : α × α) μ.prod μ, V₁.toAEEqFun p = V₂.toAEEqFun p) :
                V₁.cutNormDiff V₂ = 0

                Graphons with a.e.-equal kernels are at cut-norm difference zero (every rectangle integral of the difference vanishes).

                noncomputable def Graphon.coeffOfMatrix {α : Type u_1} {n : } (ι : Fin nSet α) (M : Fin nFin n) :
                Set αSet α

                A step-graphon coefficient function built from a symmetric matrix M indexed through an injective enumeration ι : Fin n → Set α (matching the dite-shape of sampleWeightedGraphonOn).

                Equations
                Instances For
                  theorem Graphon.coeffOfMatrix_symm {α : Type u_1} [MeasurableSpace α] {n : } (ι : Fin nSet α) (M : Fin nFin n) (hM : ∀ (i j : Fin n), M i j = M j i) (A B : Set α) :
                  coeffOfMatrix ι M A B = coeffOfMatrix ι M B A
                  theorem Graphon.coeffOfMatrix_mem {α : Type u_1} [MeasurableSpace α] {n : } (ι : Fin nSet α) (M : Fin nFin n) (hM : ∀ (i j : Fin n), M i j Set.Icc 0 1) (A B : Set α) :
                  theorem Graphon.coeffOfMatrix_eq {α : Type u_1} [MeasurableSpace α] {n : } (ι : Fin nSet α) (M : Fin nFin n) ( : Function.Injective ι) (a b : Fin n) :
                  coeffOfMatrix ι M (ι a) (ι b) = M a b

                  A.e. domination of the cut distance by the point-sampling majorant. Assembles the triangle d_□(W, H_{W,x}) ≤ d_□(W, U) + d_□(U, H_{U,x}) + d_□(H_{U,x}, H_{W,x}) from parts a (cutDistance_W_chosenStep_le), c (cutDistance_chosenStep_sampleWeighted_le_freqTerm) and b (cutDistance_sampleWeighted_le_coreTerm).

                  Layer 2: the frequency expectation bound #

                  theorem Graphon.measurable_abs_empFreq_sub {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} [StandardBorelSpace α] {k : } {S : Set α} (hS : MeasurableSet S) :
                  Measurable fun (x : Fin kα) => |empFreq S x - (μ S).toReal|

                  Layer 2 — the frequency expectation bound. The expectation of the frequency term is at most m/√k + 1/k, where m is the number of Frieze–Kannan cells; both terms vanish as k → ∞ (with m = m(ε') fixed). Elementary: linearity of the integral plus the per-cell integral_abs_empFreq_sub_le.

                  Frieze–Kannan control of the chosen step approximation. By construction chosenStep W ε' = stepify P W for the regularity partition P at quality ε', so the cut-norm difference ‖W − U‖_□ is at most ε'. This is the systematic-error budget of the core term: the a.e. entries of the empirical difference matrix are the sampled values of W − U, whose continuous cut norm the AFKK core compares against.

                  AFKK cut-guessing apparatus (private) #

                  The proof of guessBlock_integral_le_cutNormDiff follows docs/afkk-cut-guessing.md (= arXiv:2203.07581 §6.2 + Appendix §10; AFKK, JCSS 67 (2003), Lemma 3; Lovász, Large Networks, Lemma 10.7). Everything here is private. The subsections marked (I) hypergeometric moments, (II) product-space McDiarmid MGF, and (III) finite soft-max are self-contained infrastructure, candidates for later extraction.

                  (H4) ⌈√k⌉₊ arithmetic #
                  (I) Hypergeometric moments of the subsample estimator #

                  Purely finite averages over Finset.powersetCard q Finset.univ — sampling q of k fixed real numbers without replacement. Reusable infrastructure.

                  Conditioning on a block (Layer 2) #
                  (II) McDiarmid at MGF level on finite product measures #

                  The bounded-differences implementation (coordinate-peeling induction, one application of Hoeffding's lemma per peeled coordinate) lives in Graphon/McDiarmid.lean, packaged as ProbabilityTheory.hasSubgaussianMGF_of_bounded_differences' (arbitrary finite index type) and its Fin n special case. Here we only unpack the HasSubgaussianMGF form back into the integral-form MGF bound (H13b) consumed by the soft-max/assembly layer below.

                  (III) Finite soft-max #
                  Per-block assembly and rate arithmetic (Layers 2+3+4) #

                  Layer 4 — event packaging (Markov) and the uniform target theorem #

                  The frequency term is integrable: it is bounded by a constant on the finite-measure product space (crude uniform bound freqTerm_le).

                  The core term is integrable: it is bounded by 1 on the finite-measure product space (coreTerm_le_one).

                  theorem Graphon.point_sampling_event_of_large_k {α : Type u_1} [MeasurableSpace α] {μ : MeasureTheory.Measure α} [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace α] [MeasureTheory.NullSingletonClass μ] (ε η : ) ( : 0 < ε) ( : 0 < η) :
                  ∃ (K : ), ∀ (k : ), K k∀ (x : NeZero k) (W : Graphon α μ), W.PointSamplingEvent k ε η

                  The point-sampling half of the First Sampling Lemma (PR #11 target; PROVED). With W-uniform K: for all k ≥ K, the weighted sampled graphon H_{W,x} is within cut distance ε of W outside a bad set of measure ≤ η.

                  Proof: at accuracy ε' := εη/4, the majorant's expectation is ≤ 2ε' + regularityBound ε'/√k + 1/k + 8·k^{-1/4} < εη for all large k — uniformly in W, since regularityBound is W-free; Markov applied to the nonnegative integrable majorant plus the a.e. domination ae_cutDistance_le_pointSamplingMajorant packages the measurable event set.

                  Together with rounding_event_of_large_k and sampleGoodMassOn_of_events, this closes first_sampling_lemma (the PR #12 recombination).