FormalConjecturesForMathlib/Probability/FiniteMethod.lean
Explanation legend Lean4 Domain Explanation Language (L4DEL)
L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.
- L4DEL
- Lean4 Domain Explanation Language
Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.
Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1
2 declarations, 0 contain sorry, 0 declared as axioms
The finite probabilistic method (averaging / pigeonhole primitive)
This file provides the core averaging lemma underlying the elementary form of Erdős's probabilistic method:
If the sum of a
ℕ-valued functionfover a finite setsis strictly less than the cardinality ofs, thenfvanishes somewhere ons.
Interpreting f a as "the number of bad configurations caused by choice a", and sampling
a uniformly from s, the expected number of bad configurations is (∑ f) / |s| < 1,
so there must exist at least one a ∈ s with f a = 0.
This is used by:
FormalConjectures/Probabilistic/RamseyDiagonalLowerBound.leanto close theR(k,k) > 2^{k/2}lower bound (Erdős 1947).- downstream deletion-method / alteration-method arguments.
Both the ℕ-form and a convenience ℝ-form are provided; the latter is useful when the
expectation bound is derived via rpow/log manipulations on the reals and only later
cast back to counting.
References
- [Er47] Erdős, P. (1947). "Some remarks on the theory of graphs." Bull. Amer. Math. Soc. 53, pp. 292--294.
- [AlSp16] Alon, N. and Spencer, J. (2016). The Probabilistic Method (4th ed.), §1.1.
Imports (3)
Imported by 1 file
- theorem
FormalConjecturesForMathlib.Probability.Finset.exists_eq_zero_of_sum_lt_cardFinite probabilistic method (integer form) line 63 sourceSource documentation
Finite probabilistic method (integer form).
If
∑ x ∈ s, f x < s.card, then there existsa ∈ swithf a = 0.Proof idea. Contrapositive: if every value is at least
1, the sum is at leasts.card · 1 = s.card, contradicting the hypothesis.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,LT.lt,Finset.sum,Finset.card,Exists,And,Membership.mem,Eq,OfNat.ofNatProof uses:
Decidable.byContradiction,Not,LE.le,Iff.mpr,Ne,Nat.one_le_iff_ne_zero,Eq.mp,Eq.trans,binderNameHint,forall_congr,Mathlib.Tactic.Push.not_and_eq,Trans.trans,Eq.mpr,HSMul.hSMul,id,congrArg,Finset.sum_const,HMul.hMul,smul_eq_mul,mul_oneand 2 more31 instances, coercions and auxiliary constants left out.
Tactic trace: 6 steps
Open to load the checked before-and-after goal states.
theorem Finset.exists_eq_zero_of_sum_lt_card {α : Type*} {s : Finset α} {f : α → ℕ} (h : ∑ x ∈ s, f x < s.card) : ∃ a ∈ s, f a = 0 := by … - theorem
FormalConjecturesForMathlib.Probability.Finset.exists_eq_zero_of_real_sum_lt_cardFinite probabilistic method (real form) line 82 sourceSource documentation
Finite probabilistic method (real form).
If
(∑ x ∈ s, (f x : ℝ)) < s.card, then there existsa ∈ swithf a = 0.This is the same statement as
Finset.exists_eq_zero_of_sum_lt_cardafter casting the counting inequality toℝ; it is the convenient entry point whenfarises as an expectation whose bound was computed in the reals (e.g. viaReal.rpow/Real.log).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Finset,Nat,LT.lt,Real,Finset.sum,Finset.card,Exists,And,Membership.mem,Eq,OfNat.ofNatProof uses: FormalConjecturesForMathlib.Probability.Finset.exists_eq_zero_of_sum_lt_card,
Nat.cast_sum,Eq.rec,Eq.symm,cast31 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
theorem Finset.exists_eq_zero_of_real_sum_lt_card {α : Type*} {s : Finset α} {f : α → ℕ} (h : (∑ x ∈ s, (f x : ℝ)) < s.card) : ∃ a ∈ s, f a = 0 := by …