Skip to content

Commit 82dd528

Browse files
committed
chore(Tactic): rewrite order tactic docstring (leanprover-community#37927)
This PR rewrites the docstrings for the `order` tactic, to consistently match the official style guide, to make sure they are complete while not getting too long. The `order_core` docstring also gets a little rewrite to make clearer that it is an implementation detail (and also explain exactly what it does). Co-authored-by: Anne C.A. Baanen <vierkantor@vierkantor.com>
1 parent 3d14267 commit 82dd528

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

Mathlib/Tactic/Order.lean

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,10 @@ def orderCore (only? : Bool) (hyps : Array Expr) (negGoal : Expr) (g : MVarId) :
289289
/-- Args for the `order` tactic. -/
290290
syntax orderArgs := (&" only")? (" [" term,* "]")?
291291

292-
/-- `order_core` is the part of the `order` tactic that tries to find a contradiction. -/
293-
syntax (name := order_core) "order_core" orderArgs ident : tactic
292+
/-- `order_core` is an implementation detail of the `order` tactic. It proves the main goal,
293+
which must be `⊢ False`, by deriving a contradiction from hypotheses which are formulas in the
294+
language of orders. -/
295+
local syntax (name := order_core) "order_core" orderArgs ident : tactic
294296

295297
open Syntax in
296298
elab_rules : tactic
@@ -299,8 +301,16 @@ elab_rules : tactic
299301
let args ← ((args.map (TSepArray.getElems)).getD {}).mapM (elabTermWithoutNewMVars `order)
300302
commitIfNoEx do liftMetaFinishingTactic <| orderCore o.isSome args negGoal
301303

302-
/-- A finishing tactic for solving goals in arbitrary `Preorder`, `PartialOrder`,
303-
or `LinearOrder`. Supports `⊤`, `⊥`, and lattice operations. -/
304+
/-- `order` solves the main goal if it can be derived from the local hypotheses and the axioms of
305+
`Preorder`, `PartialOrder` or `LinearOrder`. Also supports `⊤`, `⊥` and lattice operations.
306+
307+
This tactic fails if it cannot prove the main goal.
308+
309+
* `order [e₁, ..., eₙ]` uses the terms `e₁`, ... `eₙ` as hypotheses, in addition to the local
310+
context.
311+
* `order only [e₁, ..., eₙ]` uses only the terms `e₁`, ... `eₙ` as hypotheses (ignoring the local
312+
context).
313+
-/
304314
macro "order" args:orderArgs : tactic => `(tactic|
305315
· intros
306316
by_contra! _order_neg_goal

0 commit comments

Comments
 (0)