leanprover-community / leanprover-community/mathlib4

Add global pull lemmas

Open
#40,183 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

t-linter
Dominant language
Lean
Stars
4.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Some lemmas in mathlib could be global pull lemmas, but we would not like them as push lemmas: Function.comp_def is such an example. As a pull lemma, it expands g ∘ f to fun x => g (f x); there is no apparent use for the converse.

This appears when using the to_fun attribute to generate eta-expanded versions of some statements: in a number of places, we do attribute [local push ←] Function.comp_def to make to_fun behave the way we want. All these locations could benefit from this feature.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by searching mathlib4 for the local push ← uses of Function.comp_def and inspect how the to_fun attribute consumes these lemmas. Trace the attribute mechanism to determine how a global pull lemma should be registered, then verify that the affected eta-expansion cases work without the local attributes.

Written by the indexing model from the issue text.

Assessment

Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.