Compfiles/UK2024R1P1.lean

GitHub source file

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.

Imports (4)
Imported by 1 file
  1. def UK2024R1P1.S line 53 source

    standard axioms: Quot.sound what this means

    Statement uses: Nat, Set, Equiv.Perm, Fin

    Proof uses: Set.ofPred, LE.le, HAdd.hAdd, OfNat.ofNat, Fin.castSucc, Fin.succ

    7 instances, coercions and auxiliary constants left out.

  2. def UK2024R1P1.S' line 54 source

    standard axioms: Quot.sound, propext what this means

    Statement uses: Nat, Fin, HAdd.hAdd, OfNat.ofNat, Set, Equiv.Perm

    Proof uses: Set.ofPred, And, Membership.mem, UK2024R1P1.S, Eq

    12 instances, coercions and auxiliary constants left out.

  3. lemma UK2024R1P1.g_nonzero_ne_m line 56 source

    standard axioms: Quot.sound, propext what this means

    Statement uses: Nat, Fin, HAdd.hAdd, OfNat.ofNat, Equiv.Perm, Membership.mem, Set, UK2024R1P1.S', Ne

    Proof uses: Mathlib.Tactic.Contrapose.contrapose₄, Eq, Eq.mpr, Equiv, id, congrArg, Eq.symm, propext, Equiv.apply_eq_iff_eq, And.right, UK2024R1P1.S

    21 instances, coercions and auxiliary constants left out.

    Tactic trace: 2 steps

    Open to load the checked before-and-after goal states.

  4. def UK2024R1P1.f_toFun line 61 source

    standard 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.pred

    15 instances, coercions and auxiliary constants left out.

    Tactic trace: 4 steps

    Open to load the checked before-and-after goal states.

  5. def UK2024R1P1.f_invFun line 73 source

    standard 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.succ

    15 instances, coercions and auxiliary constants left out.

    Tactic trace: 7 steps

    Open to load the checked before-and-after goal states.

  6. lemma UK2024R1P1.f_left_inv line 88 source

    standard 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_toFun

    Proof 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_true and 32 more

    33 instances, coercions and auxiliary constants left out.

    Tactic trace: 14 steps

    Open to load the checked before-and-after goal states.

  7. lemma UK2024R1P1.f_right_inv line 103 source

    standard 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_toFun

    Proof 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_prop and 22 more

    29 instances, coercions and auxiliary constants left out.

    Tactic trace: 13 steps

    Open to load the checked before-and-after goal states.

  8. def UK2024R1P1.f line 117 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Fin, HAdd.hAdd, OfNat.ofNat, Equiv.Perm, Membership.mem, Set, UK2024R1P1.S', Equiv

    Proof uses: Equiv.mk, UK2024R1P1.f_toFun, UK2024R1P1.f_invFun, UK2024R1P1.f_left_inv, UK2024R1P1.f_right_inv

    8 instances, coercions and auxiliary constants left out.

  9. def UK2024R1P1.f'_toFun line 120 source

    standard axioms: Quot.sound, propext what this means

    Statement uses: Nat, Equiv.Perm, Fin, HAdd.hAdd, OfNat.ofNat

    Proof uses: dite, Eq, Not, ite, LT.lt, Fin.castSucc, Fin.pred, Fin.succ

    14 instances, coercions and auxiliary constants left out.

  10. def UK2024R1P1.f'_invFun line 129 source

    standard axioms: Quot.sound, propext what this means

    Statement uses: Nat, Equiv.Perm, Fin, HAdd.hAdd, OfNat.ofNat

    Proof uses: dite, Eq, Not, LT.lt, Fin.succ, Equiv, Equiv.symm, Fin.castPred, Fin.pred

    16 instances, coercions and auxiliary constants left out.

  11. lemma UK2024R1P1.f'_left_inv line 138 source

    standard 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'_toFun

    Proof 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, True and 28 more

    32 instances, coercions and auxiliary constants left out.

    Tactic trace: 11 steps

    Open to load the checked before-and-after goal states.

  12. lemma UK2024R1P1.f'_right_inv line 150 source

    standard 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'_toFun

    Proof 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, congr and 33 more

    31 instances, coercions and auxiliary constants left out.

    Tactic trace: 13 steps

    Open to load the checked before-and-after goal states.

  13. def UK2024R1P1.f' line 165 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat, Fin, HAdd.hAdd, OfNat.ofNat, Equiv.Perm, Equiv

    Proof uses: Equiv.mk, UK2024R1P1.f'_toFun, UK2024R1P1.f'_invFun, UK2024R1P1.f'_left_inv, UK2024R1P1.f'_right_inv

    6 instances, coercions and auxiliary constants left out.

  14. lemma UK2024R1P1.f'_in_S'_k line 168 source

    standard 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_self and 17 more

    27 instances, coercions and auxiliary constants left out.

    Tactic trace: 21 steps

    Open to load the checked before-and-after goal states.

  15. lemma UK2024R1P1.f_f'_left_inv line 185 source

    standard 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.f

    Proof 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, id and 35 more

    34 instances, coercions and auxiliary constants left out.

    Tactic trace: 14 steps

    Open to load the checked before-and-after goal states.

  16. lemma UK2024R1P1.f_f'_right_inv line 198 source

    standard 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'_k

    Proof 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, Not and 27 more

    34 instances, coercions and auxiliary constants left out.

    Tactic trace: 12 steps

    Open to load the checked before-and-after goal states.

  17. lemma UK2024R1P1.S'_k_card_eq_S_succ_k_card line 211 source

    standard 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.S

    Proof 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, True and 29 more

    27 instances, coercions and auxiliary constants left out.

    Tactic trace: 22 steps

    Open to load the checked before-and-after goal states.

  18. lemma UK2024R1P1.S_succ_succ_k_card_eq_two_mul_S_succ_k_card line 230 source

    standard 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.hMul

    Proof 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.ofPred and 22 more

    77 instances, coercions and auxiliary constants left out.

    Tactic trace: 34 steps

    Open to load the checked before-and-after goal states.

  19. lemma UK2024R1P1.S_succ_k_card_eq_two_pow_k line 259 source

    standard 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.hPow

    Proof 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.intro and 19 more

    47 instances, coercions and auxiliary constants left out.

    Tactic trace: 17 steps

    Open to load the checked before-and-after goal states.

  20. determine UK2024R1P1.solution_value line 277 source

    no axioms what this means

    Statement uses: Nat

    Proof uses: OfNat.ofNat

    1 instances, coercions and auxiliary constants left out.

  21. problem UK2024R1P1.uk2024_r1_p1 Since OLYMPIADS has no duplicate letters, then the set of spellings is just a subset of the permutations of 9 elements line 283 source

    Source 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_value

    Proof 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.bit0

    22 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