Compfiles/Imo1987P1.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 compfiles documentation, Pinned compfiles corpus index
10 declarations, 0 contain sorry, 0 declared as axioms
International Mathematical Olympiad 1987, Problem 1
Let $p_{n, k}$ be the number of permutations of a set of cardinality n ≥ 1
that fix exactly k elements. Prove that $∑_{k=0}^n k p_{n,k}=n!$.
Imports (4)
Imported by 1 file
- def
Imo1987P1.fiberGivenα : Type*andk : ℕ,fiber α kis the set of permutations ofαwith exactlykfixed points line 33 sourceSource documentation
Given
α : Type*andk : ℕ,fiber α kis the set of permutations ofαwith exactlykfixed points.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,Nat,Set,Equiv.PermProof uses:
Set.ofPred,Eq,Fintype.card,Function.fixedPoints,Membership.mem7 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
def fiber (α : Type*) [Fintype α] [DecidableEq α] (k : ℕ) : Set (Equiv.Perm α) := …
- instance
Imo1987P1.(instance at line 36)line 36 source - def
Imo1987P1.pp α kis the number of permutations ofαwith exactlykfixed points line 40 sourceSource documentation
p α kis the number of permutations ofαwith exactlykfixed points.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,NatProof uses:
Fintype.card,Equiv.Perm, Imo1987P1.fiber2 instances, coercions and auxiliary constants left out.
def p (α : Type*) [Fintype α] [DecidableEq α] (k : ℕ) : ℕ := Fintype.card (fiber α k) …
Mentions: Imo1987P1.fiber
- def
Imo1987P1.fixedPointsEquivThe set of pairs(x : α, σ : Perm α)such thatσ x = xis equivalent to the set of pairs(x : α, σ : Perm {x}ᶜ)line 68 sourceSource documentation
The set of pairs
(x : α, σ : Perm α)such thatσ x = xis equivalent to the set of pairs(x : α, σ : Perm {x}ᶜ).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
DecidableEq,Equiv,Subtype,Prod,Equiv.Perm,Eq,Prod.snd,Prod.fst,Sigma,Compl.compl,Set,Singleton.singletonProof uses:
Trans.trans,Membership.mem,Equiv.refl,Equiv.setProdEquivSigma,Equiv.sigmaCongrRight,Set.equivOfEq,Equiv.Set.compl17 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
def fixedPointsEquiv : { σx : α × Perm α // σx.2 σx.1 = σx.1 } ≃ Σ x : α, Perm ({x}ᶜ : Set α) := … - theorem
Imo1987P1.card_fixed_pointsline 76 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,Eq,Nat,Fintype.card,Subtype,Prod,Equiv.Perm,Prod.snd,Prod.fst,HMul.hMul,Nat.factorial,HSub.hSub,OfNat.ofNatProof uses:
Eq.mpr,Finset.sum,Finset.univ,Compl.compl,Set,Singleton.singleton,Membership.mem,id,congrFun',congrArg,Eq.trans,Sigma,Fintype.card_congr, Imo1987P1.fixedPointsEquiv,Fintype.card_sigma,Finset.sum_congr,Eq.refl,Finset,Fintype.card_perm,of_eq_trueand 6 more38 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- theorem
Imo1987P1.mem_fiberline 83 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,Equiv.Perm,Nat,Iff,Membership.mem,Set, Imo1987P1.fiber,Eq,Fintype.card,Function.fixedPointsProof uses:
Iff.rfl8 instances, coercions and auxiliary constants left out.
- def
Imo1987P1.fixedPointsEquiv'The set of triples(k ≤ card α, σ ∈ fiber α k, x ∈ fixedPoints σ)is equivalent to the set of pairs(x : α, σ : Perm α)such thatσ x = xline 92 sourceSource documentation
The set of triples
(k ≤ card α, σ ∈ fiber α k, x ∈ fixedPoints σ)is equivalent to the set of pairs(x : α, σ : Perm α)such thatσ x = x. The equivalence sends(k, σ, x)to(x, σ)and(x, σ)to(card (fixedPoints σ), σ, x).It is easy to see that the cardinality of the LHS is given by
∑ k : Fin (card α + 1), k * p α k.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,Equiv,Sigma,Fin,HAdd.hAdd,Nat,Fintype.card,OfNat.ofNat,Equiv.Perm, Imo1987P1.fiber,Function.fixedPoints,Membership.mem,Set,Subtype,Prod,Eq,Prod.snd,Prod.fstProof uses:
Equiv.mk,Subtype.mk,Prod.mk,Sigma.fst,Sigma.snd,Sigma.mk,Fin.mk28 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
def fixedPointsEquiv' : (Σ (k : Fin (card α + 1)) (σ : fiber α k), fixedPoints σ.1) ≃ { σx : α × Perm α // σx.2 σx.1 = σx.1 } where …Mentions: Imo1987P1.fiber
- theorem
Imo1987P1.main_fintypeMain statement for any(α : Type*) [Fintype α]line 105 sourceSource documentation
Main statement for any
(α : Type*) [Fintype α].standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Fintype,DecidableEq,Eq,Nat,Finset.sum,Finset.range,HAdd.hAdd,Fintype.card,OfNat.ofNat,HMul.hMul, Imo1987P1.p,Nat.factorial,HSub.hSubProof uses:
Equiv.Perm, Imo1987P1.fiber,Function.fixedPoints,Membership.mem,Set,Subtype.property,Eq.mpr,Fin,Finset.univ,id,congrFun',congrArg,Eq.mp,Sigma,Subtype,Prod,Prod.snd,Prod.fst,congr,Eq.transand 11 more40 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
theorem main_fintype : ∑ k ∈ Finset.range (card α + 1), k * p α k = card α * (card α - 1)! := by …Mentions: Imo1987P1.p
- theorem
Imo1987P1.main₀Main statement for permutations ofFin n, a version that works forn = 0line 112 sourceSource documentation
Main statement for permutations of
Fin n, a version that works forn = 0.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Finset.sum,Finset.range,HAdd.hAdd,OfNat.ofNat,HMul.hMul, Imo1987P1.p,Fin,Nat.factorial,HSub.hSubProof uses:
Eq.mp,Fintype.card,congr,congrArg,Finset.sum_congr,Finset,congrFun',Fintype.card_fin,Membership.mem,Eq.refl, Imo1987P1.main_fintype22 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
theorem main₀ (n : ℕ) : ∑ k ∈ Finset.range (n + 1), k * p (Fin n) k = n * (n - 1)! := by …
Mentions: Imo1987P1.p
- problem
Imo1987P1.imo1987_p1line 118 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Eq,Finset.sum,Finset.range,HAdd.hAdd,HMul.hMul, Imo1987P1.p,Fin,Nat.factorialProof uses:
Eq.mpr,HSub.hSub,id,congrArg, Imo1987P1.main₀,Nat.mul_factorial_pred,Iff.mp,Ne,Nat.one_le_iff_ne_zero,Eq.refl20 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.