As shown on the ﬁgure, square $PQRS$ is inscribed in right triangle $ABC$, whose right angle is at $C$, so that $S$ and $P$ are on sides $BC$ and $CA$, respectively, while $Q$ and $R$ are on side $AB$. Prove that $A B\geq3QR$ and determine when equality occurs.

[asy]
defaultpen(linewidth(0.7)+fontsize(10));
size(150);
real a=8, b=6;
real y=a/((a^2+b^2)/(a*b)+1), r=degrees((a,b))+180;
pair A=b*dir(-r)*dir(90), B=a*dir(180)*dir(-r), C=origin, S=y*dir(-r)*dir(180), P=(y*b/a)*dir(90-r), Q=foot(P, A, B), R=foot(S, A, B);
draw(A--B--C--cycle^^R--S--P--Q);
pair point=incenter(A,B,C);
label("$A$", A, dir(point--A));
label("$B$", B, dir(point--B));
label("$C$", C, dir(point--C));
label("$S$", S, dir(point--S));
label("$R$", R, dir(270));
label("$Q$", Q, dir(270));
label("$P$", P, dir(point--P));[/asy]
1. **Define Variables and Setup:**
   Let the side length of the square \(PQRS\) be \(x\). Denote the lengths \(AP = y\) and \(AQ = z\). Note that \(\angle CAB = \alpha\), \(\angle APQ = 90^\circ - \alpha\), \(\angle CPS = \alpha\), \(\angle CSP = 90^\circ - \alpha\), \(\angle RSB = \alpha\), and \(\angle CBA = 90^\circ - \alpha\).

2. **Identify Similar Triangles:**
   The triangles \(\Delta APQ\), \(\Delta PSC\), and \(\Delta SBR\) are similar because they share the same angles. Specifically, \(\Delta APQ \sim \Delta PSC \sim \Delta SBR\).

3. **Set Up Proportions:**
   From the similarity \(\Delta APQ \sim \Delta PSC\), we have:
   \[
   \frac{y}{x} = \frac{z}{PC} = \frac{x}{CS}
   \]
   Solving for \(PC\) and \(CS\):
   \[
   PC = \frac{zx}{y} \quad \text{and} \quad CS = \frac{x^2}{y}
   \]

4. **Use Similarity in \(\Delta PSC \sim \Delta SBR\):**
   From the similarity \(\Delta PSC \sim \Delta SBR\), we have:
   \[
   \frac{\frac{zx}{y}}{x} = \frac{x}{SB} = \frac{\frac{x^2}{y}}{RB}
   \]
   Solving for \(SB\) and \(RB\):
   \[
   SB = \frac{xy}{z} \quad \text{and} \quad RB = \frac{x^2}{z}
   \]

5. **Formulate the Inequality:**
   We need to show that \(AB \geq 3QR\). Since \(AB = AQ + QR + RB\), we need to show:
   \[
   AQ + QR + RB \geq 3QR
   \]
   This simplifies to:
   \[
   AQ + RB \geq 2QR
   \]

6. **Substitute Known Values:**
   We know \(AQ = z\), \(QR = x\), and \(RB = \frac{x^2}{z}\). Thus, we need to show:
   \[
   z + \frac{x^2}{z} \geq 2x
   \]

7. **Apply AM-GM Inequality:**
   By the Arithmetic Mean-Geometric Mean (AM-GM) Inequality, we have:
   \[
   \frac{z + \frac{x^2}{z}}{2} \geq \sqrt{z \cdot \frac{x^2}{z}} = x
   \]
   Multiplying both sides by 2, we get:
   \[
   z + \frac{x^2}{z} \geq 2x
   \]
   This confirms the inequality.

8. **Equality Condition:**
   Equality in the AM-GM inequality holds when \(z = \frac{x^2}{z}\), which implies \(z^2 = x^2\) or \(z = x\). Therefore, equality occurs when \(AQ = QR\), meaning the side length of the square is exactly one-third of the hypotenuse \(AB\).

\(\blacksquare\)

The final answer is \( \boxed{ AB \geq 3QR } \) and equality occurs when \(z = x\).