Compfiles/UK2024R1P1.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
21 declarations, 0 contain sorry, 0 declared as axioms
British Mathematical Olympiad 2024, Round 1, Problem 1
An unreliable typist can guarantee that when they try to type a word with different letters, every letter of the word will appear exactly once in what they type, and each letter will occur at most one letter late (though it may occur more than one letter early). Thus, when trying to type MATHS, the typist may type MATHS, MTAHS or TMASH, but not ATMSH.
Determine, with proof, the number of possible spellings of OLYMPIADS that might be typed.
Imported by 1 file
- def
UK2024R1P1.Sline 53 sourcestandard axioms: Quot.sound what this means
Statement uses:
Nat,Set,Equiv.Perm,FinProof uses:
Set.ofPred,LE.le,HAdd.hAdd,OfNat.ofNat,Fin.castSucc,Fin.succ7 instances, coercions and auxiliary constants left out.
- def
UK2024R1P1.S'line 54 sourcestandard axioms: Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,Set,Equiv.PermProof uses:
Set.ofPred,And,Membership.mem, UK2024R1P1.S,Eq12 instances, coercions and auxiliary constants left out.
- lemma
UK2024R1P1.g_nonzero_ne_mline 56 sourcestandard axioms: Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,Equiv.Perm,Membership.mem,Set, UK2024R1P1.S',NeProof uses:
Mathlib.Tactic.Contrapose.contrapose₄,Eq,Eq.mpr,Equiv,id,congrArg,Eq.symm,propext,Equiv.apply_eq_iff_eq,And.right, UK2024R1P1.S21 instances, coercions and auxiliary constants left out.
Tactic trace: 2 steps
Open to load the checked before-and-after goal states.
- def
UK2024R1P1.f_toFunline 61 sourcestandard axioms: Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,Equiv.Perm,Membership.mem,Set, UK2024R1P1.S'Proof uses:
dite,LE.le,Fin.succ,Fin.castPred,Not,Fin.pred15 instances, coercions and auxiliary constants left out.
Tactic trace: 4 steps
Open to load the checked before-and-after goal states.
- def
UK2024R1P1.f_invFunline 73 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,Equiv.Perm,Membership.mem,Set, UK2024R1P1.S'Proof uses:
dite,LT.lt,Fin.castSucc,Fin.pred,Equiv,Equiv.symm,Not,Fin.succ15 instances, coercions and auxiliary constants left out.
Tactic trace: 7 steps
Open to load the checked before-and-after goal states.
- lemma
UK2024R1P1.f_left_invline 88 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,Equiv.Perm,Membership.mem,Set, UK2024R1P1.S',Function.LeftInverse, UK2024R1P1.f_invFun, UK2024R1P1.f_toFunProof uses:
id,Eq,LE.le,Fin.succ,Not,Or,dite,LT.lt,Fin.castSucc,Fin.castPred,Fin.pred,Equiv,Equiv.symm,Ne,Eq.refl,em,Eq.mpr,True,Eq.mpr_prop,eq_trueand 32 more33 instances, coercions and auxiliary constants left out.
Tactic trace: 14 steps
Open to load the checked before-and-after goal states.
- lemma
UK2024R1P1.f_right_invline 103 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,Equiv.Perm,Membership.mem,Set, UK2024R1P1.S',Function.RightInverse, UK2024R1P1.f_invFun, UK2024R1P1.f_toFunProof uses:
id,Eq,LT.lt,Fin.castSucc,Not,Or,dite,LE.le,Fin.succ,Fin.pred,Equiv,Equiv.symm,Fin.castPred,Ne,Fin.last,Eq.refl,em,Eq.mpr,True,Eq.mpr_propand 22 more29 instances, coercions and auxiliary constants left out.
Tactic trace: 13 steps
Open to load the checked before-and-after goal states.
- def
UK2024R1P1.fline 117 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,Equiv.Perm,Membership.mem,Set, UK2024R1P1.S',EquivProof uses:
Equiv.mk, UK2024R1P1.f_toFun, UK2024R1P1.f_invFun, UK2024R1P1.f_left_inv, UK2024R1P1.f_right_inv8 instances, coercions and auxiliary constants left out.
- def
UK2024R1P1.f'_toFunline 120 sourcestandard axioms: Quot.sound, propext what this means
Statement uses:
Nat,Equiv.Perm,Fin,HAdd.hAdd,OfNat.ofNatProof uses:
dite,Eq,Not,ite,LT.lt,Fin.castSucc,Fin.pred,Fin.succ14 instances, coercions and auxiliary constants left out.
- def
UK2024R1P1.f'_invFunline 129 sourcestandard axioms: Quot.sound, propext what this means
Statement uses:
Nat,Equiv.Perm,Fin,HAdd.hAdd,OfNat.ofNatProof uses:
dite,Eq,Not,LT.lt,Fin.succ,Equiv,Equiv.symm,Fin.castPred,Fin.pred16 instances, coercions and auxiliary constants left out.
- lemma
UK2024R1P1.f'_left_invline 138 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,Equiv.Perm,Function.LeftInverse, UK2024R1P1.f'_invFun, UK2024R1P1.f'_toFunProof uses:
id,Eq,Not,Or,dite,ite,LT.lt,Fin.castSucc,Fin.pred,Fin.succ,Equiv,Equiv.symm,Fin.castPred,Ne,Fin.last,Eq.refl,em,of_eq_true,Eq.trans,Trueand 28 more32 instances, coercions and auxiliary constants left out.
Tactic trace: 11 steps
Open to load the checked before-and-after goal states.
- lemma
UK2024R1P1.f'_right_invline 150 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,Equiv.Perm,Function.RightInverse, UK2024R1P1.f'_invFun, UK2024R1P1.f'_toFunProof uses:
id,Eq,Not,Or,dite,LT.lt,Fin.succ,Equiv,Equiv.symm,Fin.castPred,Fin.pred,ite,Fin.castSucc,Ne,Eq.refl,em,of_eq_true,Eq.trans,True,congrand 33 more31 instances, coercions and auxiliary constants left out.
Tactic trace: 13 steps
Open to load the checked before-and-after goal states.
- def
UK2024R1P1.f'line 165 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,Equiv.Perm,EquivProof uses:
Equiv.mk, UK2024R1P1.f'_toFun, UK2024R1P1.f'_invFun, UK2024R1P1.f'_left_inv, UK2024R1P1.f'_right_inv6 instances, coercions and auxiliary constants left out.
- lemma
UK2024R1P1.f'_in_S'_kline 168 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,LE.le,Equiv.Perm,Membership.mem,Set, UK2024R1P1.S,Equiv, UK2024R1P1.S', UK2024R1P1.f'Proof uses:
And.intro,Eq,id,Fin.castSucc,Fin.succ,Not,Or,dite,ite,LT.lt,Fin.pred,em,Eq.mpr,congr,congrArg,dite_eq_left_of_eq_true,Eq.trans,True,congrFun',eq_selfand 17 more27 instances, coercions and auxiliary constants left out.
Tactic trace: 21 steps
Open to load the checked before-and-after goal states.
- lemma
UK2024R1P1.f_f'_left_invline 185 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,Equiv.Perm,Membership.mem,Set, UK2024R1P1.S',Eq,Equiv, UK2024R1P1.f', UK2024R1P1.fProof uses:
Equiv.ext,Eq.mpr,dite,Not,ite,LT.lt,Fin.castSucc,LE.le,Fin.castPred,Fin.succ,Fin.pred,Eq.mpr_not,Eq.refl,Ne,Fin.last,Eq.mpr_prop,congrFun',congrArg,Fin.succ_pred,idand 35 more34 instances, coercions and auxiliary constants left out.
Tactic trace: 14 steps
Open to load the checked before-and-after goal states.
- lemma
UK2024R1P1.f_f'_right_invline 198 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,LE.le,Equiv.Perm,Membership.mem,Set, UK2024R1P1.S,Eq,Equiv, UK2024R1P1.f, UK2024R1P1.f', UK2024R1P1.f'_in_S'_kProof uses:
Equiv.ext,Eq.mpr,dite,ite,LT.lt,Fin.castSucc,Fin.succ,Fin.castPred,Equiv.mk, UK2024R1P1.f'_toFun, UK2024R1P1.f'_invFun, UK2024R1P1.f'_left_inv, UK2024R1P1.f'_right_inv,Ne,Fin.last,Eq.mpr_prop,congrFun',congrArg,Eq.trans,Notand 27 more34 instances, coercions and auxiliary constants left out.
Tactic trace: 12 steps
Open to load the checked before-and-after goal states.
- lemma
UK2024R1P1.S'_k_card_eq_S_succ_k_cardline 211 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Fin,HAdd.hAdd,OfNat.ofNat,LE.le,Eq,Set.ncard,Equiv.Perm, UK2024R1P1.S', UK2024R1P1.SProof uses:
Set.ncard_congr,Equiv, UK2024R1P1.f,Membership.mem,Set,id,Fin.succ,Not,Or,Fin.castSucc,dite,Fin.castPred,Fin.pred,em,Eq.mpr,congrFun',congrArg,Eq.trans,Eq.mpr_prop,Trueand 29 more27 instances, coercions and auxiliary constants left out.
Tactic trace: 22 steps
Open to load the checked before-and-after goal states.
- lemma
UK2024R1P1.S_succ_succ_k_card_eq_two_mul_S_succ_k_cardline 230 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Set.ncard,Equiv.Perm,Fin,HAdd.hAdd,OfNat.ofNat, UK2024R1P1.S,HMul.hMulProof uses:
Set, UK2024R1P1.S', UK2024R1P1.S'_k_card_eq_S_succ_k_card,of_eq_true,LE.le,Eq.trans,True,eq_true,True.intro,Disjoint,Eq.mpr,Membership.mem,Not,id,congrArg,propext,Set.disjoint_left,And,congrFun',Set.ofPredand 22 more77 instances, coercions and auxiliary constants left out.
Tactic trace: 34 steps
Open to load the checked before-and-after goal states.
- lemma
UK2024R1P1.S_succ_k_card_eq_two_pow_kline 259 sourcestandard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,Eq,Set.ncard,Equiv.Perm,Fin,HAdd.hAdd,OfNat.ofNat, UK2024R1P1.S,HPow.hPowProof uses:
Nat.recAux,Eq.mpr,Exists,Set,Singleton.singleton,id,Eq.trans,congrArg,pow_zero,Equiv.mk,of_decide_eq_true,Function.LeftInverse,Bool,Decidable.decide,Bool.true,Eq.refl,Function.RightInverse,Exists.intro,Set.ext,Iff.introand 19 more47 instances, coercions and auxiliary constants left out.
Tactic trace: 17 steps
Open to load the checked before-and-after goal states.
- determine
UK2024R1P1.solution_valueline 277 sourceno axioms what this means
Statement uses:
NatProof uses:
OfNat.ofNat1 instances, coercions and auxiliary constants left out.
- problem
UK2024R1P1.uk2024_r1_p1Since OLYMPIADS has no duplicate letters, then the set of spellings is just a subset of the permutations of 9 elements line 283 sourceSource comment
Since OLYMPIADS has no duplicate letters, then the set of spellings is just a subset of the permutations of 9 elements.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Eq,Nat,Set.ncard,Equiv.Perm,Fin,OfNat.ofNat,Set.ofPred,LE.le,HAdd.hAdd, UK2024R1P1.solution_valueProof uses:
id,Eq.mpr, UK2024R1P1.S,HPow.hPow,congrArg, UK2024R1P1.S_succ_k_card_eq_two_pow_k,Mathlib.Meta.NormNum.isNat_eq_true,Mathlib.Meta.NormNum.isNat_pow,Eq.refl,Mathlib.Meta.NormNum.isNat_ofNat,Mathlib.Meta.NormNum.IsNatPowT.run,Mathlib.Meta.NormNum.IsNatPowT.trans,Nat.pow,Mathlib.Meta.NormNum.IsNatPowT.bit022 instances, coercions and auxiliary constants left out.
Tactic trace: 3 steps
Open to load the checked before-and-after goal states.
problem uk2024_r1_p1 : {f : Equiv.Perm (Fin 9) | ∀ k, (f k : ℕ) ≤ k + 1}.ncard = solution_value := by …Mentions: UK2024R1P1.f, UK2024R1P1.solution_value