The areas / V34. The tactics of Mathlib
Mathlib.Tactic.Subsingleton
5 declarations. Mathlib docs · Source
subsingleton tactic
The subsingleton tactic closes Eq or HEq goals using an argument
that the types involved are subsingletons.
To first approximation, it does apply Subsingleton.elim but it also will try proof_irrel_heq,
and it is careful not to accidentally specialize Sort _ to Prop.
def Lean.Meta.mkSubsingleton E1 #
Lean.Expr → Lean.MetaM Lean.Expr
Returns the expression Subsingleton ty.
def Lean.Meta.synthSubsingletonInst E1 #
Lean.Expr → optParam (Array (Lean.Term × Lean.Meta.AbstractMVarsResult)) #[] → Lean.MetaM Lean.Expr
Synthesizes a Subsingleton ty instance with the additional local instances made available.
def Lean.MVarId.subsingleton E1 #
Lean.MVarId → optParam (Array (Lean.Term × Lean.Meta.AbstractMVarsResult)) #[] → Lean.MetaM Unit
Closes the goal g whose target is an Eq or HEq by appealing to the fact that the types
are subsingletons.
Fails if it cannot find a way to do this.
Has support for showing BEq instances are equal if they have LawfulBEq instances.
def Mathlib.Tactic.subsingletonStx E1 #
Lean.ParserDescr
subsingleton proves the main goal of the form ∀ a ... b, x = y or ∀ a ... b, x ≍ y using the
fact that the type(s) of x and y are subsingletons (a type with exactly zero or one elements).
If subsingleton cannot close the goal, it fails.
Techniques the subsingleton tactic can apply:
- proof irrelevance
- heterogeneous proof irrelevance (via
proof_irrel_heq) - using
Subsingleton(viaSubsingleton.elim) - proving instances of the type
BEq αare equal if they are both lawful (vialawful_beq_subsingleton)
subsingleton [inst1, inst2, ...]can be used to add additionalSubsingletoninstances to the local context. This can be more flexible thanhave := inst1; have := inst2; ...; subsingletonsince the tactic does not require that all placeholders be solved for.
def Mathlib.Tactic.elabSubsingletonInsts E1 #
Option (Array Lean.Term) → Lean.Elab.TermElabM (Array (Lean.Term × Lean.Meta.AbstractMVarsResult))
Elaborates the terms like how Lean.Elab.Tactic.addSimpTheorem does,
abstracting their metavariables.