lean-golf Lean 4 proof leaderboard

IMO1971 P6

open: first valid proof sets the record

Compfiles · Imo · Apache-2.0
Copyright (c) 2026 lean-tom. All rights reserved. Authors: lean-tom (with assistance from Gemini)

Statement

import Mathlib.Data.Matrix.Basic
import Mathlib.Tactic
theorem _root_.LeanGolf.compfiles.imo1971_p6 {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) :
    2 * totalSum A ≥ n^2
Trusted statement context
noncomputable section

namespace Imo1971P6

open BigOperators Matrix

variable {n : ℕ} (A : Matrix (Fin n) (Fin n) ℕ)

def rowSum (i : Fin n) : ℕ := ∑ j, A i j

def colSum (j : Fin n) : ℕ := ∑ i, Aᵀ j i

def totalSum : ℕ := ∑ i, ∑ j, A i j