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

generalise nat_mod_one_l to nat_mod_lt #2139

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions theories/Spaces/Nat/Division.v
Original file line number Diff line number Diff line change
Expand Up @@ -437,15 +437,14 @@ Defined.
(** [n] modulo [0] is [n]. *)
Definition nat_mod_zero_r n : n mod 0 = n := idpath.

(** TODO: generalise for all small n *)
Definition nat_mod_one_l n : 1 < n -> 1 mod n = 1.
Definition nat_mod_lt n k : k < n -> k mod n = k.
Proof.
intros H.
destruct H; trivial.
destruct m.
1: contradiction (not_lt_zero_r _ H).
cbn; clear H.
by induction m.
lhs_V nrapply nat_div_mod_spec'.
rewrite nat_div_lt.
- rewrite nat_mul_zero_r.
apply nat_sub_zero_r.
- exact H.
Defined.

(** [n] modulo [1] is [0]. *)
Expand Down
Loading