Open jaewooklee93 opened 9 years ago
I believe this link should be helpful: https://coq.inria.fr/library/Coq.Init.Specif.html
However, this kind of machinery, called dependent types, is known to be hard to deal with in Coq. I would rather prefer define a total function f:nat->nat
, and apply f
only to sub-n
elements.
Jeehoon
Okay, I understand. Then if I want to prove that every function f:{0,1,..,m}->{0,1,...,n} is not injective (one-to-one) if n<m, should I formalize the proposition like this?
Theorem pigeonhole_principle_constructive:
forall (f:nat -> nat) m n, S n <= m ->
(forall x, x <= m -> f x <= n) ->
exists i, exists j, i <= m /\ j <= m /\ i <> j /\ f i = f j.
Proof.
Thank you. Jaewook Lee
That makes sense to me, but it would be equivalently good (or slightly better) to restrict I and j to be less than n.
Ah, sorry; your version already restricts them to be less than m, the (designated) domain of the function. My comment was wrong!
You're right. In the first posting, I missed to put the bound for i
, j
, but I also found that error immediately after the posting, so I changed that. I am sorry to confuse you.
By the way, I proved that theorem pigeonhole_principle_constructive
, finally, but the proof is really really long due to the many inequalities in the proposition.. it takes even 400 lines of tactics...
Jaewook, this shows you why the life of a constructivist is hard. But, I think there might be a way to simplify your proof script. If you are interested, just send me your proof script.
@gilhur I sent you my proof script. Thank you very much.
May I ask if there is any progress on this issue?
I think this issue is completely solved, but I've left it open until now because the Professor answered it :)
It is just a short question. I'm working with the function looks like
exists (f:nat->nat),
.While the domain of
f
is all natural number, I want to restrict its domain to the natural number smaller thann
.{0,1,2,...,n-1}
Is there any simple way to construct a subset of the
Set
we already have?