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

8 declarations, 0 contain sorry, 0 declared as axioms

International Mathematical Olympiad 1971, Problem 6

Let $A = (a_{ij})$ be an $n \times n$ matrix with non-negative integer entries. Suppose that for all $i, j$, if $a_{ij} = 0$, then the sum of the elements in the $i$-th row plus the sum of the elements in the $j$-th column is at least $n$. Prove that the sum of all elements in the matrix is at least $n^2 / 2$.

Imports (3)
Imported by 1 file
  1. def Imo1971P6.rowSum Definitions of row sum, column sum, and total sum line 36 source

    Source comment

    Definitions of row sum, column sum, and total sum

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

    Statement uses: Nat, Matrix, Fin

    Proof uses: Finset.sum, Finset.univ

    2 instances, coercions and auxiliary constants left out.

    def rowSum (i : Fin n) : ℕ := ∑ j, A i j
  2. def Imo1971P6.colSum line 37 source

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

    Statement uses: Nat, Matrix, Fin

    Proof uses: Finset.sum, Finset.univ, Matrix.transpose

    2 instances, coercions and auxiliary constants left out.

  3. def Imo1971P6.totalSum line 38 source

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

    Statement uses: Nat, Matrix, Fin

    Proof uses: Finset.sum, Finset.univ

    2 instances, coercions and auxiliary constants left out.

  4. lemma Imo1971P6.totalSum_eq_rowSum_sum Basic lemmas connecting total sum to row/col sums line 41 source

    Source comment

    Basic lemmas connecting total sum to row/col sums

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

    Statement uses: Nat, Matrix, Fin, Eq, Imo1971P6.totalSum, Finset.sum, Finset.univ, Imo1971P6.rowSum

    Proof uses: rfl

    2 instances, coercions and auxiliary constants left out.

    lemma totalSum_eq_rowSum_sum : totalSum A = ∑ i, rowSum A i := rfl

    Mentions: Imo1971P6.totalSum, Imo1971P6.rowSum

  5. lemma Imo1971P6.totalSum_eq_colSum_sum line 43 source

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

    Statement uses: Nat, Matrix, Fin, Eq, Imo1971P6.totalSum, Finset.sum, Finset.univ, Imo1971P6.colSum

    Proof uses: Finset.sum_comm

    4 instances, coercions and auxiliary constants left out.

  6. theorem Imo1971P6.totalSum_transpose_eq line 45 source

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

    Statement uses: Nat, Matrix, Fin, Eq, Imo1971P6.totalSum, Matrix.transpose

    Proof uses: id, Finset.sum_comm, Finset.univ

    2 instances, coercions and auxiliary constants left out.

    Tactic trace: 2 steps

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

  7. lemma Imo1971P6.aux Auxiliary lemma: The inequality holds if there exists a row with sum x such that x is less than or equal to all row sums and column sums line 51 source

    Source documentation

    Auxiliary lemma: The inequality holds if there exists a row with sum x such that x is less than or equal to all row sums and column sums.

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

    Statement uses: Nat, Matrix, Fin, LT.lt, OfNat.ofNat, Eq, GE.ge, HAdd.hAdd, Imo1971P6.rowSum, Imo1971P6.colSum, LE.le, Exists, HMul.hMul, Imo1971P6.totalSum, HPow.hPow

    Proof uses: dite, Trans.trans, Finset.sum, Finset.univ, Imo1971P6.totalSum_eq_rowSum_sum, Finset.sum_le_sum, Membership.mem, Finset, of_eq_true, Eq.trans, True, congrFun', congrArg, HSMul.hSMul, Finset.card, Finset.sum_const, Fintype.card_fin, eq_self, Eq.mpr, Int and 103 more

    139 instances, coercions and auxiliary constants left out.

    Tactic trace: 49 steps

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

    lemma aux {n : ℕ} (A : Matrix (Fin n) (Fin n) ℕ) (n_pos : 0 < n)
        (h_cond : ∀ i j : Fin n, A i j = 0 → rowSum A i + colSum A j ≥ n)
        (x : ℕ)
        (h_min_row : ∀ i, x ≤ rowSum A i)
        (h_min_col : ∀ j, x ≤ colSum A j)
        (h_exists_row : ∃ i, rowSum A i = x) :
        2 * totalSum A ≥ n^2 := by
    …

    Mentions: Imo1971P6.rowSum, Imo1971P6.colSum, Imo1971P6.totalSum

  8. problem Imo1971P6.imo1971_p6 line 101 source

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

    Statement uses: Nat, Matrix, Fin, LT.lt, OfNat.ofNat, Eq, GE.ge, HAdd.hAdd, Imo1971P6.rowSum, Imo1971P6.colSum, HMul.hMul, Imo1971P6.totalSum, HPow.hPow

    Proof uses: Finset, Union.union, Finset.image, Finset.univ, Finset.Nonempty, Exists.intro, Membership.mem, Fin.mk, of_eq_true, Eq.trans, Or, True, Exists, congr, congrArg, And, funext, congrFun', true_and, true_or and 13 more

    40 instances, coercions and auxiliary constants left out.

    Tactic trace: 37 steps

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