REAL_SOSFIELD (positive denominators)
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 8
- Forks
- 1
- Avg merge
- 53m
- Merged PRs (30d)
- 2
Description
Recommended implementation order: 5th of 10.
Context
Harrison's REAL_SOSFIELD clears denominators in goals involving /. We can do the positive-denominator case (which only adds inequality side conditions) without depending on the equality machinery in #21.
Size & files
~150–250 LOC. SOS/Reify.lean, SOS/Tactic.lean.
Approach
Lean on Mathlib.Tactic.FieldSimp rather than implementing a custom Expr walker (which would have to handle nested divisions, sign flips on < vs ≤, side-condition discharge — easy to get wrong).
Design
New tactic sos_field that:
- Runs
field_simp(with positivity hypotheses as side conditions) to clear denominators. - Routes the cleared polynomial inequality through
sos. - Falls back with a clear error if
field_simpleaves residual divisions ("denominatorbcould not be proven non-zero / positive — add it as a hypothesis").
Do not add Raw.div to SOS/Raw.lean — Raw stays a true polynomial ring.
Verification
example (x : ℝ) (hx : 0 < x) : 0 ≤ 1/x + x - 2 := by sos_fieldexample (a b : ℝ) (h : 0 < b) : 0 ≤ a^2 / b := by sos_field
Risks
field_simp may rewrite into shapes the reifier doesn't re-recognise. Add a norm_num / ring_nf post-pass to normalise.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading SOS/Reify.lean and SOS/Tactic.lean, then run the two verification examples in the issue to understand the expected tactic behavior. Done means a new sos_field tactic handles positive denominators through field_simp and sos, reports unresolved denominators clearly, and accounts for the normalization risk noted in the issue.
Written by the indexing model from the issue text.
Assessment
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100