mondrian_perfect_partition_n_prime_factors_ge_three
Any integer square admitting a perfect admissible partition must have at least three distinct prime factors.
Statement
theorem mondrian_perfect_partition_n_prime_factors_ge_three (n : ℕ)
(P : List (ℕ × ℕ × ℕ × ℕ)) (hP : mondrian_is_partition n P)
(hz : mondrian_defect P = 0) :
3 ≤ n.primeFactors.card- Source
- step towards mondrian_no_perfect_partition
- Verified
- 27 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 7
- mondrian_rect_congruentTwo rectangles are congruent when they have the same side lengths, possibly after a rotation (so 2×3 and 3×2 are congruent).
- mondrian_rect_cellsThe unit cells [i,i+1]×[j,j+1] of the integer rectangle [x₀,x₁]×[y₀,y₁], recorded as r = (x₀, x₁, y₀, y₁); a cell is named by its…
- mondrian_perfect_area_productIn a perfect n-square partition, the number of rectangles times the area of any member is n squared.
- mondrian_defectThe defect def(P) = max_{R∈P} |R| − min_{R∈P} |R| of a family of rectangles.
- mondrian_is_partitionAn admissible Mondrian partition of the n×n square: at least two axis-parallel rectangles with positive integer side lengths, with…
- mondrian_perfect_area_three_prime_factorsEvery tile area in a perfect admissible integer square partition has at least three distinct prime factors.
- mondrian_rect_areaThe area |R| = width × height of a rectangle.
The proof, explained
The proof selects an arbitrary rectangle $r$ from the partition, which is guaranteed to exist because an admissible partition contains at least two rectangles. Because the defect is zero, all rectangles share the same area, which must have at least three distinct prime factors, and the total area satisfies $|P| \times \text{area}(r) = n^2$. In particular, the area of $r$ divides $n^2$, and $n$ cannot be zero. Since $n^2$ and $n$ have identical prime factors, every prime factor of the rectangle's area is also a prime factor of $n$. Therefore, $n$ must possess at least three distinct prime factors.
The partition $P$ contains at least one rectangle $r$.
By the definition of an admissible partition, $P$ contains at least two rectangles ($2 \le |P|$, from hypothesis $hP$). Consequently, $P$ cannot be empty, so we may choose a rectangle $r \in P$.
obtain ⟨r, hr⟩ : ∃ r, r ∈ P := by rcases P with _ | ⟨r, P⟩ · have := hP.1; simp at this · exact ⟨r, by simp⟩
The area of $r$ has at least three prime factors, and $|P| \times \text{area}(r) = n^2$.
Because the defect of $P$ is zero, all rectangles have identical area. By mondrian_perfect_area_three_prime_factors, the area of $r$ has at least three distinct prime factors. Furthermore, by mondrian_perfect_area_product, the total area covered by the rectangles equals the area of the bounding square, so $|P| \times \text{area}(r) = n^2$.
uses
mondrian_perfect_area_three_prime_factors,mondrian_perfect_area_producthave h3 := mondrian_perfect_area_three_prime_factors n P hP hz r hr have hprod := mondrian_perfect_area_product n P hP hz r hr
The side length $n$ is non-zero.
Suppose for contradiction that $n = 0$. Then $|P| \times \text{area}(r) = 0^2 = 0$. By Nat.mul_eq_zero.1, either $|P| = 0$ or $\text{area}(r) = 0$. The first case contradicts $|P| \ge 2$, while the second case implies that the area has zero prime factors, contradicting the fact that it has at least three.
uses
Nat.mul_eq_zero.1have hn : n ≠ 0 := by rintro rfl have hl := hP.1 have h0 : P.length * mondrian_rect_area r = 0 := by rw [hprod]; norm_num rcases Nat.mul_eq_zero.1 h0 with h | h · omega · rw [h] at h3; simp at h3
The area of $r$ divides $n^2$.
Since $|P| \times \text{area}(r) = n^2$, the area of $r$ divides $n^2$ with cofactor $|P|$.
have hdvd : mondrian_rect_area r ∣ n ^ 2 := ⟨P.length, by rw [← hprod]; ring⟩
The prime factors of $\text{area}(r)$ are a subset of the prime factors of $n$.
Because $\text{area}(r) \mid n^2$ and $n^2 \ne 0$ (since $n \ne 0$ via pow_ne_zero), Nat.primeFactors_mono implies that the prime factors of $\text{area}(r)$ are contained in those of $n^2$. Since $n^2$ and $n$ share the exact same prime factors by Nat.primeFactors_pow, the prime factors of $\text{area}(r)$ form a subset of the prime factors of $n$.
uses
Nat.primeFactors_mono,pow_ne_zero,Nat.primeFactors_powhave hsub : (mondrian_rect_area r).primeFactors ⊆ n.primeFactors := by have := Nat.primeFactors_mono hdvd (pow_ne_zero 2 hn) rwa [Nat.primeFactors_pow _ (by norm_num)] at this
The side length $n$ has at least three distinct prime factors.
By Finset.card_le_card, the subset relation between the prime factors of $\text{area}(r)$ and those of $n$ implies that the number of prime factors of $n$ is at least that of $\text{area}(r)$. Since $\text{area}(r)$ has at least three prime factors, $n$ must also have at least three prime factors.
uses
Finset.card_le_cardexact h3.trans (Finset.card_le_card hsub)
mondrian_perfect_area_three_prime_factors- In a defect-zero partition of an $n \times n$ square, the area of any rectangle in the partition has at least three distinct prime factors.
mondrian_perfect_area_product- In a defect-zero partition of an $n \times n$ square, the product of the number of rectangles and the area of any rectangle equals $n^2$.
Nat.mul_eq_zero.1- If the product of two natural numbers is zero, then at least one of the factors is zero.
Nat.primeFactors_mono- If a natural number $m$ divides a non-zero natural number $n$, then the set of prime factors of $m$ is a subset of the set of prime factors of $n$.
pow_ne_zero- A non-zero element raised to any power is non-zero.
Nat.primeFactors_pow- For any non-zero exponent $k$, the set of prime factors of $n^k$ is equal to the set of prime factors of $n$.
Finset.card_le_card- If a finite set $s$ is a subset of a finite set $t$, then the cardinality of $s$ is at most the cardinality of $t$.
- The case $n = 0$ is a formal edge case with no paper counterpart: in paper proofs, side lengths are implicitly positive, but formally Lean requires $n \neq 0$ so that the base is non-zero when taking prime factors of powers.
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
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
/-- Any integer square admitting a perfect admissible partition must have at least three distinct prime factors. -/theorem mondrian_perfect_partition_n_prime_factors_ge_three (n : ℕ) (P : List (ℕ × ℕ × ℕ × ℕ)) (hP : mondrian_is_partition n P) (hz : mondrian_defect P = 0) : 3 ≤ n.primeFactors.card := by obtain ⟨r, hr⟩ : ∃ r, r ∈ P := by rcases P with _ | ⟨r, P⟩ · have := hP.1; simp at this · exact ⟨r, by simp⟩ have h3 := mondrian_perfect_area_three_prime_factors n P hP hz r hr have hprod := mondrian_perfect_area_product n P hP hz r hr have hn : n ≠ 0 := by rintro rfl have hl := hP.1 have h0 : P.length * mondrian_rect_area r = 0 := by rw [hprod]; norm_num rcases Nat.mul_eq_zero.1 h0 with h | h · omega · rw [h] at h3; simp at h3 have hdvd : mondrian_rect_area r ∣ n ^ 2 := ⟨P.length, by rw [← hprod]; ring⟩ have hsub : (mondrian_rect_area r).primeFactors ⊆ n.primeFactors := by have := Nat.primeFactors_mono hdvd (pow_ne_zero 2 hn) rwa [Nat.primeFactors_pow _ (by norm_num)] at this exact h3.trans (Finset.card_le_card hsub)