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

lean: Add missing arguments to rank #240

Merged
merged 3 commits into from
Oct 29, 2024

Conversation

eric-wieser
Copy link
Contributor

@eric-wieser eric-wieser commented Oct 28, 2024

Module.rank and finrank expect their first argument to be the ring that our module is over.

The invocations here are complete nonsense, and are talking about equalities between functions on possible (highly non-canonical) ring structures on the provided module.

A proof that this is nonsense can be found in https://github.com/leanprover-community/mathlib4/blob/1a36b1f1a21015cb61e376416b2247e627c1b4ed/Mathlib/tmp.lean#L27-L28, which states:

theorem module_rank_eq_natCast_iff {R : Type u} (n : Nat) :
    Module.rank.{u,max u v} R = n ↔ IsEmpty R ∨ (Subsingleton R ∧ n = 1)

i.e. "if you claim the mispelled-rank is any natural number, you are claiming that the ring is trivial". (Strictly speaking the max u v makes this theorem not apply here, but you would have to truly be desperate to come to that for help)

Copy link
Contributor

@ocfnash ocfnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes, this is terrifying. Nice catch.

Copy link
Collaborator

@GeorgeTsoukalas GeorgeTsoukalas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes! Thanks for spotting this.

@GeorgeTsoukalas GeorgeTsoukalas merged commit f92464e into trishullab:main Oct 29, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

3 participants