Data for user-defined theorems marked with the congr attribute.
This type should be confused with CongrTheorem which reprents different kinds of automatically
generated congruence theorems. The simp tactic also uses some of them.
Equations
- Lean.Meta.instInhabitedSimpCongrTheorem = { default := { theoremName := default, funName := default, hypothesesPos := default, priority := default } }
Equations
- Lean.Meta.instReprSimpCongrTheorem = { reprPrec := [anonymous] }
- lemmas : Lean.SMap Lean.Name (List Lean.Meta.SimpCongrTheorem)
Equations
- Lean.Meta.instInhabitedSimpCongrTheorems = { default := { lemmas := default } }
Equations
- Lean.Meta.instReprSimpCongrTheorems = { reprPrec := [anonymous] }
Equations
- Lean.Meta.SimpCongrTheorems.get d declName = match Lean.SMap.find? d.lemmas declName with | none => [] | some cs => cs
def
Lean.Meta.addSimpCongrTheoremEntry
(d : Lean.Meta.SimpCongrTheorems)
(e : Lean.Meta.SimpCongrTheorem)
:
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Meta.addSimpCongrTheoremEntry.insert e [] = [e]
- Lean.Meta.addSimpCongrTheoremEntry.insert e (e' :: es) = if e.priority ≥ e'.priority then e :: e' :: es else e' :: Lean.Meta.addSimpCongrTheoremEntry.insert e es
Equations
- One or more equations did not get rendered due to their size.
Return true if t contains a metavariable that is not in mvarSet
Equations
- Lean.Meta.mkSimpCongrTheorem.onlyMVarsAt t mvarSet = Option.isNone (Lean.Expr.find? (fun e => Lean.Expr.isMVar e && !Std.RBTree.contains mvarSet (Lean.Expr.mvarId! e)) t)
def
Lean.Meta.addSimpCongrTheorem
(declName : Lean.Name)
(attrKind : Lean.AttributeKind)
(prio : Nat)
:
Equations
- Lean.Meta.addSimpCongrTheorem declName attrKind prio = do let lemma ← Lean.Meta.mkSimpCongrTheorem declName prio Lean.ScopedEnvExtension.add Lean.Meta.congrExtension lemma attrKind
Equations
- Lean.Meta.getSimpCongrTheorems = do let a ← Lean.getEnv pure (Lean.ScopedEnvExtension.getState Lean.Meta.congrExtension a)