Zulip Chat Archive
Stream: new members
Topic: help with proof strategy to show a mod b is unique
rzeta0 (Feb 11 2025 at 16:30):
I've been struggling with an MoP exercise and specifically struggling with the Lean aspects.
So I thought I'd get some sleep, and start afresh at the overall proof strategy.
If the proof strategy is sensible, then I'll be justified in struggling with the Lean implementation,
I'd welcome thoughts on the following proof strategy:
Task:
Let and be integers, with . Let and be integers, both in the range , and both congruent to modulo . Show that they are equal.
Strategy:
-
Definitions tell us , and for some integers .
-
Algebra gives us , re-arranged to the more useful .
-
We have 3 cases: , , . So this is a proof by cases.
-
Since, by definition, and are both less than , then LHS has magnitude less than 1. The RHS must be an integer, and so the LHS can only be zero.
That is, two of the three cases have been ruled out, leaving only .
I think the "upcasting" to show the fraction must have magnitude less than 1 might be a challenge for me.
Dan Velleman (Feb 11 2025 at 20:20):
Here's a strategy that avoids cases: Show that . Then, since you have , you can conclude . Deduce from this that . But is an integer, so it must be 0.
There is a proof similar to this in Section 7.3 of of How To Prove It with Lean.
rzeta0 (Feb 11 2025 at 20:32):
Thanks Dan - I will study this approach.
I was running into errors associated with division, so avoiding even division will be good too.
failed to synthesize instance
HDiv ℤ ℤ ?m.163069
Aaron Liu (Feb 12 2025 at 00:21):
You should convert to Rat
before introducing division, since dividing integers has rounding.
Dan Velleman (Feb 12 2025 at 00:27):
...Or avoid division altogether by looking for a theorem about canceling b from both sides of an inequality.
Ruben Van de Velde (Feb 12 2025 at 08:48):
There's lemmas like this, for example:
@loogle ?b * ?c < ?b
loogle (Feb 12 2025 at 08:48):
:search: lt_one_of_mul_lt_right, mul_lt_of_lt_one_right', and 4 more
Last updated: May 02 2025 at 03:31 UTC