matroid_threshold_pool_single_point_mask
For a finite list of query pools and a point x, there is a set W containing x such that no pool containing x has exactly one point outside W. The harmonic number of its size is at most one plus the sum of reciprocal sizes of the pools containing x. Every other point of W shares with x a pool lying entirely in W.
Statement
theorem matroid_threshold_pool_single_point_mask {n m : ℕ} (P : Fin m → Finset (Fin n)) (x : Fin n) : ∃ W : Finset (Fin n), x ∈ W ∧ harmonic W.card ≤ 1 + ∑ i ∈ Finset.univ.filter (fun i => x ∈ P i), ((P i).card : ℚ)⁻¹ ∧ (∀ i, x ∈ P i → (P i \ W).card ≠ 1) ∧ ∀ y ∈ W, y = x ∨ ∃ i, x ∈ P i ∧ y ∈ P i ∧ P i ⊆ W
- Source
- Two-batch deterministic independence queries for OP-1998, building on the valid single-basis removal in Section 3 of https://arxiv.org/abs/2611.23624.
- Verified
- 28 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Used by 1
- matroid_threshold_pool_free_cubeConsider at most Cn pools on n points with positive C. Suppose D bounds every size whose harmonic number is at most 1+4C, T is at least…
The proof, explained
The proof defines a family of candidate subsets containing x that satisfy a linkage condition (each point is either x or connected to x by a pool fully inside the set) and an upper bound on their harmonic number in terms of the fully contained pools. Since the singleton {x} is a candidate in a finite universe, a candidate W of maximal size exists. If any pool containing x had exactly one point y outside W, adding y to W would yield a strictly larger candidate satisfying all conditions, contradicting the maximality of W.
Define the candidate predicate for subsets of points.
We identify candidate subsets S ⊆ Fin n that contain x, satisfy a linkage condition (every element y ∈ S either equals x or shares with x a pool P_i contained entirely in S), and satisfy the harmonic bound H(|S|) ≤ 1 + ∑_{i ∈ used(S)} 1/|P_i|, where used(S) denotes the set of pools containing x that are subsets of S.
classical let rows := Finset.univ.filter (fun i => x ∈ P i) let w (i : Fin m) := ((P i).card : ℚ)⁻¹ let used (S : Finset (Fin n)) := rows.filter (fun i => P i ⊆ S) let linked (S : Finset (Fin n)) := ∀ y ∈ S, y = x ∨ ∃ i, x ∈ P i ∧ y ∈ P i ∧ P i ⊆ S let ok (S : Finset (Fin n)) := x ∈ S ∧ linked S ∧ harmonic S.card ≤ 1 + ∑ i ∈ used S, w i let candidates := Finset.univ.filter ok
The singleton set {x} is a valid candidate.
For S = {x}, x ∈ {x} is trivial. Any element y ∈ {x} equals x (by Finset.mem_singleton.mp), so the linkage property holds. Because each weight w(i) = 1/|P_i| is non-negative, the sum over used({x}) is non-negative (by Finset.sum_nonneg), which ensures H(|{x}|) = H(1) = 1 ≤ 1 + ∑_{i ∈ used({x})} w(i).
uses
Finset.mem_singleton.mp,Finset.sum_nonneghave initial : ok {x} := by refine ⟨by simp, fun y hy => Or.inl (Finset.mem_singleton.mp hy), ?_⟩ have hn : 0 ≤ ∑ i ∈ used {x}, w i := Finset.sum_nonneg (fun i _ => by dsimp [w]; positivity) simpa [harmonic, w] using hn
Select a candidate set W of maximal cardinality.
Since the set of candidates is finite and non-empty (as {x} is a candidate by Finset.mem_filter.mpr and Finset.mem_univ), Finset.exists_max_image yields a candidate W that maximizes |W|. By Finset.mem_filter.mp, W satisfies x ∈ W, is linked, and satisfies the harmonic inequality with respect to used(W).
uses
Finset.exists_max_image,Finset.mem_filter.mpr,Finset.mem_univ,Finset.mem_filter.mpobtain ⟨W, hW, hmax⟩ := Finset.exists_max_image candidates Finset.card (show candidates.Nonempty from ⟨{x}, Finset.mem_filter.mpr ⟨Finset.mem_univ _, initial⟩⟩) obtain ⟨hx, hlink, hsum⟩ : ok W := (Finset.mem_filter.mp hW).2
W satisfies all theorem conditions provided no pool containing x has exactly one element outside W.
The set W immediately satisfies x ∈ W and the linkage condition. The harmonic bound H(|W|) ≤ 1 + ∑_{x ∈ P_i} 1/|P_i| follows from H(|W|) ≤ 1 + ∑_{i ∈ used(W)} w(i) because used(W) is a subset of the pools containing x (Finset.filter_subset) and each weight is non-negative, so the sum increases by Finset.sum_le_sum_of_subset_of_nonneg, combined via add_le_add and le_refl. Thus it suffices to prove |P_i \ W| ≠ 1 whenever x ∈ P_i.
uses
add_le_add,le_refl,Finset.sum_le_sum_of_subset_of_nonneg,Finset.filter_subsetrefine ⟨W, hx, hsum.trans (add_le_add (le_refl 1) ?_), ?_, hlink⟩ · exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) (fun i _ _ => by dsimp [w]; positivity)
Assume for contradiction that some pool containing x has exactly one element outside W.
Suppose x ∈ P_i and |P_i \ W| = 1. By Finset.card_eq_one.mp, P_i \ W is a singleton {y}. By Finset.mem_singleton_self and Finset.mem_sdiff.mp, the element y belongs to P_i and does not belong to W.
uses
Finset.card_eq_one.mp,Finset.mem_singleton_self,Finset.mem_sdiff.mp· intro i hxi hone obtain ⟨y, he⟩ := Finset.card_eq_one.mp hone have hy : y ∈ P i \ W := he ▸ Finset.mem_singleton_self y obtain ⟨hyi, hyW⟩ := Finset.mem_sdiff.mp hy
The pool P_i is contained in W ∪ {y}, and i is not among the pools used by W.
Every z ∈ P_i is either in W (hence in W ∪ {y} by Finset.mem_insert_of_mem) or not in W, in which case z ∈ P_i \ W = {y} (Finset.mem_sdiff.mpr and Finset.mem_singleton.mp), so z = y ∈ W ∪ {y} (Finset.mem_insert.mpr). Thus P_i ⊆ W ∪ {y}. Since y ∈ P_i and y ∉ W, pool P_i cannot be a subset of W, meaning i ∉ used(W) (Finset.mem_filter.mp).
uses
Finset.mem_insert_of_mem,Finset.mem_insert.mpr,Finset.mem_singleton.mp,Finset.mem_sdiff.mpr,Finset.mem_filter.mphave hsub : P i ⊆ insert y W := by intro z hz by_cases h : z ∈ W · exact Finset.mem_insert_of_mem h · exact Finset.mem_insert.mpr (Or.inl (Finset.mem_singleton.mp (he ▸ Finset.mem_sdiff.mpr ⟨hz,h⟩))) have hi : i ∉ used W := fun hi => hyW ((Finset.mem_filter.mp hi).2 hyi)
The set of used pools grows to include pool i when y is adjoined to W.
Every pool j ∈ used(W) satisfies P_j ⊆ W ⊆ W ∪ {y} (Finset.subset_insert), and pool i satisfies x ∈ P_i ⊆ W ∪ {y}; hence used(W) ∪ {i} ⊆ used(W ∪ {y}) (using Finset.mem_insert.mp, Finset.mem_filter.mpr, Finset.mem_univ, Finset.mem_filter.mp). Since weights are non-negative, Finset.sum_le_sum_of_subset_of_nonneg and Finset.sum_insert give w(i) + ∑_{j ∈ used(W)} w(j) ≤ ∑_{j ∈ used(W ∪ {y})} w(j).
uses
Finset.mem_insert.mp,Finset.mem_filter.mpr,Finset.mem_univ,Finset.mem_filter.mp,Finset.subset_insert,Finset.sum_le_sum_of_subset_of_nonneg,Finset.sum_inserthave hh : insert i (used W) ⊆ used (insert y W) := by intro j hj rcases Finset.mem_insert.mp hj with rfl | hj · exact Finset.mem_filter.mpr ⟨Finset.mem_filter.mpr ⟨Finset.mem_univ _,hxi⟩, hsub⟩ · obtain ⟨hj', hjW⟩ := Finset.mem_filter.mp hj exact Finset.mem_filter.mpr ⟨hj',hjW.trans (Finset.subset_insert ..)⟩ have hsum' := Finset.sum_le_sum_of_subset_of_nonneg (f := w) hh (fun j _ _ => by dsimp [w]; positivity) rw [Finset.sum_insert hi] at hsum'
The weight w(i) is bounded below by 1/(|W| + 1).
Since P_i ⊆ W ∪ {y}, we have |P_i| ≤ |W ∪ {y}| by Finset.card_le_card. Because y ∉ W, |W ∪ {y}| = |W| + 1 by Finset.card_insert_of_notMem, so |P_i| ≤ |W| + 1. Since x ∈ P_i, the pool is non-empty, so |P_i| > 0 by Finset.card_pos.mpr. Taking reciprocals reverses the inequality by inv_anti₀, yielding 1/(|W| + 1) ≤ 1/|P_i| = w(i).
uses
Finset.card_le_card,Finset.card_insert_of_notMem,inv_anti₀,Finset.card_pos.mprhave hcard := Finset.card_le_card hsub rw [Finset.card_insert_of_notMem hyW] at hcard have hinv : ((W.card + 1 : ℕ) : ℚ)⁻¹ ≤ w i := by apply inv_anti₀ (by exact_mod_cast Finset.card_pos.mpr ⟨x,hxi⟩) exact_mod_cast hcard
The augmented set W ∪ {y} is also a candidate.
The point x is in W ∪ {y} because x ∈ W (Finset.mem_insert_of_mem). Any z ∈ W ∪ {y} is linked: if z = y, it is linked via pool i because x, y ∈ P_i ⊆ W ∪ {y}; if z ∈ W, its existing linkage pool P_j ⊆ W remains contained in W ∪ {y} by Finset.subset_insert (analyzed via Finset.mem_insert.mp). Finally, H(|W ∪ {y}|) = H(|W| + 1) = H(|W|) + 1/(|W| + 1) by Finset.card_insert_of_notMem and harmonic_succ; combining this with 1/(|W| + 1) ≤ w(i) and the sum bound, linear arithmetic confirms the harmonic inequality for W ∪ {y}.
uses
Finset.mem_insert_of_mem,Finset.mem_insert.mp,Finset.subset_insert,Finset.card_insert_of_notMem,harmonic_succhave hOK : ok (insert y W) := by refine ⟨Finset.mem_insert_of_mem hx, ?_, ?_⟩ · intro z hz rcases Finset.mem_insert.mp hz with rfl | hz · exact Or.inr ⟨i,hxi,hyi,hsub⟩ · rcases hlink z hz with h | ⟨j,hj,hzj,hjW⟩ · exact Or.inl h · exact Or.inr ⟨j,hj,hzj,hjW.trans (Finset.subset_insert ..)⟩ · rw [Finset.card_insert_of_notMem hyW, harmonic_succ] linarith
Contradiction with the maximality of W.
Because W ∪ {y} is a candidate (by Finset.mem_filter.mpr and Finset.mem_univ), the maximality of W implies |W ∪ {y}| ≤ |W|. But since y ∉ W, |W ∪ {y}| = |W| + 1 by Finset.card_insert_of_notMem, so |W| + 1 ≤ |W|, which simplifies to False.
uses
Finset.mem_filter.mpr,Finset.mem_univ,Finset.card_insert_of_notMemhave hc := hmax _ (Finset.mem_filter.mpr ⟨Finset.mem_univ _, hOK⟩) simp [Finset.card_insert_of_notMem hyW] at hc
Finset.mem_singleton.mp- If an element belongs to a singleton set {a}, then it equals a.
Finset.sum_nonneg- A finite sum of non-negative elements is non-negative.
Finset.exists_max_image- Any non-empty finite set has an element maximizing a given real- or linearly-ordered-valued function.
Finset.mem_filter.mpr- An element of s that satisfies predicate p belongs to the filtered sub-finset {a ∈ s | p a}.
Finset.mem_univ- Every element of a finite type belongs to its universal finset univ.
Finset.mem_filter.mp- If an element belongs to the filtered sub-finset {a ∈ s | p a}, it belongs to s and satisfies p.
add_le_add- If a ≤ b and c ≤ d, then a + c ≤ b + d.
le_refl- The inequality relation is reflexive: a ≤ a.
Finset.sum_le_sum_of_subset_of_nonneg- If s ⊆ t and f is non-negative on t \ s, then the sum of f over s is at most the sum over t.
Finset.filter_subset- Filtering a finset produces a subset of the original finset.
Finset.card_eq_one.mp- A finset of cardinality 1 is equal to a singleton {a}.
Finset.mem_singleton_self- An element a is an element of the singleton {a}.
Finset.mem_sdiff.mp- If an element belongs to the set difference A \ B, it belongs to A and not to B.
Finset.mem_insert_of_mem- If an element belongs to s, it belongs to s ∪ {b}.
Finset.mem_insert.mpr- If an element equals b or belongs to s, it belongs to s ∪ {b}.
Finset.mem_sdiff.mpr- If an element belongs to A and does not belong to B, it belongs to A \ B.
Finset.mem_insert.mp- If an element belongs to s ∪ {b}, it either equals b or belongs to s.
Finset.subset_insert- A finset s is a subset of s ∪ {a}.
Finset.sum_insert- If an element a is not in s, the sum over s ∪ {a} equals f(a) plus the sum over s.
Finset.card_le_card- If s ⊆ t, then |s| ≤ |t|.
Finset.card_insert_of_notMem- Inserting an element not in s increases the cardinality by 1.
inv_anti₀- Taking reciprocals reverses inequality for positive quantities: if 0 < b ≤ a, then a⁻¹ ≤ b⁻¹.
Finset.card_pos.mpr- A non-empty finset has strictly positive cardinality.
harmonic_succ- The (n + 1)-th harmonic number satisfies H(n + 1) = H(n) + 1/(n + 1).
- At line 57, the tactic `linarith` combines three linear inequalities over ℚ to establish the harmonic number bound for the augmented candidate set.
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
theorem matroid_threshold_pool_single_point_mask {n m : ℕ} (P : Fin m → Finset (Fin n)) (x : Fin n) : ∃ W : Finset (Fin n), x ∈ W ∧ harmonic W.card ≤ 1 + ∑ i ∈ Finset.univ.filter (fun i => x ∈ P i), ((P i).card : ℚ)⁻¹ ∧ (∀ i, x ∈ P i → (P i \ W).card ≠ 1) ∧ ∀ y ∈ W, y = x ∨ ∃ i, x ∈ P i ∧ y ∈ P i ∧ P i ⊆ W := by classical let rows := Finset.univ.filter (fun i => x ∈ P i) let w (i : Fin m) := ((P i).card : ℚ)⁻¹ let used (S : Finset (Fin n)) := rows.filter (fun i => P i ⊆ S) let linked (S : Finset (Fin n)) := ∀ y ∈ S, y = x ∨ ∃ i, x ∈ P i ∧ y ∈ P i ∧ P i ⊆ S let ok (S : Finset (Fin n)) := x ∈ S ∧ linked S ∧ harmonic S.card ≤ 1 + ∑ i ∈ used S, w i let candidates := Finset.univ.filter ok have initial : ok {x} := by refine ⟨by simp, fun y hy => Or.inl (Finset.mem_singleton.mp hy), ?_⟩ have hn : 0 ≤ ∑ i ∈ used {x}, w i := Finset.sum_nonneg (fun i _ => by dsimp [w]; positivity) simpa [harmonic, w] using hn obtain ⟨W, hW, hmax⟩ := Finset.exists_max_image candidates Finset.card (show candidates.Nonempty from ⟨{x}, Finset.mem_filter.mpr ⟨Finset.mem_univ _, initial⟩⟩) obtain ⟨hx, hlink, hsum⟩ : ok W := (Finset.mem_filter.mp hW).2 refine ⟨W, hx, hsum.trans (add_le_add (le_refl 1) ?_), ?_, hlink⟩ · exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) (fun i _ _ => by dsimp [w]; positivity) · intro i hxi hone obtain ⟨y, he⟩ := Finset.card_eq_one.mp hone have hy : y ∈ P i \ W := he ▸ Finset.mem_singleton_self y obtain ⟨hyi, hyW⟩ := Finset.mem_sdiff.mp hy have hsub : P i ⊆ insert y W := by intro z hz by_cases h : z ∈ W · exact Finset.mem_insert_of_mem h · exact Finset.mem_insert.mpr (Or.inl (Finset.mem_singleton.mp (he ▸ Finset.mem_sdiff.mpr ⟨hz,h⟩))) have hi : i ∉ used W := fun hi => hyW ((Finset.mem_filter.mp hi).2 hyi) have hh : insert i (used W) ⊆ used (insert y W) := by intro j hj rcases Finset.mem_insert.mp hj with rfl | hj · exact Finset.mem_filter.mpr ⟨Finset.mem_filter.mpr ⟨Finset.mem_univ _,hxi⟩, hsub⟩ · obtain ⟨hj', hjW⟩ := Finset.mem_filter.mp hj exact Finset.mem_filter.mpr ⟨hj',hjW.trans (Finset.subset_insert ..)⟩ have hsum' := Finset.sum_le_sum_of_subset_of_nonneg (f := w) hh (fun j _ _ => by dsimp [w]; positivity) rw [Finset.sum_insert hi] at hsum' have hcard := Finset.card_le_card hsub rw [Finset.card_insert_of_notMem hyW] at hcard have hinv : ((W.card + 1 : ℕ) : ℚ)⁻¹ ≤ w i := by apply inv_anti₀ (by exact_mod_cast Finset.card_pos.mpr ⟨x,hxi⟩) exact_mod_cast hcard have hOK : ok (insert y W) := by refine ⟨Finset.mem_insert_of_mem hx, ?_, ?_⟩ · intro z hz rcases Finset.mem_insert.mp hz with rfl | hz · exact Or.inr ⟨i,hxi,hyi,hsub⟩ · rcases hlink z hz with h | ⟨j,hj,hzj,hjW⟩ · exact Or.inl h · exact Or.inr ⟨j,hj,hzj,hjW.trans (Finset.subset_insert ..)⟩ · rw [Finset.card_insert_of_notMem hyW, harmonic_succ] linarith have hc := hmax _ (Finset.mem_filter.mpr ⟨Finset.mem_univ _, hOK⟩) simp [Finset.card_insert_of_notMem hyW] at hc