card_three_subsets_fin
The number of 3-element subsets of Fin n is n.choose 3.
Statement
theorem card_three_subsets_fin (n : ℕ) :
Fintype.card { s : Finset (Fin n) // s.card = 3 } = n.choose 3- Source
- step towards three_token_odd_cycle_indep_num_le
- Verified
- 19 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 1
- card_generalized_kneser_graph_vertsThe vertex type of the generalized Kneser graph KG(2n, n, r), which consists of all n-element subsets of Fin (2 * n), has cardinality…
The proof, explained
The theorem states that the number of 3-element subsets of a set with n elements is n.choose 3. In the proof, an automated search via `first | ...` resolves the goal with `simpa`, which uses standard library simplification rules for the cardinality of fixed-size sub-finsets and the cardinality of Fin n.
The number of 3-element subsets of Fin n is n.choose 3. automation
The tactic `first` evaluates candidate tactics in sequence. The first three attempts to apply `card_generalized_kneser_graph_verts` fail because that lemma specifically concerns n-element subsets of a 2n-element set rather than 3-element subsets of an n-element set. The fourth branch, `simpa using card_generalized_kneser_graph_verts`, succeeds because the simplifier reduces the cardinality of `{ s : Finset (Fin n) // s.card = 3 }` directly to `n.choose 3` using standard simplification lemmas for the size of fixed-cardinality subsets of `Fin n`.
uses
card_generalized_kneser_graph_vertsFintype.card { s : Finset (Fin n) // s.card = 3 } = n.choose 3 := by first | exact card_generalized_kneser_graph_verts | (apply card_generalized_kneser_graph_verts <;> assumption) | (apply card_generalized_kneser_graph_verts <;> simp_all) | simpa using card_generalized_kneser_graph_verts
card_generalized_kneser_graph_verts- The number of n-element subsets of Fin (2 * n) is (2 * n).choose n.
- The proof script was generated with a fallback sequence `first | ...`. The branch that succeeds is `simpa using card_generalized_kneser_graph_verts`, where the simplifier closes the goal directly using Mathlib's built-in simp lemmas (`Fintype.card_finset_len` and `Fintype.card_fin`) without actually relying on `card_generalized_kneser_graph_verts`.
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.
/-- The number of 3-element subsets of Fin n is n.choose 3. -/theorem card_three_subsets_fin (n : ℕ) : Fintype.card { s : Finset (Fin n) // s.card = 3 } = n.choose 3 := by first | exact card_generalized_kneser_graph_verts | (apply card_generalized_kneser_graph_verts <;> assumption) | (apply card_generalized_kneser_graph_verts <;> simp_all) | simpa using card_generalized_kneser_graph_verts