FormalConjectures/Wikipedia/MagicSquares.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 project documentation, Formal Conjectures paper, arXiv v1

2 declarations, 2 contain sorry, 0 declared as axioms

Magic Squares

References:

Imports (1)
  1. theorem MagicSquares.exists_magic_square_squares Does there exist a $3 \times 3$ matrix such that every entry is a distinct square, and all rows, columns, and diagonals add up to the same value? sorry line 43 source

    Source documentation

    Does there exist a $3 \times 3$ matrix such that every entry is a distinct square, and all rows, columns, and diagonals add up to the same value?

    0 is excluded, as a Magic Square of Squares with 0 and 8 distinct squares is know is knownn. See Magic Square of Squares

    L4DEL explanation

    Does there exist a $3 \times 3$ matrix such that every entry is a distinct square, and all rows, columns, and diagonals add up to the same value? 0 is excluded, as a Magic Square of Squares with 0 and 8 distinct squares is know is knownn. See Magic Square of Squares

    Sources and attribution: Pinned Lean source (1646ca16afd6)

    depends on sorry what this means

    Statement uses: Iff, True, Exists, Fin, OfNat.ofNat, Nat, And, Function.Injective2, LT.lt, IsSquare, Eq, Finset.sum, Finset.univ, HAdd.hAdd

    Proof uses: sorryAx, Lean.Name, Bool.false, Lean.Name.num, Lean.Name.str, Lean.Name.anonymous

    18 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

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

    theorem exists_magic_square_squares :
        answer(sorry) ↔ ∃ m : Fin 3 → Fin 3 → ℕ, ∃ t : ℕ,
           m.Injective2 ∧
           (∀ i j, 0 < (m i j) ∧ IsSquare (m i j)) ∧
           (∀ i, ∑ j, m i j = t) ∧
           (∀ j, ∑ i, m i j = t) ∧
           m 0 0 + m 1 1 + m 2 2 = t ∧
           m 0 2 + m 1 1 + m 2 0 = t := by
    …
  2. theorem MagicSquares.exists_semi_magic_square_cubes Does there exist a $3 \times 3$ semi-magic square whose entries are all distinct positive integer cubes? sorry line 65 source

    Source documentation

    Does there exist a $3 \times 3$ semi-magic square whose entries are all distinct positive integer cubes? A square is semi-magic if all rows and columns sum to the same total.

    More precisely, we seek a $3 \times 3$ matrix with entries $a_{ij}$ such that each $a_{ij} = n_{ij}^3$ for some positive integer $n_{ij}$, all nine cubes are distinct, and all row sums and column sums are equal.

    Reference: Semi-Magic Square of Cubes

    L4DEL explanation

    Does there exist a $3 \times 3$ semi-magic square whose entries are all distinct positive integer cubes? A square is semi-magic if all rows and columns sum to the same total. More precisely, we seek a $3 \times 3$ matrix with entries $a_{ij}$ such that each $a_{ij} = n_{ij}^3$ for some positive integer $n_{ij}$, all nine cubes are distinct, and all row sums and column sums are equal. Reference: Semi-Magic Square of Cubes

    Sources and attribution: Pinned Lean source (1646ca16afd6)

    depends on sorry what this means

    Statement uses: Iff, True, Exists, Fin, OfNat.ofNat, Nat, And, Function.Injective2, LT.lt, Eq, HPow.hPow, Finset.sum, Finset.univ

    Proof uses: sorryAx, Lean.Name, Bool.false, Lean.Name.num, Lean.Name.str, Lean.Name.anonymous

    16 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

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

    theorem exists_semi_magic_square_cubes :
        answer(sorry) ↔ ∃ m : Fin 3 → Fin 3 → ℕ, ∃ t : ℕ,
           m.Injective2 ∧
           (∀ i j, ∃ n : ℕ, 0 < n ∧ m i j = n ^ 3) ∧
           (∀ i, ∑ j, m i j = t) ∧
           (∀ j, ∑ i, m i j = t) := by
    …