Implementation of the @[ext]
attribute #
Meta code for creating ext theorems #
Constructs the hypotheses for the structure extensionality theorem that states that two structures are equal if their fields are equal.
Calls the continuation k
with the list of parameters to the structure,
two structure variables x
and y
, and a list of pairs (field, ty)
where each ty
is of the form x.field = y.field
or HEq x.field y.field
.
If flat
parses to true
, any fields inherited from parent structures
are treated as fields of the given structure type.
If it is false
, then the behind-the-scenes encoding of inherited fields
is visible in the extensionality lemma.
Equations
Instances For
Derives the type of the iff
form of an ext theorem.
Equations
Instances For
Ensures that the given structure has an ext theorem, without validating any pre-existing theorems. Returns the name of the ext theorem.
See Lean.Elab.Tactic.Ext.withExtHyps
for an explanation of the flat
argument.
Equations
Instances For
Given an 'ext' theorem, ensures that there is an iff version of the theorem (if possible), without validating any pre-existing theorems. Returns the name of the 'ext_iff' theorem.
Equations
Instances For
Attribute #
Equations
Instances For
Implementation of ext
tactic #
Apply a single extensionality theorem to the current goal.
Equations
Instances For
Postprocessor for withExt
which runs rintro
with the given patterns when the target is a
pi type.
Equations
Instances For
Applies a single extensionality theorem, using pats
to introduce variables in the result.
Runs continuation k
on each subgoal.
Equations
Instances For
Applies extensionality theorems recursively, using pats
to introduce variables in the result.
Runs continuation k
on each subgoal.
Equations
Instances For
Apply extensionality theorems as much as possible, using pats
to introduce the variables
in extensionality theorems like funext
. Returns a list of subgoals.
This is built on top of withExtN
, running in TermElabM
to build the list of new subgoals.
(And, for each goal, the patterns consumed.)