Stat.RandomGraph.PathOccupancy
This topic gives finite-sample occupancy bounds for connected components of uniform fine-cell draws on a finite path with independent Bernoulli marks.
Path 4 core · 1 supporting Path connectivity is order convexity of the occupied cells. ★ connected_run_cover
Connected runs on a finite path
Path connectivity is order convexity of the occupied cells. A relation on labelled vertices may omit any eligible edge: only connectivity within the specified set and equality-or-neighbour locality are used to obtain the run and its span.
Two fine cells are equal or adjacent on the path.
Definition (Lean source)
A finite set of fine cells contains every cell between any two of its members.
An assignment to a finite labelled set has connected occupied cells.
Definition (Lean source)
A nonempty, connected set of fine cells has an occupied left endpoint and lies in a run of length its cardinality.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
connected_image_of_local_relationtheorem — A connected relation on a labelled subset whose edges join equal or adjacent assigned cells has connected occupied cells under the given assignment.hypothesesι :Type*K :ℕs :Finset ιx :ι → Fin KR :s → s → Prophlocal :∀ i jifR i jthenAdjacent (x i) (x j)hconn :∀ i j, EqvGen R i jconclusionPathConnected (s.image x)Proof (Lean source)
theorem connected_image_of_local_relation {ι : Type*} {K : ℕ} (s : Finset ι) (x : ι → Fin K) (R : s → s → Prop) (hlocal : ∀ i j, R i j → Adjacent (x i) (x j)) (hconn : ∀ i j, EqvGen R i j) : PathConnected (s.image x) := by classical intro a ha b hb c hac hcb by_contra hmissing have hne : ∀ i : s, (x i).val ≠ c.val := by intro i heq apply hmissing exact Finset.mem_image.mpr ⟨i, i.property, Fin.ext heq⟩ have hcut : ∀ i j : s, EqvGen R i j → ((x i).val < c.val ↔ (x j).val < c.val) := by intro i j hij induction hij with | rel i j hij => obtain ⟨hij₁, hij₂⟩ := hlocal i j hij have hi := hne i have hj := hne j constructor <;> intro h <;> omega | refl i => exact Iff.rfl | symm i j hij ih => exact ih.symm | trans i j k hij hjk ihij ihjk => exact ihij.trans ihjk obtain ⟨i, hi, rfl⟩ := Finset.mem_image.mp ha obtain ⟨j, hj, rfl⟩ := Finset.mem_image.mp hb have hni := hne ⟨i, hi⟩ change (x i).val ≠ c.val at hni have hiff := hcut ⟨i, hi⟩ ⟨j, hj⟩ (hconn ⟨i, hi⟩ ⟨j, hj⟩) change (x i).val < c.val ↔ (x j).val < c.val at hiff have hleft : (x i).val < c.val := by omega have hright := hiff.mp hleft omega
Components 9 core · 3 supporting Components are the equivalence classes of the symmetric, reflexive, transitive closure of the supplied relation. ★ pairedScore_le_subsets
Components of arbitrary local subrelations
Components are the equivalence classes of the symmetric, reflexive, transitive closure of the supplied relation. No eligible edge is required to be present. Pointwise domination by sums over labelled subsets permits the relation to depend on both cells and marks, or on additional randomness.
The component of a sample label under a relation contains all labels equivalent to it under the equivalence closure.
The component partition of a relation on labels is the set of its distinct equivalence classes, each included once.
A relation and cell assignment are admissible for the coarse count, M, when each edge joins equal or neighbouring cells in the same coarse cell.
Two subsets and an assignment share a coarse-pair envelope for coarse count M when every cell in both subsets lies in one consecutive paired coarse class.
The single-component score of a subset and marking is cardinality to the eighth times eight to the cardinality, when at least two labels are marked, and zero otherwise.
The total single-component score for a relation and marking is the sum of the two-mark single-component weights over its partition.
Definition (Lean source)
The paired weight for two subsets, cells, and marks at coarse count M is the product of the two subsets' weights, each weight being the subset's cardinality to the fourth power times eight to the power of that cardinality, if each size is at least two, each contains a mark, and they share a coarse-pair envelope; otherwise it is zero.
Definition (Lean source)
The distinct-component paired score for coarse count, relation, cells, and marks is half the ordered sum over distinct components of size at least two with at least one mark each and a shared coarse pair.
Definition (Lean source)
For an admissible relation, the distinct-component score is bounded by half the sum over ordered disjoint connected labelled subsets, for the coarse count, cells, relation, and marks.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
components_partitiontheorem — The equivalence classes of any relation are nonempty, cover all sample labels, and are disjoint when distinct.hypothesesProof (Lean source)
theorem components_partition {n : ℕ} (R : Fin n → Fin n → Prop) : (∀ C ∈ components R, C.Nonempty) ∧ (∀ i : Fin n, ∃ C ∈ components R, i ∈ C) ∧ (∀ C ∈ components R, ∀ D ∈ components R, C ≠ D → Disjoint C D) := by classical have hmem : ∀ i j, j ∈ component R i ↔ EqvGen R i j := by intro i j simp [component] refine ⟨?_, ?_, ?_⟩ · intro C hC obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hC exact ⟨i, (hmem i i).mpr (.refl i)⟩ · intro i exact ⟨component R i, Finset.mem_image.mpr ⟨i, Finset.mem_univ i, rfl⟩, (hmem i i).mpr (.refl i)⟩ · intro C hC D hD hne obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hC obtain ⟨j, _, rfl⟩ := Finset.mem_image.mp hD apply Finset.disjoint_left.mpr intro k hik hjk apply hne have hij : EqvGen R i j := .trans i k j ((hmem i k).mp hik) (.symm j k ((hmem j k).mp hjk)) ext l rw [hmem, hmem] exact ⟨fun hil => .trans j i l (.symm i j hij) hil, fun hjl => .trans i j l hij hjl⟩ -
component_geometrytheorem — For an admissible local relation, each component has connected occupied cells and lies in one coarse cell, for the coarse count, cells, relation, and component.hypothesesProof (Lean source)
theorem component_geometry {n K : ℕ} (M : ℕ) (x : Fin n → Fin K) (R : Fin n → Fin n → Prop) (hR : Admissible M x R) (C : Finset (Fin n)) (hC : C ∈ components R) : PathConnected (C.image x) ∧ ∃ q, ∀ i ∈ C, (x i).val / (K / M) = q := by classical obtain ⟨a, _, rfl⟩ := Finset.mem_image.mp hC have hmem : ∀ i, i ∈ component R a ↔ EqvGen R a i := by intro i simp [component] let S : component R a → component R a → Prop := fun i j => R i j -- Lift closure paths to the class: each intermediate vertex is equivalent to a. have hlift : ∀ i j, EqvGen R i j → ∀ (hi : i ∈ component R a) (hj : j ∈ component R a), EqvGen S ⟨i, hi⟩ ⟨j, hj⟩ := by intro i j hij induction hij with | rel i j hij => intro hi hj exact .rel _ _ hij | refl i => intro hi hj exact .refl _ | symm i j hij ih => intro hj hi exact .symm _ _ (ih hi hj) | trans i j k hij hjk ihij ihjk => intro hi hk have hj := (hmem j).mpr (.trans a i j ((hmem i).mp hi) hij) exact .trans _ _ _ (ihij hi hj) (ihjk hj hk) constructor · apply connected_image_of_local_relation (component R a) x S · intro i j hij exact (hR i j hij).1 · intro i j have hij : EqvGen R (i : Fin n) (j : Fin n) := .trans (i : Fin n) a (j : Fin n) (.symm a i ((hmem i).mp i.property)) ((hmem j).mp j.property) exact hlift i j hij i.property j.property · refine ⟨(x a).val / (K / M), ?_⟩ intro i hi have heq : ∀ u v, EqvGen R u v → (x u).val / (K / M) = (x v).val / (K / M) := by intro u v huv induction huv with | rel u v huv => exact (hR u v huv).2 | refl u => rfl | symm u v huv ih => exact ih.symm | trans u v w huv hvw ihuv ihvw => exact ihuv.trans ihvw exact (heq a i ((hmem i).mp hi)).symm -
singleScore_le_subsetstheorem — For admissible cells and relation, the single-component score is bounded by the sum over all connected labelled subsets, for the given coarse count, cells, relation, and marks.hypothesesconclusionsingleScore R b≤ ∑ C ∈ Finset.univ.powerset, if PathConnected (C.image x) then singleWeight C b else 0Proof (Lean source)
theorem singleScore_le_subsets {n K : ℕ} (M : ℕ) (x : Fin n → Fin K) (R : Fin n → Fin n → Prop) (b : Fin n → Bool) (hR : Admissible M x R) : singleScore R b ≤ ∑ C ∈ Finset.univ.powerset, if PathConnected (C.image x) then singleWeight C b else 0 := by have hn : ∀ C : Finset (Fin n), 0 ≤ singleWeight C b := by intro C unfold singleWeight positivity unfold singleScore calc _ = ∑ C ∈ components R, if PathConnected (C.image x) then singleWeight C b else 0 := by apply Finset.sum_congr rfl intro C hC rw [if_pos (component_geometry M x R hR C hC).1] _ ≤ _ := Finset.sum_le_sum_of_subset_of_nonneg (fun C _ => Finset.mem_powerset.mpr (Finset.subset_univ C)) (by intro C _ _ split_ifs <;> first | exact hn C | exact le_rfl)
Probability 3 core · 4 supporting The model specifies exact uniform singleton masses on the finite path, exact Bernoulli marginals, independence within each family, and independence of the two complete vectors. ★ fixed_subset_assignment_mark_probability
Fixed labelled subset probabilities for uniform samples and independent marks
The model specifies exact uniform singleton masses on the finite path, exact Bernoulli marginals, independence within each family, and independence of the two complete vectors. Thus it is a genuine iid uniform model, with no upper-mass surrogate. All event bounds are derived, rather than assumed in the model.
The sample measure, cell variables, mark variables, and success probability specify an iid uniform marked sample through probability-law normalization, [a valid mark probability] (hyp:epsilon_nonneg,epsilon_le_one), [measurable cells and marks] (hyp:cells_measurable,marks_measurable), uniform cell and Bernoulli mark marginals, [within-family independence] (hyp:cells_independent,marks_independent), and independence of the two complete vectors.
Definition (Lean source)
The marked cardinality of a labelled subset under a Boolean marking is its number of true marks.
In the uniform marked model, cell assignments on a fixed subset and mark assignments on any fixed subset hold jointly with probability exactly 1/K to the power of the size of the first subset, times the product over the second subset of ε for each label prescribed a true mark and 1 − ε for each label prescribed a false mark. The two subsets may overlap or be different.
Formal statement
Proof (Lean source)
4 supporting declarations (lemmas, instances)
-
fixed_subset_assignment_probabilitytheorem — In the uniform marked model, any specified assignments on a fixed labelled subset have exact reciprocal-power probability.hypothesesconclusionμ {ω | ∀ i : s, X i ω = a i} = (K : ℝ≥0∞)⁻¹ ^ s.cardProof (Lean source)
theorem fixed_subset_assignment_probability {n K : ℕ} {μ : Measure Ω} {X : Fin n → Ω → Fin K} {B : Fin n → Ω → Bool} {ε : ℝ} (h : UniformMarkedSample μ X B ε) (s : Finset (Fin n)) (a : s → Fin K) : μ {ω | ∀ i : s, X i ω = a i} = (K : ℝ≥0∞)⁻¹ ^ s.card := by classical have hi := h.cells_independent.precomp (g := fun i : s => (i : Fin n)) val_injective have hp := hi.measure_inter_preimage_eq_mul Finset.univ (sets := fun i => {a i}) (fun _ _ => MeasurableSet.singleton _) have he : (⋂ i ∈ (Finset.univ : Finset s), X (i : Fin n) ⁻¹' {a i}) = {ω | ∀ i : s, X i ω = a i} := by ext ω; simp rw [he] at hp simp only [preimage, Set.mem_singleton_iff] at hp simpa only [h.cells_uniform, Finset.prod_const, Finset.card_univ, Fintype.card_coe] using hp -
assignment_two_specified_marks_probabilitytheorem — A fixed cell assignment and two distinct successful marks under the uniform marked model have the exact product probability.hypothesesΩ :sharedType u_1n K :ℕμ :Measure Ωε :ℝh :UniformMarkedSample μ X B εa :s → Fin Ki j :Fin nhij :i ≠ jProof (Lean source)
theorem assignment_two_specified_marks_probability {n K : ℕ} {μ : Measure Ω} {X : Fin n → Ω → Fin K} {B : Fin n → Ω → Bool} {ε : ℝ} (h : UniformMarkedSample μ X B ε) (s : Finset (Fin n)) (a : s → Fin K) (i j : Fin n) (hij : i ≠ j) : (μ {ω | (∀ k : s, X k ω = a k) ∧ B i ω = true ∧ B j ω = true}).toReal = ε ^ 2 / (K : ℝ) ^ s.card := by classical have hp := fixed_subset_assignment_mark_probability h s {i, j} a (fun _ => true) have he : {ω | (∀ k : s, X k ω = a k) ∧ ∀ k : (↑({i, j} : Finset (Fin n))), B k ω = true} = {ω | (∀ k : s, X k ω = a k) ∧ B i ω = true ∧ B j ω = true} := by ext ω simp rw [he] at hp simp only [ite_true, Finset.prod_const, Finset.card_univ, Fintype.card_coe, Finset.card_pair hij] at hp rw [hp] simp only [ENNReal.toReal_mul, ENNReal.toReal_pow, ENNReal.toReal_inv, ENNReal.toReal_natCast, ENNReal.toReal_ofReal h.epsilon_nonneg] simp [div_eq_mul_inv, mul_comm] -
assignment_two_marks_probability_letheorem — In the independent uniform model, a fixed assignment with at least two marks has probability at most the reciprocal-power cell probability times the quadratic Bernoulli union factor.hypothesesProof (Lean source)
theorem assignment_two_marks_probability_le {n K : ℕ} {μ : Measure Ω} {X : Fin n → Ω → Fin K} {B : Fin n → Ω → Bool} {ε : ℝ} (h : UniformMarkedSample μ X B ε) (s : Finset (Fin n)) (a : s → Fin K) : (μ {ω | (∀ i : s, X i ω = a i) ∧ 2 ≤ markCount s (fun i => B i ω)}).toReal ≤ ε ^ 2 * (s.card : ℝ) ^ 2 / (K : ℝ) ^ s.card := by classical have : IsProbabilityMeasure μ := h.probability let E : s × s → Set Ω := fun p => if (p.1 : Fin n) = p.2 then ∅ else {ω | (∀ i : s, X i ω = a i) ∧ B p.1 ω = true ∧ B p.2 ω = true} have hsub : {ω | (∀ i : s, X i ω = a i) ∧ 2 ≤ markCount s (fun i => B i ω)} ⊆ ⋃ p, E p := by intro ω hω obtain ⟨i, hi, j, hj, hij⟩ := Finset.one_lt_card.mp hω.2 obtain ⟨his, hib⟩ := Finset.mem_filter.mp hi obtain ⟨hjs, hjb⟩ := Finset.mem_filter.mp hj refine Set.mem_iUnion.mpr ⟨(⟨i, his⟩, ⟨j, hjs⟩), ?_⟩ simpa [E, hij] using intro hω.1 (intro hib hjb) have hbound : ∀ p : s × s, μ.real (E p) ≤ ε ^ 2 / (K : ℝ) ^ s.card := by intro p by_cases hij : (p.1 : Fin n) = p.2 · simp only [E, if_pos hij, measureReal_empty] exact div_nonneg (sq_nonneg ε) (pow_nonneg (Nat.cast_nonneg K) _) · exact le_of_eq (by simpa only [E, if_neg hij, Measure.real] using assignment_two_specified_marks_probability h s a p.1 p.2 hij) calc _ ≤ μ.real (⋃ p, E p) := measureReal_mono hsub _ ≤ ∑ p : s × s, μ.real (E p) := measureReal_iUnion_fintype_le E _ ≤ ∑ _p : s × s, ε ^ 2 / (K : ℝ) ^ s.card := Finset.sum_le_sum (fun p _ => hbound p) _ = _ := by simp [Fintype.card_prod, Fintype.card_coe]; ring -
assignment_pair_marks_probability_letheorem — In the independent uniform model, assignments on two disjoint labelled subsets with one mark in each have probability at most the reciprocal-power cell probability times ε² times the two sizes.hypothesesΩ :sharedType u_1n K :ℕμ :Measure Ωε :ℝh :UniformMarkedSample μ X B εhdisj :Disjoint s ta :s → Fin Kb :t → Fin KProof (Lean source)
theorem assignment_pair_marks_probability_le {n K : ℕ} {μ : Measure Ω} {X : Fin n → Ω → Fin K} {B : Fin n → Ω → Bool} {ε : ℝ} (h : UniformMarkedSample μ X B ε) (s t : Finset (Fin n)) (hdisj : Disjoint s t) (a : s → Fin K) (b : t → Fin K) : (μ {ω | (∀ i : s, X i ω = a i) ∧ (∀ i : t, X i ω = b i) ∧ 1 ≤ markCount s (fun i => B i ω) ∧ 1 ≤ markCount t (fun i => B i ω)}).toReal ≤ ε ^ 2 * (s.card : ℝ) * (t.card : ℝ) / (K : ℝ) ^ (s.card + t.card) := by classical have : IsProbabilityMeasure μ := h.probability let c : (↑(s ∪ t) : Type) → Fin K := fun i => if hi : (i : Fin n) ∈ s then a ⟨i, hi⟩ else b ⟨i, (Finset.mem_union.mp i.property).resolve_left hi⟩ have hc : ∀ ω, (∀ i : (↑(s ∪ t) : Type), X i ω = c i) ↔ (∀ i : s, X i ω = a i) ∧ (∀ i : t, X i ω = b i) := by intro ω constructor · intro hw constructor · intro i simpa only [c, dif_pos i.property] using hw ⟨i, Finset.mem_union_left t i.property⟩ · intro i have hi : (i : Fin n) ∉ s := fun hs => Finset.disjoint_left.mp hdisj hs i.property simpa only [c, dif_neg hi] using hw ⟨i, mem_union_right s i.property⟩ · rintro ⟨hs, ht⟩ i by_cases hi : (i : Fin n) ∈ s · simpa only [c, dif_pos hi] using hs ⟨i, hi⟩ · simpa only [c, dif_neg hi] using ht ⟨i, (Finset.mem_union.mp i.property).resolve_left hi⟩ let E : s × t → Set Ω := fun p => {ω | (∀ i : (↑(s ∪ t) : Type), X i ω = c i) ∧ B p.1 ω = true ∧ B p.2 ω = true} have hsub : {ω | (∀ i : s, X i ω = a i) ∧ (∀ i : t, X i ω = b i) ∧ 1 ≤ markCount s (fun i => B i ω) ∧ 1 ≤ markCount t (fun i => B i ω)} ⊆ ⋃ p, E p := by rintro ω ⟨hs, ht, hms, hmt⟩ obtain ⟨i, hi⟩ := Finset.one_le_card.mp hms obtain ⟨j, hj⟩ := Finset.one_le_card.mp hmt obtain ⟨his, hib⟩ := Finset.mem_filter.mp hi obtain ⟨hjt, hjb⟩ := Finset.mem_filter.mp hj exact Set.mem_iUnion.mpr ⟨(⟨i, his⟩, ⟨j, hjt⟩), (hc ω).mpr ⟨hs, ht⟩, hib, hjb⟩ have hbound : ∀ p : s × t, μ.real (E p) = ε ^ 2 / (K : ℝ) ^ (s.card + t.card) := by intro p have hij : (p.1 : Fin n) ≠ p.2 := by intro he exact Finset.disjoint_left.mp hdisj p.1.property (he ▸ p.2.property) simpa only [E, Measure.real, Finset.card_union_of_disjoint hdisj] using assignment_two_specified_marks_probability h (s ∪ t) c p.1 p.2 hij calc _ ≤ μ.real (⋃ p, E p) := measureReal_mono hsub _ ≤ ∑ p : s × t, μ.real (E p) := measureReal_iUnion_fintype_le E _ = ∑ _p : s × t, ε ^ 2 / (K : ℝ) ^ (s.card + t.card) := Finset.sum_congr rfl (fun p _ => hbound p) _ = _ := by simp [Fintype.card_prod, Fintype.card_coe]; ring
PairClasses 2 core · 0 supporting A pair class groups two adjacent coarse cells.
Consecutive coarse-cell pair classes
A pair class groups two adjacent coarse cells. These definitions are independent of counting and component proofs, allowing those proof layers to share a stable interface. Divisibility and evenness are imposed by the counting theorems.
The index of the consecutive coarse-cell pair containing a fine cell, for fine and coarse cell counts K and M, is the cell's position divided by twice the coarse-cell width K/M, both quotients rounded down (and equal to zero when the width K/M rounds down to zero).
Definition (Lean source)
Two labelled assignments have all their cells in one common consecutive coarse-cell pair, with pair index below half the coarse count, for the given cell counts.
Arithmetic 3 core · 3 supporting Binomial and factorial bounds absorb labelled subset counts into powers of 8 exp(1) n/K. ★ occupancySeries_geometric_le
Finite occupancy majorants
Binomial and factorial bounds absorb labelled subset counts into powers of 8 exp(1) n/K. These finite bounds hold at every positive density; the optional geometric estimate uses the required small-density hypothesis explicitly.
The density parameter for n uniform draws into K cells is eight times exp(1) times n/K.
Definition (Lean source)
The finite majorant of order p for sample and cell counts is the sum, over sizes m from two through n, of m to the power p times the density parameter 8 exp(1) n/K raised to the power m; it is zero when n is below two.
Definition (Lean source)
For an order p, a sample size n, and a cell count K with p at most eleven, K positive, and density n / K at most 2 to the power −40, the finite occupancy series is at most twice its size-two term, namely 2 · 2^p times the square of the occupancy parameter.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
labelled_weight_majoranttheorem — With positive cell count and size at least two, the binomial subset count times the connected-assignment and mark-size weights is bounded by its exponential majorant term, for n,m,K.hypothesesn m K :ℕhK :0 < Khm :2 ≤ mp :ℕconclusion(n.choose m : ℝ) * (m : ℝ) ^ p * 8 ^ m * (m : ℝ) ^ m / (K : ℝ) ^ m≤ (m : ℝ) ^ (p + 1) * occupancyZ n K ^ mProof (Lean source)
theorem labelled_weight_majorant (n m K : ℕ) (hK : 0 < K) (hm : 2 ≤ m) (p : ℕ) : (n.choose m : ℝ) * (m : ℝ) ^ p * 8 ^ m * (m : ℝ) ^ m / (K : ℝ) ^ m ≤ (m : ℝ) ^ (p + 1) * occupancyZ n K ^ m := by have hmR : (2 : ℝ) ≤ m := by exact_mod_cast hm have hf : (0 : ℝ) < m.factorial := by exact_mod_cast m.factorial_pos have he : 0 < exp (1 : ℝ) := Real.exp_pos _ have hsqrt : 1 ≤ sqrt (2 * pi * m) := by apply Real.one_le_sqrt.mpr nlinarith [Real.pi_gt_three] have hst : ((m : ℝ) / exp 1) ^ m ≤ (m.factorial : ℝ) := by calc _ ≤ sqrt (2 * pi * m) * ((m : ℝ) / exp 1) ^ m := by exact le_mul_of_one_le_left (by positivity) hsqrt _ ≤ _ := Stirling.le_factorial_stirling m have hpow : (m : ℝ) ^ m ≤ (m.factorial : ℝ) * exp 1 ^ m := by rw [div_pow, div_le_iff₀ (by positivity)] at hst exact hst have hc : (n.choose m : ℝ) * (m : ℝ) ^ m ≤ (n : ℝ) ^ m * exp 1 ^ m := by calc _ ≤ ((n : ℝ) ^ m / (m.factorial : ℝ)) * (m : ℝ) ^ m := by gcongr exact Nat.choose_le_pow_div m n _ ≤ ((n : ℝ) ^ m / (m.factorial : ℝ)) * ((m.factorial : ℝ) * exp 1 ^ m) := by gcongr _ = _ := by field_simp have hKpow : (0 : ℝ) < (K : ℝ) ^ m := by positivity calc _ = ((n.choose m : ℝ) * (m : ℝ) ^ m) * ((m : ℝ) ^ p * 8 ^ m) / (K : ℝ) ^ m := by ring _ ≤ ((n : ℝ) ^ m * exp 1 ^ m) * ((m : ℝ) ^ p * 8 ^ m) / (K : ℝ) ^ m := by gcongr _ = (m : ℝ) ^ p * occupancyZ n K ^ m := by simp only [occupancyZ, div_pow, mul_pow] ring _ ≤ (m : ℝ) ^ (p + 1) * occupancyZ n K ^ m := by rw [pow_succ] apply mul_le_mul_of_nonneg_right · exact le_mul_of_one_le_right (by positivity) (by linarith) · unfold occupancyZ positivity -
finite_labelled_weight_majoranttheorem — With at least two draws and positive cell count, the finite sum of labelled occupancy terms is bounded by the finite exponential series, for order and counts.hypothesesp n K :ℕhn :2 ≤ nhK :0 < Kconclusion(∑ m ∈ Icc 2 n, (n.choose m : ℝ) * (m : ℝ) ^ p * 8 ^ m * (m : ℝ) ^ m / (K : ℝ) ^ m)≤ occupancySeries (p + 1) n KProof (Lean source)
theorem finite_labelled_weight_majorant (p n K : ℕ) (hn : 2 ≤ n) (hK : 0 < K) : (∑ m ∈ Icc 2 n, (n.choose m : ℝ) * (m : ℝ) ^ p * 8 ^ m * (m : ℝ) ^ m / (K : ℝ) ^ m) ≤ occupancySeries (p + 1) n K := by calc _ ≤ ∑ m ∈ Icc 2 n, (m : ℝ) ^ (p + 1) * occupancyZ n K ^ m := by apply Finset.sum_le_sum intro m hm exact labelled_weight_majorant n m K hK (Finset.mem_Icc.mp hm).1 p _ = occupancySeries (p + 1) n K := by have hi : Icc 2 n = Ico 2 (n + 1) := by ext m simp only [Finset.mem_Icc, Finset.mem_Ico] omega rw [hi, Finset.sum_Ico_eq_sum_range] have hl : n + 1 - 2 = n - 1 := by omega simp only [hl, occupancySeries, Nat.cast_add, Nat.cast_ofNat] congr 1 ext j simp [add_comm] -
occupancyZ_smalltheorem — For a sample size n and a cell count K with K positive and density n / K at most 2 to the power −40, the occupancy parameter lies between zero and 2 to the power −35.hypothesesn K :ℕhK :0 < Khdensity :(n : ℝ) / K ≤ (2 : ℝ) ^ (-40 : ℤ)Proof (Lean source)
theorem occupancyZ_small (n K : ℕ) (hK : 0 < K) (hdensity : (n : ℝ) / K ≤ (2 : ℝ) ^ (-40 : ℤ)) : 0 ≤ occupancyZ n K ∧ occupancyZ n K ≤ (2 : ℝ) ^ (-35 : ℤ) := by have hKR : (0 : ℝ) < K := by exact_mod_cast hK constructor · unfold occupancyZ positivity · have he : exp 1 ≤ 4 := le_trans Real.exp_one_lt_three.le (by norm_num) have hnK : (0 : ℝ) ≤ (n : ℝ) / K := by positivity calc occupancyZ n K = (8 * exp 1) * ((n : ℝ) / K) := by unfold occupancyZ ring _ ≤ (8 * 4) * (2 : ℝ) ^ (-40 : ℤ) := by gcongr _ = (2 : ℝ) ^ (-35 : ℤ) := by norm_num
Bounds 2 core · 0 supporting The main results apply to every measurable random local subrelation, with exact iid uniform fine-cell draws and independent Bernoulli marks. ★ single_component_occupancy★ paired_component_occupancy
Fixed-sample marked connected-component occupancy bounds
The main results apply to every measurable random local subrelation, with exact iid uniform fine-cell draws and independent Bernoulli marks. The relation need not include all eligible edges and may depend on the marks or extra randomness.
The proof chain exposes fixed-subset event bounds, then labelled-subset union bounds, then elementary finite exponential majorants. Both headline bounds keep the requested finite sums; the paired bound retains the essential size-two cutoff.
With n at least two, M at least two and even, K at least 16 M, iid uniform fine-cell draws and independent Bernoulli marks, and any measurable local subrelation, the expected two-mark component weight is at most ε² K times the order-eleven finite occupancy series.
Formal statement
Proof (Lean source)
Place n ≥ 2 sample points in K fine cells on a path, grouped into M consecutive coarse cells, where M ≥ 2, M is even, M divides K and K ≥ 16 M. Suppose the points' cells are independent and uniform over the K fine cells, each point is marked with probability ε ∈ [0, 1] independently of the other points, and the marks are independent of the cells. Let a random relation on the points be such that each of its edge events is measurable and in every outcome each edge joins two points whose fine cells are equal or neighbouring and lie in the same coarse cell. Then the expected paired score — half the sum, over ordered pairs of distinct connected components C and D of the relation that each have at least two points, each contain at least one marked point, and together lie in one consecutive pair of coarse cells, of |C|⁴ 8^|C| · |D|⁴ 8^|D| — is at most 2 ε² K² / M times the square of the finite occupancy series Σ_{m=2}^{n} m⁶ (8 e n / K)^m.
Formal statement
Proof (Lean source)
CoarsePairs 1 core · 1 supporting For an even coarse count dividing the fine count, all pair classes have width twice the fine-to-coarse ratio. ★ unordered_same_pair_count
Counting fine-cell anchors in consecutive coarse pairs
For an even coarse count dividing the fine count, all pair classes have width twice the fine-to-coarse ratio. Ordered anchor pairs include diagonal pairs; unordered distinct-cell pairs use their unique increasing orientation.
When the coarse count is positive and even and divides the positive fine count, the number of unordered distinct cell pairs within one coarse pair is at most K squared over M. Unordered pairs are represented uniquely by their increasing orientation.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
ordered_same_pair_counttheorem — Under positive even coarse count and divisibility, the ordered same-pair anchor count, including equal anchors, is exactly twice K squared over M, for the cell counts.hypothesesK M :ℕhM :0 < MhK :0 < Kheven :2 ∣ Mhdiv :M ∣ KProof (Lean source)
theorem ordered_same_pair_count (K M : ℕ) (hM : 0 < M) (hK : 0 < K) (heven : 2 ∣ M) (hdiv : M ∣ K) : M * card {p : Fin K × Fin K // pairClass K M p.1 = pairClass K M p.2} = 2 * K ^ 2 := by classical let n := M / 2 let w := 2 * (K / M) have hMn : M = 2 * n := (Nat.mul_div_cancel' heven).symm have hKq : M * (K / M) = K := Nat.mul_div_cancel' hdiv have hKw : K = n * w := by calc K = M * (K / M) := hKq.symm _ = (2 * n) * (K / M) := congrArg (fun m => m * (K / M)) hMn _ = n * w := by dsimp [w]; ring have hw : 0 < w := by have : 0 < K / M := Nat.div_pos (Nat.le_of_dvd hK hdiv) hM dsimp [w]; omega let enc (a : Fin K) : Fin n × Fin w := (⟨a.val / w, (Nat.div_lt_iff_lt_mul hw).2 (by rw [← hKw]; exact a.isLt)⟩, ⟨a.val % w, Nat.mod_lt _ hw⟩) let dec (p : Fin n × Fin w) : Fin K := ⟨p.1.val * w + p.2.val, by rw [hKw] exact lt_of_lt_of_le (Nat.add_lt_add_left p.2.isLt _) (by simpa [Nat.add_mul] using Nat.mul_le_mul_right w (succ_le_of_lt p.1.isLt))⟩ have hencdec (p : Fin n × Fin w) : enc (dec p) = p := by apply Prod.ext <;> apply Fin.ext · change (p.1.val * w + p.2.val) / w = p.1.val rw [Nat.add_comm, Nat.mul_comm p.1.val w, Nat.add_mul_div_left _ _ hw, Nat.div_eq_of_lt p.2.isLt, Nat.zero_add] · change (p.1.val * w + p.2.val) % w = p.2.val simp [Nat.add_mod, Nat.mod_eq_of_lt p.2.isLt] have hdecenc (a : Fin K) : dec (enc a) = a := by apply Fin.ext change a.val / w * w + a.val % w = a.val simpa [Nat.mul_comm] using Nat.div_add_mod a.val w let E : {p : Fin K × Fin K // pairClass K M p.1 = pairClass K M p.2} ≃ Fin n × (Fin w × Fin w) := { toFun := fun p => ((enc p.val.1).1, (enc p.val.1).2, (enc p.val.2).2) invFun := fun t => ⟨(dec (t.1, t.2.1), dec (t.1, t.2.2)), by change (enc (dec (t.1, t.2.1))).1.val = (enc (dec (t.1, t.2.2))).1.val rw [hencdec, hencdec]⟩ left_inv := by intro p have hp : (enc p.val.1).1 = (enc p.val.2).1 := Fin.ext p.property apply Subtype.ext apply Prod.ext · exact hdecenc p.val.1 · change dec ((enc p.val.1).1, (enc p.val.2).2) = p.val.2 rw [hp]; exact hdecenc p.val.2 right_inv := by intro t change ((enc (dec (t.1, t.2.1))).1, (enc (dec (t.1, t.2.1))).2, (enc (dec (t.1, t.2.2))).2) = t rw [hencdec, hencdec] } rw [Nat.card_congr E, Nat.card_prod, Nat.card_prod, Nat.card_fin, Nat.card_fin] rw [hMn, hKw] ring
ConnectedAssignments 1 core · 1 supporting Every nonempty connected assignment is encoded by its leftmost occupied cell and one bounded offset for each label. ★ connected_assignment_count
Counting connected labelled assignments
Every nonempty connected assignment is encoded by its leftmost occupied cell and one bounded offset for each label. The resulting injection gives the finite-path assignment count used in occupancy union bounds.
For a nonempty labelled type, the number of connected assignments to the finite path is at most the number of cells times the cardinality of the labelled type raised to itself.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
connected_assignment_encodingtheorem — Connected assignments on nonempty labels, to a finite path, have an injective encoding by an occupied anchor and a bounded offset for each label, reconstructing the original fine-cell values.hypothesesProof (Lean source)
theorem connected_assignment_encoding {ι : Type*} [Fintype ι] (K : ℕ) (hm : 1 ≤ card ι) : ∃ encode : {x : ι → Fin K // ConnectedAssignment x} → Fin K × (ι → Fin (card ι)), Injective encode ∧ ∀ x, (encode x).1 ∈ Finset.univ.image x.val ∧ ∀ i, (x.val i).val = (encode x).1.val + ((encode x).2 i).val := by classical have hlabels : (Finset.univ : Finset ι).Nonempty := by apply Finset.card_pos.mp simpa using (Nat.zero_lt_of_lt hm) have hanchor : ∀ x : {x : ι → Fin K // ConnectedAssignment x}, ∃ a ∈ Finset.univ.image x.val, ∀ i, a.val ≤ (x.val i).val ∧ (x.val i).val < a.val + card ι := by intro x have hnonempty : (Finset.univ.image x.val).Nonempty := by obtain ⟨i, hi⟩ := hlabels exact ⟨x.val i, Finset.mem_image.mpr ⟨i, hi, rfl⟩⟩ obtain ⟨a, ha, hcover⟩ := connected_run_cover _ hnonempty x.property refine ⟨a, ha, fun i => ?_⟩ have hi := hcover (x.val i) (Finset.mem_image.mpr ⟨i, Finset.mem_univ i, rfl⟩) have hcard : (Finset.univ.image x.val).card ≤ card ι := by simpa using (Finset.card_image_le (s := Finset.univ) (f := x.val)) constructor · exact hi.1 · exact hi.2.trans_le (Nat.add_le_add_left hcard a.val) let anchor := fun x => choose (hanchor x) have ha := fun x => Classical.choose_spec (hanchor x) let encode : {x : ι → Fin K // ConnectedAssignment x} → Fin K × (ι → Fin (card ι)) := fun x => (anchor x, fun i => ⟨(x.val i).val - (anchor x).val, by have hi := (ha x).2 i change (anchor x).val ≤ (x.val i).val ∧ (x.val i).val < (anchor x).val + card ι at hi omega⟩) have hreconstruct : ∀ x i, (x.val i).val = (encode x).1.val + ((encode x).2 i).val := by intro x i have hi := (ha x).2 i change (anchor x).val ≤ (x.val i).val ∧ (x.val i).val < (anchor x).val + card ι at hi change (x.val i).val = (anchor x).val + ((x.val i).val - (anchor x).val) omega refine ⟨encode, ?_, fun x => ⟨(ha x).1, hreconstruct x⟩⟩ intro x y hxy apply Subtype.ext funext i apply Fin.ext rw [hreconstruct x i, hreconstruct y i, hxy]
Counting 1 core · 0 supporting Two connected labelled assignments in a common consecutive coarse pair have an encoding by their ordered anchors and their labelled offsets. ★ connected_same_pair_assignment_count
Counting connected assignment pairs
Two connected labelled assignments in a common consecutive coarse pair have an encoding by their ordered anchors and their labelled offsets. Equal anchors are retained because distinct components of a local subrelation can occupy the same fine cell. The imported modules expose the individual assignment count and the ordered and unordered fine-cell pair counts.
For two nonempty labelled types and positive even coarse count dividing the fine count, the coarse count M times the number of pairs of connected assignments, one from each labelled type, whose cells all lie in one common coarse pair is at most 2 K² m^m l^l, where K is the fine count and m and l are the sizes of the two labelled types.
Formal statement
Proof (Lean source)
PairedExpectation 1 core · 0 supporting The marked disjoint-subset event bound and pointwise component domination yield an expected paired score bounded by a square of a finite labelled-subset sum. ★ paired_expectation_labelled_le
Expected paired-component score via labelled subsets
The marked disjoint-subset event bound and pointwise component domination yield an expected paired score bounded by a square of a finite labelled-subset sum. Only deterministic sums are factorized; random components need not be independent. Both component cardinality cutoffs remain at two, and occupied cells may coincide.
In the iid uniform marked model, for a measurable local subrelation, the expected distinct-component score is bounded by twice ε² K²/M times the square of the labelled-subset sum, under positive even coarse count and divisibility. The labelled-subset sum runs over sizes m from two through n and adds choose(n, m) · m^5 · 8^m · m^m / K^m.
Formal statement
Proof (Lean source)
PairEvents 1 core · 0 supporting This layer combines exact uniform assignment probabilities and independent Bernoulli marks with connected-run pair counting. ★ subsets_connected_pair_marks_le
Connected marked pair events on disjoint labelled subsets
This layer combines exact uniform assignment probabilities and independent Bernoulli marks with connected-run pair counting. Disjointness concerns sample labels; the occupied fine cells and run anchors may coincide.
In the uniform marked model with a coarse cell count that is positive, even, and divides the positive fine cell count, two disjoint label subsets of size at least two satisfy the following: the probability that each subset occupies a path-connected set of cells, each carries at least one mark, and the two share a coarse pair is at most 2 ε² K² / M times |C| to the power |C| + 1 times |D| to the power |D| + 1, divided by K to the power |C| + |D|.
Formal statement
Proof (Lean source)
ScoreMeasurability 1 core · 2 supporting A random relation is encoded by finitely many Boolean edge indicators. ★ integrable_pairedScore
Measurability and integrability of finite component scores
A random relation is encoded by finitely many Boolean edge indicators. Every component statistic then factors through a finite measurable vector of edges, cells, and marks. This proves measurability and integrability without restricting how the relation depends on cells, marks, or additional randomness.
Measurable edge events, cells, and marks on a finite-measure space make the random paired-component score integrable, for coarse count, relation, cells, and marks.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
measurable_componentstheorem — Measurable edge events of a random finite relation give a measurable component partition.hypothesesconclusionMeasurable (fun ω => components (R ω))Proof (Lean source)
theorem measurable_components {n : ℕ} (R : Ω → Fin n → Fin n → Prop) (hR : ∀ i j, MeasurableSet {ω | R ω i j}) : Measurable (fun ω => components (R ω)) := by classical let edges : Ω → Fin n → Fin n → Bool := fun ω i j => decide (R ω i j) have hedges : Measurable edges := by apply measurable_pi_lambda intro i apply measurable_pi_lambda intro j apply measurable_to_bool convert hR i j using 1 ext ω simp [edges] have hdecode : ∀ ω, (fun i j => edges ω i j = true) = R ω := by intro ω funext i j apply propext simp [edges] have hpartition := (measurable_of_finite (fun e : Fin n → Fin n → Bool => components (fun i j => e i j = true))).comp hedges simpa only [Function.comp_def, hdecode] using hpartition -
integrable_singleScoretheorem — Measurable edge events and marks on a finite-measure space make the random single-component score integrable, for the supplied relation and marking.hypothesesconclusionIntegrable (fun ω => singleScore (R ω) (fun i => B i ω)) μProof (Lean source)
theorem integrable_singleScore {n : ℕ} (μ : Measure Ω) [IsFiniteMeasure μ] (R : Ω → Fin n → Fin n → Prop) (B : Fin n → Ω → Bool) (hR : ∀ i j, MeasurableSet {ω | R ω i j}) (hB : ∀ i, Measurable (B i)) : Integrable (fun ω => singleScore (R ω) (fun i => B i ω)) μ := by classical let score : Finset (Finset (Fin n)) × (Fin n → Bool) → ℝ := fun p => ∑ C ∈ p.1, singleWeight C p.2 have hinput : Measurable (fun ω => (components (R ω), fun i => B i ω)) := (measurable_components R hR).prodMk (measurable_pi_lambda _ hB) exact ((SimpleFunc.ofFinite score).comp _ hinput).integrable_of_isFiniteMeasure
SingleEvents 1 core · 0 supporting The single-subset union bound combines the exact uniform assignment law, the quadratic Bernoulli mark bound, and the connected-run assignment count. ★ subset_connected_two_marks_le
Connected two-mark events on a fixed labelled subset
The single-subset union bound combines the exact uniform assignment law, the quadratic Bernoulli mark bound, and the connected-run assignment count. This layer does not depend on paired counting or random component measurability.
In the iid uniform marked model, a fixed subset of size at least two has connected occupied cells and at least two marks with probability at most ε² · K · m^(m+2) / K^m, where m is the subset's size, with positive cell count.
Formal statement
Proof (Lean source)
SingleExpectation 1 core · 0 supporting Pointwise domination by all connected labelled subsets, the fixed-subset two-mark event bound, and cardinality grouping give a finite labelled occupancy majorant. ★ single_expectation_labelled_le
Expected single-component score via labelled subsets
Pointwise domination by all connected labelled subsets, the fixed-subset two-mark event bound, and cardinality grouping give a finite labelled occupancy majorant. The random relation may depend on marks and extra randomness.
In the iid uniform marked model, for a measurable random local subrelation, the expected single score is at most ε² K times the labelled-subset occupancy sum, with positive K and coarse count M. The labelled-subset occupancy sum runs over sizes m from two through n and adds choose(n, m) · m^10 · 8^m · m^m / K^m.