MathCase For teachers

Why the square rule works for primes

A worked answer for the divisibility lesson. Ask learners to explain the example with four before introducing primes.

Start with a rule that fails

Two squared is four. Four goes into four exactly once. Four does not go into two a whole number of times. So at n = 2 the rule fails.

Why does the product exercise take two steps?

Suppose a prime p divides (a × b)².

  1. Remove the square. A prime that divides a square divides its base. Here the base is a × b.
  2. Separate the factors. A prime that divides a product divides at least one factor. So p divides a or b.
Does every composite number fail the square rule?

No. For example, if 6 divides n², both 2 and 3 divide n². They are prime, so they both divide n. Since they share no prime factors, their product 6 also divides n.

Six does fail the product rule. It divides 2 × 3, yet it divides neither 2 nor 3.

Optional Lean proof and exact statement
theorem prime_dvd_factor_of_product_square (p a b : Nat)
    (hp : p.Prime) (h : p ∣ (a * b) ^ 2) : p ∣ a ∨ p ∣ b := by
  have hProduct : p ∣ a * b := hp.dvd_of_dvd_pow h
  exact hp.dvd_mul.mp hProduct

The first line uses primality to move from a divisor of a square to a divisor of its base. The second uses the prime-divides-product property.

Try it with a learner

  1. Ask them to verify 4 and 2 without opening the proof.
  2. Ask which assumption changed when the prime statement is introduced.
  3. Give the product question and ask them to name the two steps before writing code.

They can enter a proof attempt in Your proof. For file-based assignments, open the assignment activity. Students and teachers exchange the files themselves.