Skip to content

Commit 8ae381a

Browse files
authored
doc: swap sides of equality in grind (#841)
This PR update's @adomani's bug fix in #512 to the current manual, and corrects a related bug — the mentions of `grind` should be `grind!`, given that grind now has minimal-indexing and maximal-indexing variants.
1 parent 49e1877 commit 8ae381a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Manual/Grind/EMatching.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -685,18 +685,18 @@ axiom q : Nat → Nat
685685
```
686686

687687
```lean (name := h1)
688-
@[grind!? →] theorem h₁ (w : 7 = p (q x)) : p (x + 1) = q x := sorry
688+
@[grind!? →] theorem h₁ (w : p (q x) = 7) : p (x + 1) = q x := sorry
689689
```
690690
```leanOutput h1
691691
h₁: [q #1]
692692
```
693693
The pattern is `q x`.
694694
Counting from the right, parameter `#0` is the premise `w` and parameter `#1` is the implicit parameter `x`.
695695

696-
Why did `@[grind →]`? select `q #1`?
697-
The attribute `@[grind →]` finds patterns by traversing the hypotheses (that is, parameters whose types are propositions) from left to right.
698-
In this case, there's only a single hypothesis: `7 = p (q x)`.
699-
The heuristic described above says that {attr}`grind` will search for a minimal {tech}[indexable] subexpression which {tech}[covers] a previously uncovered parameter.
696+
Why did `@[grind! →]`? select `q #1`?
697+
The attribute `@[grind! →]` finds patterns by traversing the hypotheses (that is, parameters whose types are propositions) from left to right.
698+
In this case, there's only a single hypothesis: `p (q x) = 7`.
699+
The heuristic described above says that {attr}`grind!` will search for a minimal {tech}[indexable] subexpression which {tech}[covers] a previously uncovered parameter.
700700
There's just one uncovered parameter, namely `x`.
701701
The whole hypothesis `p (q x) = 7` can't be used because {tactic}`grind` will not index on equality.
702702
The right-hand side `7` is not helpful, because it doesn't determine the value of `x`.

0 commit comments

Comments
 (0)