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

feat(algebra/euclidean_domain): lcm #665

Merged
merged 1 commit into from
Feb 2, 2019
Merged

feat(algebra/euclidean_domain): lcm #665

merged 1 commit into from
Feb 2, 2019

Conversation

kckennylau
Copy link
Collaborator

TO CONTRIBUTORS:

Make sure you have:

  • reviewed and applied the coding style: coding, naming
  • for tactics:
  • make sure definitions and lemmas are put in the right files
  • make sure definitions and lemmas are not redundant

If this PR is related to a discussion on Zulip, please include a link in the discussion.

For reviewers: code review check list

variables [decidable_eq α]

def lcm (x y : α) : α :=
if gcd x y = 0 then 0 else x * y / gcd x y
Copy link
Member

Choose a reason for hiding this comment

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

Isn't the if statement unnecessary? I thought division was defined to work like this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, 0/0 is 1.

Copy link
Member

Choose a reason for hiding this comment

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

If that's true, then how can (/) be the quotient argument for euclidean_domain int? I'm pretty sure that 0 / 0 : int is 0.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We're both wrong: 0/0 is undefined. See zulip.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@kckennylau kckennylau closed this Feb 1, 2019
@ChrisHughes24 ChrisHughes24 merged commit 6925e4d into master Feb 2, 2019
cipher1024 pushed a commit that referenced this pull request Feb 8, 2019
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.

None yet

3 participants