Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haveI, exact statements in theorems are not shown #78

Open
eric-wieser opened this issue Sep 27, 2020 · 6 comments
Open

haveI, exact statements in theorems are not shown #78

eric-wieser opened this issue Sep 27, 2020 · 6 comments

Comments

@eric-wieser
Copy link
Member

eric-wieser commented Sep 27, 2020

The statement of module_ext is

lemma module_ext {R : Type*} [ring R] {M : Type*} [add_comm_group M] (P Q : module R M)
  (w : ∀ (r : R) (m : M), by { haveI := P, exact r • m } = by { haveI := Q, exact r • m }) :
  P = Q :=

but the docs show it as

theorem module_ext {R : Type u_1} [ring R] {M : Type u_2} [add_comm_group M] (P Q : module R M) :
(∀ (r : R) (m : M), r • m = r • m) → P = Q

This is obviously unhelpful, as r • m = r • m is just rfl, unlike the original theorem which is not.

@digama0
Copy link
Member

digama0 commented Sep 27, 2020

I don't see any reasonable way to fix this. Lean has no idea we're doing funny business with terms, and docgen can't reflect on lean syntax. The best you can hope for in the near term is to document lemmas with this pattern so that the comments show what's really going on.

@robertylewis
Copy link
Member

I agree with Mario. Note that #check module_ext prints the same. The docs aren't generated from the input files (nor should they be), they're generated from the compiled library by printing each declaration. Changing this means implementing a new pretty printer and it's far from clear how that should behave.

@eric-wieser
Copy link
Member Author

Right - so this is presumably an issue in the pretty-printer and not the docs at all. Should this issue be moved to the lean repo?

@robertylewis
Copy link
Member

I don't think it's an issue. The pretty printer is doing what it's supposed to. Both of those terms are r • m (with different implicit arguments), what do you expect the pretty printer to do?

@eric-wieser
Copy link
Member Author

Perhaps show implicit arguments if they cannot be inferred unambiguously

@gebner
Copy link
Member

gebner commented Sep 28, 2020

I don't think there's anything we can realistically do to fix this in Lean 3. IIRC this will be fixed in Lean 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants