Compfiles/Imo1963P6.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

4 declarations, 0 contain sorry, 0 declared as axioms

International Mathematical Olympiad 1963, Problem 6

Five students A, B, C, D, E were placed 1 to 5 in a contest with no ties. One prediction was that the result would be the order A, B, C, D, E. But no student finished in the position predicted, and no two students predicted to finish consecutively did so. For example, the outcome for C and D was not 1, 2 (respectively), or 2, 3, or 3, 4, or 4, 5. Another prediction was the order D, A, E, C, B. Exactly two students finished in the places predicted, and two disjoint pairs of students predicted to finish consecutively did so. Determine the outcome.

Imports (4)
Imported by 1 file
  1. def Imo1963P6.secondPrediction The second prediction "D, A, E, C, B", given as the function sending each student to the place in which it was predicted to finish line 42 source

    Source documentation

    The second prediction "D, A, E, C, B", given as the function sending each student to the place in which it was predicted to finish.

    standard axioms: propext what this means

    Statement uses: Fin, OfNat.ofNat, Nat

    Proof uses: Matrix.vecCons, Matrix.vecEmpty

    4 instances, coercions and auxiliary constants left out.

    def secondPrediction : Fin 5 → Fin 5 := ![1, 4, 3, 0, 2]
  2. determine Imo1963P6.answer line 44 source

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

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

    Proof uses: Equiv.mk, Matrix.vecCons, Matrix.vecEmpty

    6 instances, coercions and auxiliary constants left out.

    Tactic trace: 6 steps

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

  3. lemma Imo1963P6.classification The conditions of the problem determine the outcome uniquely: there are only `5! line 55 source

    Source comment

    The conditions of the problem determine the outcome uniquely: there are only `5! = 120` possible outcomes, so they can be checked exhaustively.

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

    Statement uses: Equiv.Perm, Fin, OfNat.ofNat, Nat, Ne, Fin.succ, HAdd.hAdd, Fin.castSucc, Eq, Finset.card, Finset.filter, Imo1963P6.secondPrediction, Finset.univ, Or, And, Imo1963P6.answer

    Proof uses: of_decide_eq_true, id, Bool, Decidable.decide, Bool.true, Eq.refl

    32 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

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

    lemma classification : ∀ π : Equiv.Perm (Fin 5),
        (∀ s : Fin 5, π s ≠ s) →
        (∀ i : Fin 4, (π i.succ : ℕ) ≠ (π i.castSucc : ℕ) + 1) →
        ((Finset.univ.filter (fun s => π s = secondPrediction s)).card = 2) →
        (((π 0 : ℕ) = (π 3 : ℕ) + 1 ∧ (π 2 : ℕ) = (π 4 : ℕ) + 1) ∨
         ((π 0 : ℕ) = (π 3 : ℕ) + 1 ∧ (π 1 : ℕ) = (π 2 : ℕ) + 1) ∨
         ((π 4 : ℕ) = (π 0 : ℕ) + 1 ∧ (π 1 : ℕ) = (π 2 : ℕ) + 1)) →
        π = answer := by
    …

    Mentions: Imo1963P6.secondPrediction, Imo1963P6.answer

  4. problem Imo1963P6.imo1963_p6 line 67 source

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

    Statement uses: Equiv.Perm, Fin, OfNat.ofNat, Nat, Ne, Fin.succ, HAdd.hAdd, Fin.castSucc, Eq, Finset.card, Finset.filter, Imo1963P6.secondPrediction, Finset.univ, Or, And, Imo1963P6.answer

    Proof uses: Imo1963P6.classification

    22 instances, coercions and auxiliary constants left out.