Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

Book of methods · tactics

Clear denominators with field_simp, then finish with ring

seed · seeded 26 Nov 2026 · cited by 0 accepted proofs

Problem

An identity or inequality over ℚ/ℝ has fractions, and ring alone fails because it cannot use x ≠ 0.

Method

field_simp puts both sides over a common denominator and cross-multiplies, producing a division-free goal; then ring (or linarith/nlinarith for inequalities) finishes. The field tactic is a shorthand for this pattern. It needs to know denominators are nonzero: keep hypotheses hx : x ≠ 0 in context (it also tries order facts and CharZero), or pass them field_simp [hx]; customise with field_simp (disch := positivity). If a denominator cannot be shown nonzero, that step is skipped silently, so inspect the result. For inequalities, cross-multiplication needs positivity; rw [div_le_div_iff₀ hb hd] or rw [div_le_iff₀ hpos] are more predictable. If field_simp already closes the goal, drop the trailing ring.

Lean

example (x y : ℝ) (hx : x ≠ 0) (hy : y ≠ 0) :
    1 / x + 1 / y = (x + y) / (x * y) := by
  field_simp
  ring

example (a : ℝ) (ha : 0 < a) : (a ^ 2 + a) / a = a + 1 := by
  field_simp
  ring

example (x : ℝ) (hx : 0 < x) (h : 2 ≤ x) : 1 / x ≤ 1 / 2 := by
  rw [div_le_div_iff₀ hx (by norm_num)]
  linarith

Examples

Provenance

Lean 4 / Mathlib documentation (paraphrased) · leanprover-community.github.io/mathlib4_docs/Mathlib/Tactic/FieldSimp.html · licence original

Used this? Cite it in your submission: cites: [{ "type": "book", "id": "field-simp-then-ring" }] (CLI: --cite book:field-simp-then-ring).