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

Refactor elementary number theory #1211

Draft
wants to merge 68 commits into
base: master
Choose a base branch
from

Conversation

EgbertRijke
Copy link
Collaborator

@EgbertRijke EgbertRijke commented Oct 25, 2024

The biggest changes come from a change in the definition of the quotient of a divisible natural number. The updated definition defines the quotient of n by d, provided that d | n is the unique natural number q ≤ n such that q * d = n. This change prevents some case analyses around the situation where the Curry-Howard interpretation of divisibility is not a proposition. An alternative definition of divisibility is also given: bounded divisibility. This is always a proposition. The poset of the natural numbers by divisibility is updated to use bounded divisibility in favor of propositional truncation.

The change in the definition of the quotient by divisibility triggered changes in the fundamental theorem of arithmetic, which is thoroughly revised after discovering that the strong induction that we previously used was unnecessarily complicated.

New files include:

  • Bounded divisibility
  • Irrationality of the square root of 2
  • Lists of prime numbers
  • Multiplicative decompositions of natural numbers
  • Nicomachus's Theorem
  • Nontrivial divisors of natural numbers
  • Number of divisors
  • Parity of integers
  • Pronic numbers
  • Square pyramidal numbers
  • Unit integers
  • Unit similarity integers
  • Well-ordering principles of the integers
  • Dependent lists
  • Elementhood relation on lists
  • Universal quantification on lists

@fredrik-bakke
Copy link
Collaborator

fredrik-bakke commented Oct 27, 2024

Cool! I'll wait to submit the 100-theorems list to Freek until after this PR is merged :) #1203

@fredrik-bakke
Copy link
Collaborator

Are you still planning to formalize the irrationality of 2 as part of this PR?

@EgbertRijke
Copy link
Collaborator Author

Are you still planning to formalize the irrationality of 2 as part of this PR?

Yes, definitely.

I want to do it well, improving the infrastructure for divisibility of integers and setting up infrastructure for parity of integers. My changes to the divisibility of natural numbers led me to refactor a bunch of definitions depending on it, but at the end of this formalization in elementary number theory should feel a lot less ad-hoc.

@fredrik-bakke
Copy link
Collaborator

That's very nice. This namespace is well-deserving of some love and attention!

@EgbertRijke
Copy link
Collaborator Author

I'm teaching a course on elementary number theory this semester, and I want to formalize some of it as I go.

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

Successfully merging this pull request may close these issues.

2 participants