Skip to content

Commit f4e1f56

Browse files
authored
feat: basic documentation for grindHom and grindHomPred (#904)
Short explanation based on the existing docs, and a note that this could use an example in the future.
1 parent 4fff1a3 commit f4e1f56

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

Manual/Grind/EMatching.lean

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ grindExt
305305
grindFunCC
306306
grindFwd
307307
grindGen
308+
grindHom
309+
grindHomPred
308310
grindInj
309311
grindIntro
310312
grindLR
@@ -643,6 +645,26 @@ norm
643645
{includeDocstring Lean.Parser.Attr.grindNorm}
644646
:::
645647

648+
The {tactic}`grind` tactic can work with a source algebra that doesn't have a great deal of solving infrastructure (e.g. bitvectors) by “̲injecting”̲ it into another algebra that has more solving infrastructure (like natural numbers or integers).
649+
Homomorphism rules describe the injection from source to target, and how the injection commutes with other operations (like addition or multiplication in the case of bitvectors).
650+
Homomorphism predicates present additional facts that {tactic}`grind` can use about the injection (like that a bitvector of length $`n` corresponds to a natural number less than $`2^n`).
651+
652+
:::syntax Lean.Parser.Attr.grindMod (title := "Homomorphism Rules")
653+
```grammar
654+
hom
655+
```
656+
{includeDocstring Lean.Parser.Attr.grindHom}
657+
:::
658+
659+
:::syntax Lean.Parser.Attr.grindMod (title := "Homomorphism Predicates")
660+
```grammar
661+
hom_pred
662+
```
663+
{includeDocstring Lean.Parser.Attr.grindHomPred}
664+
:::
665+
666+
{TODO}[Grind's hom infrastructure could use an example]
667+
646668
{TODO}[Document `gen` modifier for `grind` patterns]
647669

648670
# Inspecting Patterns

lean-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
leanprover/lean4:nightly-2026-07-18
1+
leanprover/lean4:nightly-2026-07-24

0 commit comments

Comments
 (0)