Given the expression of a term, we can try to directly match it, and there are helpers for this. But there is a smarter way using Lean's unification function isDefEq.
The function isDefEq takes two terms and returns a MetaM Bool. It returns true if the two terms are definitionally equal. More interestingly, if the terms have metavariables, it will try to solve them.
Equations
- One or more equations did not get rendered due to their size.
Instances For
We will match in a smarted way:
- Create metavariables for the two terms, lhs and rhs.
- Create the expression
lhs ≤ rhs. - Equate this with the given expression and solve.
- Return the meta-variables.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- «command#natLeExpr_» = Lean.ParserDescr.node `«command#natLeExpr_» 1022 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "#natLeExpr") (Lean.ParserDescr.cat `term 0))
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- termList_eg = Lean.ParserDescr.node `termList_eg 1024 (Lean.ParserDescr.symbol "list_eg")
Instances For
Equations
- One or more equations did not get rendered due to their size.