*To*: cl-isabelle-users at lists.cam.ac.uk*Subject*: Re: [isabelle] [isabelle-dev] Partial functions*From*: Christian Sternagel <c.sternagel at gmail.com>*Date*: Fri, 25 Oct 2013 16:01:40 +0900*In-reply-to*: <526A10E9.50301@gmx.com>*References*: <DUB124-W34753CEAC4B5C9BEBFCF9B8FA90@phx.gbl> <DUB124-W45D4B252949F10C4E01E678FA90@phx.gbl> <519CAFA1.8040804@inf.ethz.ch> <526A10E9.50301@gmx.com>*User-agent*: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

How about unfolding the definition of "f"? Then it should work, e.g., as follows definition f :: "nat ⇒ nat option" where "f x = (if x ∈ {1, 2, 3} then Some 0 else None)" lemma "dom f = {1, 2, 3}" by (force simp: f_def dom_def) cheers chris On 10/25/2013 03:34 PM, Gottfried Barrow wrote:

On 5/22/2013 6:44 AM, Andreas Lochbihler wrote:For example, definition f :: "nat => nat option" where "f x = (if x : {1,2,3} then Some .... else None)" Then, "dom f" returns the domain of f as {1,2,3} and "ran f" the range of f. There are a few more operations defined in theory Map, in particular map_of. Option.bind in theory Option is used for function composition.On 5/22/2013 6:50 AM, Manuel Eberl wrote:You can find out the domain/range of such a partial function using dom and ran. For instance, "dom f" is defined as {a. f a ≠ None}.I was looking at how to do a partial function with option, so I was looking at this old email thread. The two statements above make it sound like it should be easy to get "dom f = {1,2,3}". I do this: theorem "(dom f) = {1,2,3}" apply(unfold dom_def) And I get a goal: "{a. f a ≠ None} = {1, 2, 3}", with no easy automatic proof. Is there something simple I'm supposed to do get "(dom f) = {1,2,3}"? Thanks, GB

**Follow-Ups**:**Re: [isabelle] [isabelle-dev] Partial functions***From:*Gottfried Barrow

**References**:**Re: [isabelle] [isabelle-dev] Partial functions***From:*Gottfried Barrow

- Previous by Date: Re: [isabelle] [isabelle-dev] Partial functions
- Next by Date: Re: [isabelle] 2013-1-RC1: how to put generated Scala into a package without using code_include?
- Previous by Thread: Re: [isabelle] [isabelle-dev] Partial functions
- Next by Thread: Re: [isabelle] [isabelle-dev] Partial functions
- Cl-isabelle-users October 2013 archives indexes sorted by: [ thread ] [ subject ] [ author ] [ date ]
- Cl-isabelle-users list archive Table of Contents
- More information about the Cl-isabelle-users mailing list