| name | counting-argument |
| description | Prove identities or existence using combinatorial counting - double counting, bijections, inclusion-exclusion. Triggers on "count", "number of ways", "how many", "bijection", "one-to-one correspondence", "combinatorial proof" |
Counting Argument
Prove results by counting objects in clever ways.
Technique A: Double Counting
Count the same set in two different ways → the counts must be equal.
Step 1: Identify the Set to Count
Step 2: Count Method 1
Step 3: Count Method 2
Step 4: Conclude
Classic Example: Handshaking Lemma
Count pairs (person, hand they shook):
- Method 1: Sum of degrees = Σ deg(v)
- Method 2: 2 × (number of edges) = 2|E|
- Therefore: Σ deg(v) = 2|E|
Technique B: Bijection
Show |A| = |B| by constructing a one-to-one correspondence.
Step 1: Define the Map
Step 2: Prove f is Injective
Step 3: Prove f is Surjective
Step 4: Conclude
Technique C: Inclusion-Exclusion
Count |A ∪ B ∪ C| by adding and subtracting overlaps.
|A ∪ B| = |A| + |B| - |A ∩ B|
|A ∪ B ∪ C| = |A| + |B| + |C| - |A∩B| - |A∩C| - |B∩C| + |A∩B∩C|
Tools to use:
symbolic_compute: Calculate binomial coefficients, sums
sequence_lookup: Check if counts match known sequences
lean_prover: Finset cardinality lemmas
Lean Tactics
Finset.card_union_eq - for disjoint sets
Finset.card_sdiff - for set difference
- Bijection: construct
Equiv type