Skip to content

Add divisibility, primes, congruence and factorial - #565

Open
d-morrison wants to merge 13 commits into
mainfrom
claude/project-thread-aj2ep4
Open

d-morrison wants to merge 13 commits into
mainfrom
claude/project-thread-aj2ep4

Conversation

@d-morrison

@d-morrison d-morrison commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

This is the first PR in the mds/mcs consolidation that Ezra approved on 2026-11-02. It moves four general definitions out of the mcs CSCI 201 notes and into mds, and adds an example after each one. A later mcs PR will include them from here.

The floor function and the logarithm to base b were split out into Morrison-Lab/mds#566 to keep this PR under the size cap.

What changes

All of the definitions below go on the number-systems page.

  • def-factorial and exm-factorial. The factorial is defined for non-negative integers, and the definition states that 0! = 1, which the mcs version left undefined.
  • A new section, "Divisibility, primes and congruence", holds def-divides, def-prime and def-congruence, each followed by an example.
  • The intro remark lists the new definitions.
  • references.bib gets three Wikipedia entries copied from mcs.

The ids are the same as in mcs, so existing links in mcs keep working once mcs switches to these includes.

Two mcs theorems are held back for a follow-up: infinitely many primes, and √2 is irrational. Their proofs cite mcs remarks and an mcs exercise solution, so those have to move first.

Checks

  • number-systems.qmd renders to HTML with no warnings.
  • check-term-links, check-new-line-breaks and check-exm-figures pass locally against origin/main.

🤖 Generated with Claude Code

https://claude.ai/code/session_019xfc9pMBq15Hq3DgNBx1ox

These six definitions were local to the mcs course notes (CSCI 201).
They are general number facts, so they move here and mcs will include
them from mds, as the consolidation plan for mds and mcs approved on
2026-11-02 sets out. The ids match the mcs ones (def-divides, def-prime,
def-congruence, def-factorial, def-floor, def-logarithm), so links into
mcs keep working.

The logarithm sits on the algebra page after the real power it uses;
the rest go on the number-systems page, with a new Divisibility section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9pMBq15Hq3DgNBx1ox
Review of the first commit found that the factorial was undefined at 0,
which binomial coefficients need, and that the logarithm did not say its
value exists and is unique. Also renames the section to cover primes and
congruence, and makes the page intro say which numbers each applies to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9pMBq15Hq3DgNBx1ox
check-term-links flagged unlinked first uses of integer, prime, factorial,
floor, real number, natural numbers and base. Rewords two sentences whose
words (exists, product) match unrelated defined terms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9pMBq15Hq3DgNBx1ox
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

…mark

The review asked for an example after each new definition, as the lab's
content rules require. Floor and logarithm get R figures; the single-value
examples carry no-figure notes. The uniqueness of log_b x now has its own
remark with the derivation from the natural logarithm, and the long lines
are split at clause boundaries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9pMBq15Hq3DgNBx1ox
The branch went over the PR size cap; the logarithm is a separate concern
on a separate page, so it moves to its own branch and PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9pMBq15Hq3DgNBx1ox
@d-morrison d-morrison changed the title Add divisibility, primes, congruence, factorial, floor and log base b Add divisibility, primes, congruence and factorial Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Here is how each point from the review was handled. The new head is 6b02717.

  1. Missing examples: fixed. Every new definition in this PR is now followed by an #exm- div. Each one lists single values, so it carries a no-figure note.
  2. Semantic line breaks: fixed. _def-factorial.qmd now breaks at each clause, and the intro remark was rewritten. The floor and logarithm lines the review cited moved to #566, where they are also split.
  3. Two terms in one div: kept as written. The review itself calls this borderline. ∤ and ≢ are notation for the negation of the relation the div defines. They are not separate terms, so they stay in that relation's div.

Suggestions:

  • Logarithm uniqueness: handled in Add the floor function and the logarithm to base b #566, where rem-logarithm-formula derives log_b x = ln x / ln b.
  • Linking the empty-product convention: not done. mds has no definition of an empty product to link to, so the one sentence states the convention instead.
  • Adding composite numbers: not done, because it would be a new term with nothing in this PR that uses it.

The floor and the logarithm moved to #566 to keep this PR under the size cap.

Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

The review asked for semantic line breaks in the prime and congruence
definitions; the divides definition had the same pattern.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9pMBq15Hq3DgNBx1ox
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

# Conflicts:
#	_number-systems.qmd
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
🚀 Preview available at: https://Morrison-Lab.github.io/mds/pr-preview/pr-565/

Built to branch gh-pages at 2026-11-03 00:06 UTC.

gha v3 now flags "term (@Def-x)" on added lines (gha#1402). Each of the
seven flagged lines in the number-systems subfiles now links the term itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9pMBq15Hq3DgNBx1ox
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Claude finished review — View run


Re-reviewed e3de9b6, the only new commit since d8d27665. It replaces trailing (@def-...) crossrefs with linked terms in seven number-systems subfiles. I found no issues.

  • Anchors: every link target exists. #def-divides, #def-nonnegative-integers, #def-positive-integer, #def-integers, #def-congruence, #def-prime and #def-factorial are each defined in a subfile.
  • Math: the changed math lines only rearrange wording around existing \mid, \equiv and \factorial{} notation. They add no literal-letter, raw-operator or hat/tilde violations. The macro check does not apply to this diff beyond that.
  • Prime definition: the old and new wording are equivalent. "No positive integer other than 1 and n divides it" is the same as "its only positive divisors are 1 and n". The new wording also links "positive integer" and "divides" at first use in the div.
  • Semantic line breaks: each changed prose line holds at most one clause, or a short appositive such as ", written $n \mid (a - b)$,". I did not find a clause-level violation.
  • Scope: only the crossref style changes. No ids moved, no content was added, and no generated files were touched.

The prior verdict, from the 2026-11-03T00:08 review of d8d27665, still stands.

Verdict

Ready for merge.

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "e3de9b66603670c5e1dd6bfebef4443a5c2d9f6f",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Seven number-systems subfiles swap trailing (@def-id) crossrefs for linked terms; every target id (divides, integers, positive-integer, nonnegative-integers, congruence, prime, factorial) is defined, and the prime definition wording is logically equivalent.",
  "holistic_assessment": "The change is scoped to crossref style, preserves ids and meaning, adds no math or generated-file changes, and does not alter the earlier clean verdict."
}

Reviewed commit: e3de9b6

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

💰 Cost: $0.1907 (review) — run

This branch has not been deployed

No deployments
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.

2 participants