coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: "jonikelee AT gmail.com" <jonikelee AT gmail.com>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Not enough information to resolve this refine goal
- Date: Wed, 30 Sep 2020 14:52:40 -0400
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jonikelee AT gmail.com; spf=Pass smtp.mailfrom=jonikelee AT gmail.com; spf=None smtp.helo=postmaster AT mail-qv1-f44.google.com
- Ironport-phdr: 9a23:47ID1BypwYYuX4fXCy+O+j09IxM/srCxBDY+r6Qd2+MTIJqq85mqBkHD//Il1AaPAdyErakewLOM7+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglVhjexe71/IAu5oQnMqMUbjpZpJ7osxBfOvnZGYfldy3lyJVKUkRb858Ow84Bm/i9Npf8v9NNOXLvjcaggQrNWEDopM2Yu5M32rhbDVheA5mEdUmoNjBVFBRXO4QzgUZfwtiv6sfd92DWfMMbrQ704RSiu4qF2QxLulSwJNSM28HvPh8J+jKxVvg+vqR99zI7aZ4+aO+ZxcKzGcNMGR2dMRNpdWjZdDo+iaYYEEuoPPfxfr4n4v1YCoxm+BQ6qBOPuyT9HmHv20rMk3Ok6HgHG2RYvH9MKsHjOsNr1M6ISXe6ox6TPzzXDaPVW2Tb+6IfWdhAuv++DUKl/ccrU00YvFgfFgk+MpoziOjOYz+IAuHWU4OR8T+ygkXInqx1vrTi1wMchkpXFi40IxlzZ6yh0wIU4KN63RUNlb9CpH5Veui+UOodoTM4vQ3xltTs6xLAIpJK2YiYExYokyhDRb/GJc4iG7xHlWe2MIjl4nGpodKyjixu260Stye3xWtOq3FpXqidJiNbBu38V2xDN68WLVuZx80K81TuLyw/e7+5JLEEomabHLpMszKA/m5oWvEjeESL6hFv5gaqUe0gn9Oio5eHqYrv4qZKTN4J5jwDzPbozlsOiB+kzLxIAUHKB+eum0b3u5U35T6tOjv0xiqTZtYrVJcUfpqKgGg9VzJsv5w+xDzqp39kUh3YHLFVCeBKIi4jmJUvCL+z/Dfe6m1iskTFryO7aPrD5HJnBMnzOnK3icLt98UJQ1hc/wNRF659bBbwNOPfzVVXwtNzcAB85KQu0w+P/BdV/0YMeX2OPAqyHP6PWr1CH+PkiI+aJZIAPuTb9L+Ip6OLpjX88gVMdZ7Wm3YMLaHCkGfRrO1mWYX31gtsYDWgKuhc+Q/fxhV2ZUT9TYm6yULgm6jE6DoKmF4bDSZq3jLyPxifoVqFRM2tBExWHFWriX4SCQfYFLiyIceF7lTlRH7qmTY4i2BWjuSf1zrNmKqzf/ShS/cbh09505ODXmBwa+jl9DsDb2GaIGTIn1lgUTiM7ifgs6Xd2zU2OhPAh0q5oUOdL7vYMaT8UcJvVzuh0Edf3A1uTcdKASVLgSdKjU2hoEoABhuQWakM4IO2MywjZ1nPzUbAQnr2PQpcz9/CEhiWjF4NG03/DkZIZoRwmT89IbzD0g6d+803KGdeMnRnF0amtcqsY0WjG82LRlWc=
That fixpoint fromList is not going to be structurally recursive as it
is defined, even if you do solve its remaining subgoals. I would
suggest this alternative:
Fixpoint fromList (l : list A)(lgt0 : length l > 0) :nonEmpty A.
If you still really need to have a single arg version of fromList that
takes a sigma type, my suggestion is to define it in terms of the above
alternative.
On Wed, 30 Sep 2020 13:21:49 -0500
Agnishom Chattopadhyay <agnishom AT cmi.ac.in> wrote:
> I am trying to write a function whose argument type is a sigma type.
> Here are some details.
>
> Inductive nonEmpty (A : Type) : Type :=
> | singleton : A -> nonEmpty A
> | consNE : A -> nonEmpty A -> nonEmpty A.
>
> Arguments singleton {A}.
> Arguments consNE {A}.
>
> Section NonEmpty.
>
> Variable A : Type.
>
> Fixpoint toList (l : nonEmpty A) :=
> match l with
> | singleton x => (cons x nil)
> | consNE x xs => (cons x (toList xs))
> end.
>
> Fixpoint fromList (l : {l : list A | length l > 0}) : nonEmpty A.
> refine (match (proj1_sig l) with
> | nil => _
> | (cons x nil) => singleton x
> | (cons x xs) => consNE x (fromList (exist (fun xs =>
> length xs
> > 0) xs _))
> end).
>
> Now, how do I solve these goals? For the first one, I want to show a
> contradiction, saying that (proj1_sig l) couldn't have been nil,
> given that we know that length ((proj1_sig l)) > 0. However, the
> equation (proj1_sig l) = nil is not present in the context. It is
> very similar in the case of the other hole as well.
>
> --Agnishom
- [Coq-Club] Not enough information to resolve this refine goal, Agnishom Chattopadhyay, 09/30/2020
- Re: [Coq-Club] Not enough information to resolve this refine goal, jonikelee AT gmail.com, 09/30/2020
- Re: [Coq-Club] Not enough information to resolve this refine goal, Maximilian Wuttke, 09/30/2020
- Re: [Coq-Club] Not enough information to resolve this refine goal, Maximilian Wuttke, 09/30/2020
- Re: [Coq-Club] Not enough information to resolve this refine goal, Agnishom Chattopadhyay, 09/30/2020
- Re: [Coq-Club] Not enough information to resolve this refine goal, Maximilian Wuttke, 09/30/2020
- Re: [Coq-Club] Not enough information to resolve this refine goal, Agnishom Chattopadhyay, 09/30/2020
- Re: [Coq-Club] Not enough information to resolve this refine goal, Maximilian Wuttke, 09/30/2020
- Re: [Coq-Club] Not enough information to resolve this refine goal, Maximilian Wuttke, 09/30/2020
- Re: [Coq-Club] Not enough information to resolve this refine goal, Maximilian Wuttke, 09/30/2020
- Re: [Coq-Club] Not enough information to resolve this refine goal, jonikelee AT gmail.com, 09/30/2020
Archive powered by MHonArc 2.6.19+.