AFTD Auto-Formalizing Theoretical Domains

mondrian_perfect_area_product

theoremverified

In a perfect n-square partition, the number of rectangles times the area of any member is n squared.

Statement

theorem mondrian_perfect_area_product (n : ℕ) (P : List (ℕ × ℕ × ℕ × ℕ))
    (h : mondrian_is_partition n P) (hz : mondrian_defect P = 0)
    (r : ℕ × ℕ × ℕ × ℕ) (hr : r ∈ P) :
    P.length * mondrian_rect_area r = n ^ 2
Source
arXiv:2610.19193, Section 1, and arXiv:2311.02385, Section 3 (available integer dimension pairs); helper for OP-280 and mondrian_no_perfect_partition.
Verified
26 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 5
Used by 8

The proof, explained

Since P is a partition of an n-square into rectangles, the sum of the rectangle areas is n squared. Because the defect of P is zero, every rectangle in P must have the exact same area as r. Consequently, the sum of the areas is simply the number of rectangles times the area of r, which yields the desired equality.

  1. It suffices to show that the product of the number of rectangles and the area of r equals the sum of the areas of all rectangles in P.

    Since P partitions an n-square, mondrian_partition_area_sum establishes that the sum of the areas of the rectangles is n squared. Rewriting replaces n squared with this sum of areas.

    line 5

    uses mondrian_partition_area_sum

      rw [← mondrian_partition_area_sum n P h]
  2. The list of rectangle areas in P is identical to replicating the area of r as many times as there are rectangles in P.

    By List.eq_replicate_iff.mpr, it suffices to show that the list of areas has length equal to |P| (which holds by definition of map) and that every element equals the area of r. By List.mem_map.mp, each element in the mapped list is the area of some rectangle s in P. Since the partition has defect zero, mondrian_defect_zero_equal shows that s and r have equal area.

    lines 6–11

    uses List.eq_replicate_iff.mpr, List.mem_map.mp, mondrian_defect_zero_equal

      have heq : P.map mondrian_rect_area = List.replicate P.length (mondrian_rect_area r) := by
        apply List.eq_replicate_iff.mpr
        refine ⟨by simp, ?_⟩
        intro a ha
        obtain ⟨s, hs, rfl⟩ := List.mem_map.mp ha
        exact mondrian_defect_zero_equal P hz s r hs hr
  3. The sum of the replicated areas evaluates to |P| times the area of r, establishing the equality.

    Substituting the replicate list for the list of areas reduces the right-hand side to the sum of |P| copies of the area of r. Simplifying this sum yields |P| times the area of r, which matches the left-hand side.

    lines 12–13

      rw [heq]
      simp
mondrian_partition_area_sum
In a partition of an n-square into rectangles, the sum of the areas of the rectangles equals n squared.
List.eq_replicate_iff.mpr
A list is equal to k copies of an element x if its length is k and every element in it is equal to x.
List.mem_map.mp
If an element belongs to the image of a list under a function, then it is the image of some element in the list.
mondrian_defect_zero_equal
If the defect of a rectangle partition is zero, then any two rectangles in the partition have equal area.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

theorem mondrian_perfect_area_product (n : ℕ) (P : List (ℕ × ℕ × ℕ × ℕ))    (h : mondrian_is_partition n P) (hz : mondrian_defect P = 0)    (r : ℕ × ℕ × ℕ × ℕ) (hr : r ∈ P) :    P.length * mondrian_rect_area r = n ^ 2 := by  rw [← mondrian_partition_area_sum n P h]  have heq : P.map mondrian_rect_area = List.replicate P.length (mondrian_rect_area r) := by    apply List.eq_replicate_iff.mpr    refine ⟨by simp, ?_⟩    intro a ha    obtain ⟨s, hs, rfl⟩ := List.mem_map.mp ha    exact mondrian_defect_zero_equal P hz s r hs hr  rw [heq]  simp
See it in the graphDiscuss this resultChallenge it