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 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
- One or more equations did not get rendered due to their size.
Instances For
Creates the type of the extensionality theorem for the given structure,
returning ∀ {x y : Struct}, x.1 = y.1 → x.2 = y.2 → x = y, for example.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Derives the type of the iff form of an ext theorem.
Equations
- One or more equations did not get rendered due to their size.
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
- One or more equations did not get rendered due to their size.
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
- One or more equations did not get rendered due to their size.
Instances For
Attribute #
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
- One or more equations did not get rendered due to their size.
Instances For
Applies extensionality theorems recursively, using pats to introduce variables in the result.
Runs continuation k on each subgoal.
Equations
- One or more equations did not get rendered due to their size.
- Lean.Elab.Tactic.Ext.withExtN g pats k 0 failIfUnchanged = k g pats
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.)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.