mathlib3 documentation

tactic.mk_simp_attribute

User command to register simp attributes #

In this file we define a command mk_simp_attribute that can be used to register simp sets. We also define all simp attributes that are used in the library and tag lemmas from Lean core with these attributes.

User command #

The command mk_simp_attribute simp_name "description" creates a simp set with name simp_name. Lemmas tagged with @[simp_name] will be included when simp with simp_name is called. mk_simp_attribute simp_name none will use a default description.

Appending the command with with attr1 attr2 ... will include all declarations tagged with attr1, attr2, ... in the new simp set.

This command is preferred to using run_cmd mk_simp_attr `simp_name since it adds a doc string to the attribute that is defined. If you need to create a simp set in a file where this command is not available, you should use

run_cmd mk_simp_attr `simp_name
run_cmd add_doc_string `simp_attr.simp_name "Description of the simp set here"

The command mk_simp_attribute simp_name "description" creates a simp set with name simp_name. Lemmas tagged with @[simp_name] will be included when simp with simp_name is called. mk_simp_attribute simp_name none will use a default description.

Appending the command with with attr1 attr2 ... will include all declarations tagged with attr1, attr2, ... in the new simp set.

This command is preferred to using run_cmd mk_simp_attr `simp_name since it adds a doc string to the attribute that is defined. If you need to create a simp set in a file where this command is not available, you should use

run_cmd mk_simp_attr `simp_name
run_cmd add_doc_string `simp_attr.simp_name "Description of the simp set here"

Attributes #

The simpset equiv_rw_simp is used by the tactic equiv_rw to simplify applications of equivalences and their inverses.

The simpset field_simps is used by the tactic field_simp to reduce an expression in a field to an expression of the form n / d where n and d are division-free.

Simp set for functor_norm

Simplification rules for ghost equations

Simp set for integral rules.

Simp attribute for lemmas about is_R_or_C

The simpset mfld_simps records several simp lemmas that are especially useful in manifolds. It is a subset of the whole set of simp lemmas, but it makes it possible to have quicker proofs (when used with squeeze_simp or simp only) while retaining readability.

The typical use case is the following, in a file on manifolds: If simp [foo, bar] is slow, replace it with squeeze_simp [foo, bar] with mfld_simps and paste its output. The list of lemmas should be reasonable (contrary to the output of squeeze_simp [foo, bar] which might contain tens of lemmas), and the outcome should be quick enough.

simp set for monad_norm

Simp lemmas for nontriviality tactic

Simp attribute for lemmas about even

The push_cast simp attribute uses norm_cast lemmas to move casts toward the leaf nodes of the expression.

Simp set for if-then-else statements, used in the split_ifs tactic

The simpset transport_simps is used by the tactic transport to simplify certain expressions involving application of equivalences, and trivial eq.rec or ep.mpr conversions. It's probably best not to adjust it without understanding the algorithm used by transport.

simp set for the manipulation of typevec and arrow expressions