The alias command #
The alias command is used to create synonyms. The plain command can create a synonym of any
declaration. There is also a version to create synonyms for the forward and reverse implications of
an iff theorem.
The name underlying an alias target
Equations
Instances For
The docstring for an alias.
Equations
- (Batteries.Tactic.Alias.AliasInfo.plain n).toString = toString "**Alias** of `" ++ toString n ++ toString "`."
- (Batteries.Tactic.Alias.AliasInfo.forward n).toString = toString "**Alias** of the forward direction of `" ++ toString n ++ toString "`."
- (Batteries.Tactic.Alias.AliasInfo.reverse n).toString = toString "**Alias** of the reverse direction of `" ++ toString n ++ toString "`."
Instances For
Add a docstring to the alias declName if it doesn't already have one.
This needs to run after elaboration of attributes, because e.g. inherit_doc could a add docstring.
This is also used in to_additive/to_dual.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Environment extension for registering aliases
Get the alias information for a name
Equations
- Batteries.Tactic.Alias.getAliasInfo? name = do let __do_lift ← Lean.getEnv pure (Batteries.Tactic.Alias.aliasExt.find? __do_lift name)
Instances For
Get the old alias information for a name.
Get the alias information for a name
Equations
Instances For
Returns the path of aliases starting at a given name.
The return value is a pair (mps, name) where name is the final non-aliased name in the
alias chain and mps is a list of Bool indicating the sequence of forward (true) and
reverse (false) aliases along the chain.
Set the alias info for a new declaration
Equations
- Batteries.Tactic.Alias.setAliasInfo info declName = Lean.modifyEnv fun (x : Lean.Environment) => Batteries.Tactic.Alias.aliasExt.insert x declName info
Instances For
Updates the deprecated declaration to point to target if no target is provided.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Whether attr is one of the attributes that set the reducibility status of a definition.
Equations
- Batteries.Tactic.Alias.isReducibilityAttr `reducible = true
- Batteries.Tactic.Alias.isReducibilityAttr `semireducible = true
- Batteries.Tactic.Alias.isReducibilityAttr `irreducible = true
- Batteries.Tactic.Alias.isReducibilityAttr `implicit_reducible = true
- Batteries.Tactic.Alias.isReducibilityAttr `instance_reducible = true
- Batteries.Tactic.Alias.isReducibilityAttr attr = false
Instances For
The namespace that def opens while elaborating a declaration named declName:
Foo.Bar for Foo.Bar.baz, and none for atomic names and names starting with _root_.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Resolves the target of an alias named aliasName. If target cannot be resolved in the ambient
scope, it is resolved again with the namespace of aliasName open, as def would do. The ambient
scope is tried first so that existing aliases keep resolving to the same constants.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The command alias name := target creates a synonym of target with the given name.
The command alias ⟨fwd, rev⟩ := target creates synonyms for the forward and reverse directions
of an iff theorem. Use _ if only one direction is required.
These commands accept all modifiers and attributes that def and theorem do.
An alias of a definition has the same reducibility status as its target, so an alias of an
abbrev is reducible. A reducibility attribute on the alias, such as @[irreducible], sets its
status instead.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given a possibly forall-quantified iff expression prf, produce a value for one
of the implication directions (determined by mp).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The command alias name := target creates a synonym of target with the given name.
The command alias ⟨fwd, rev⟩ := target creates synonyms for the forward and reverse directions
of an iff theorem. Use _ if only one direction is required.
These commands accept all modifiers and attributes that def and theorem do.
An alias of a definition has the same reducibility status as its target, so an alias of an
abbrev is reducible. A reducibility attribute on the alias, such as @[irreducible], sets its
status instead.
Equations
- One or more equations did not get rendered due to their size.