good_slopes_affine_slope_fractional_injective
Over a field, a fractional linear slope transformation associated with a nonzero two-by-two determinant is injective wherever both denominators are nonzero.
Statement
theorem good_slopes_affine_slope_fractional_injective {K : Type*} [Field K] (dxv dyv dxw dyw a b : K) (hd : dxv*dyw-dxw*dyv ≠ 0) (ha : dyw+a*dxw ≠ 0) (hb : dyw+b*dxw ≠ 0) (heq : (dyv+a*dxv)/(dyw+a*dxw) = (dyv+b*dxv)/(dyw+b*dxw)) : a = b
- Source
- Affine direction transport in the finite-field line argument for OP-1027.
- Verified
- 15 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext
The proof, explained
The proof proceeds by clearing denominators and factoring. Cross-multiplying the equation (dyv + a * dxv) / (dyw + a * dxw) = (dyv + b * dxv) / (dyw + b * dxw), which is valid since both denominators are nonzero, yields an equality of products. Subtracting the two sides and factoring reveals that (a - b) * (dxv * dyw - dxw * dyv) = 0. Because the determinant factor is assumed nonzero and the base structure is a field, the factor a - b must be zero, which gives a = b.
(dyv + a * dxv) * (dyw + b * dxw) = (dyv + b * dxv) * (dyw + a * dxw)
Because both denominators dyw + a * dxw and dyw + b * dxw are nonzero (hypotheses ha and hb), the equality of fractions in heq is equivalent to the equality of their cross-multiplied products via div_eq_div_iff.
uses
div_eq_div_iffhave hc : (dyv+a*dxv)*(dyw+b*dxw) = (dyv+b*dxv)*(dyw+a*dxw) := (div_eq_div_iff ha hb).mp heq(a - b) * (dxv * dyw - dxw * dyv) = 0 automation
Expanding the products on both sides of the cross-multiplication equation and subtracting them cancels the common terms dyv * dyw and a * b * dxv * dxw, leaving (a - b) * (dxv * dyw - dxw * dyv) = 0. The linear_combination tactic verifies this polynomial identity automatically from hc.
have hm : (a-b)*(dxv*dyw-dxw*dyv) = 0 := by linear_combination hc
a = b
In a field, if a product is zero, at least one of its factors is zero (mul_eq_zero.mp). Since the determinant factor dxv * dyw - dxw * dyv is nonzero by hd, the first factor must be zero (resolve_right), so a - b = 0. From a - b = 0, it follows that a = b (sub_eq_zero.mp).
uses
mul_eq_zero.mp,resolve_right,sub_eq_zero.mpexact sub_eq_zero.mp ((mul_eq_zero.mp hm).resolve_right hd)
div_eq_div_iff- Two fractions a / b and c / d with nonzero denominators b ≠ 0 and d ≠ 0 are equal if and only if their cross-products are equal: a * d = c * b.
mul_eq_zero.mp- If a product of two elements in a domain or field equals zero, then at least one of the factors must be zero.
resolve_right- If a disjunction P ∨ Q holds and Q is false (¬Q), then P must be true.
sub_eq_zero.mp- If the difference x - y = 0, then x = y.
- The algebraic factorization in line 10 is established by the `linear_combination` tactic, which automatically expands products and verifies ring equality without recording the intermediate polynomial steps.
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.
set_option maxHeartbeats 5000000theorem good_slopes_affine_slope_fractional_injective {K : Type*} [Field K] (dxv dyv dxw dyw a b : K) (hd : dxv*dyw-dxw*dyv ≠ 0) (ha : dyw+a*dxw ≠ 0) (hb : dyw+b*dxw ≠ 0) (heq : (dyv+a*dxv)/(dyw+a*dxw) = (dyv+b*dxv)/(dyw+b*dxw)) : a = b := by have hc : (dyv+a*dxv)*(dyw+b*dxw) = (dyv+b*dxv)*(dyw+a*dxw) := (div_eq_div_iff ha hb).mp heq have hm : (a-b)*(dxv*dyw-dxw*dyv) = 0 := by linear_combination hc exact sub_eq_zero.mp ((mul_eq_zero.mp hm).resolve_right hd)