Skip to Content.
Sympa Menu

coq-club - [Coq-Club] merging functions over disjoint domains

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] merging functions over disjoint domains


Chronological Thread 
  • From: Jonas Oberhauser <s9joober AT gmail.com>
  • To: "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: [Coq-Club] merging functions over disjoint domains
  • Date: Tue, 26 Apr 2016 14:19:17 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=s9joober AT gmail.com; spf=Pass smtp.mailfrom=s9joober AT gmail.com; spf=None smtp.helo=postmaster AT mail-yw0-f169.google.com
  • Ironport-phdr: 9a23:G/9H/BA03e/hGqtH5sSEUyQJP3N1i/DPJgcQr6AfoPdwSP79p8bcNUDSrc9gkEXOFd2CrakU26yJ4uu8ACQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTnkb/jsMGKKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46FppIZ8VvCwdKMhCLdcET4OMmYv5cStuwOJBV+E4WJZWWELmDJJBRLE5Vf0RMGinDH9s79f3y+TJoXRR70uWT2/9KpxAEvz2SUAMDQ06knYj8VxiORQpxf39E83+JLdfIzAbKk2RajaZ95PHWc=

I have a set M and two subsets of M,  N,N'.
I have functions in dependent products over N,N', that agree on the codomain,
f : forall n : N, X n
f' : forall n : N', X n
Where X : M -> Type

When the two subsets are disjoint, I want to merge these functions:

merge f f'  :  forall n : N union N', X n

In set theory, merge is simply the union, but one might do extra work and define
merge f f' n = if n : N then f n else f' n

What would be the best way to formalize this whole thing in Coq?
I have thought about using predicates in the domain, (f : forall n : M, P n -> X n) but this has problems (P needs to be decidable because of the elim restriction, and one has to work with PI). I have also thought about putting the partiality into the codomain (f : forall n : M, X n * P n + ~ P n), but that again assumes decidability of P and I need to deal with the second case all the time. If I have a decider for P, I might as well descruct it in the return type (if dec P n then X n else unit).
Are there better solutions, in particular ones that do not need decidability of P?

Best wishes and a lot of fun,
jonas



Archive powered by MHonArc 2.6.18.

Top of Page