Possible wrong hint in part1.Relations exercise Bin-predicates
First of all, thanks for writing and making the book available. I am learning Agda from it, and I think it's great.
I believe there is a mistake in the hint for the exercise Bin-predicates in part1.Relations. It says
you may need to prove that 1 is less or equal to the result of
from b
but 1 is greater than from (⟨⟩ O) which satisfies from (⟨⟩ O) ≡ 0. Is there something I am not seeing here? Thanks again.
Thank you for the kind words, and for bringing up the issue. According to my records, Jeremy Siek added that phrase. I've written to him to ask why. I agree, it looks wrong to me; inequality is irrelevant to that exercise.
Since my point was not the irrelevance of inequality to that exercise -- my proof used the fact that binary strings which start with a one are greater than zero
zero-<-from-one : ∀ (bin : Bin)
→ One bin
-------------
→ 0 < (from bin)
to-suc-n-2-O : ∀ (n : ℕ)
→ 0 < n
---------------------
→ to (n + n) ≡ (to n) O
-- I am now curious about how to prove the exercise without inequality; maybe it was the hint's suggestion that led me to that path. I don't know whether this is the appropriate place to ask, nor if it is too much to ask, but could you illustrate how to do it without inequality?
I think this was fixed in 8ef93f790bdc17c487972b0054e0369d55861a6f:
Also, you may need to prove that if
One bthen1is less or equal to the result offrom b.
Your theorem is responsive to the hint, it seems to me. For what it's worth, I also used similar inequality theorems.
I think this was fixed in 8ef93f7
I agree, and I am closing the issue because of that. Thanks for the update.