On Wed, Mar 28, 2012 at 6:27 PM, Boyko Bantchev <boyk...@gmail.com> wrote: >>> (f∘g)(x) ≡ f(g(x)) >> >> Definitions do not eliminate ambiguity. > > Speaking of formal definitions, I would say they ought to. There is > not much use of defining formally and ambiguously.
And yet, f and g are not defined here, and neither are x. (And, for that matter, the grammar associated with parenthesis are not defined here.) Thus, formal definitions depend on the definitions of the symbols used in the definition. More generally, Mathematics deals with numerous definitions for the symbols it uses. There are numerous branches of mathematics, each with their own conventions for these definitions. >> One issue, here, is that the definitions of f, g and x are contextual. > > What do you mean by 'contextual'? I mean that, for example, the definition of x depends on the context where the phrase that contains x is used. My point was that a reference to "Mathematics" as a whole is not very satisfying. > Is it related to the above definition of ∘ (composition)? Because f, > g and x are just formal names there, locally bound within > the definition – none of them is a free variable, so there is > no context. In one context, x might be 1 In another context, x might be 2 In another context, x never be positive In one context, x might be a constant In another context, x might be a free variable In another context, x might be a function of f In another context, x might be the set R3 In another context, x might be a member of the set R3 ... These might seem to be trivial variations, but they are relevant when understanding the significance of a sentence which contains x. > (Expressed in plain language, the definition says the following: > composition (∘) of f on g, where f and g are any two functions such > that the domain of f includes the codomain of g, is a function which, > given any argument from the domain of g, returns the result of > applying f to the result of applying g to x.) Yes, and where x is in the domain of f∘g... And yet none of these statements were part of that "formal definition". >> A variant on this issue is >> that in the realm of general mathematics, a function that maps from A >> to B can also map from C to D. And, A and C might have a non-empty >> intersection and yet not have a subset relationship between them and >> composition might be valid for A and not C. > > How can a function have two different domains without being in fact > two different functions? Doesn't make sense to me. A domain is the set of argument values for which a function is defined. A function can have multiple definitions. These definitions do not need to conflict. How else can we talk about extending a function defined on integers to be a function defined on real numbers? >> All of these J phrases can be used to >> represent composition between functions represented by f and g, if f >> and g are verbs: >> f at g Note: this was an edit introduced by some mail software. I had written the symbol '@' here, and some unknown piece of software replaced that with ' at ' before relaying it to the mailing list. >> f@:g >> f&g >> f&:g >> ([: f g) >> f(g(x)) > > I assume that by 'f at g' you mean f@g ... Yes. > Now, not all of the above represent a composition. f@g and f&g, > in their monadic cases, are equivalent by definition, and are > compositions. f@:g and f&:g (in their monadic cases) are equivalent > but are not the composition of f on g; what they compose is the > results of changing (the ranks of) their arguments rather than the > arguments themselves. The same holds of [: f g (in its monadic case). No ranks are changed. The rank of the derived verb will sometimes be different, for different sentences. But whether this is a significant issue depends on the domain under consideration. >> Note also that that last phrase >> represents composition if x is a noun. It might also represent >> composition if x was an appropriate adverb (for example: x=:1 :'@u') > > In neither case is it a composition. If x is a noun, f(g(x)) does > not even represent a verb. Your formal definition did not require that a verb be produced. So why is this an issue now? > If x is an adverb, so that g(x) is a verb, then f(g(x)) is a hook > – again, not a composition. I do not know what you are talking about here. Here's from a J session. I am using & here so that I will not experience mail system corruption of the ascii character @ f(g(x)) f&g If f&g is composition then clearly f(g(x)) is composition. > We have to stick to the mathematical meaning of composition because > this is what the definition of functor depends on, and we were > discussing functors ... Except we seem to have new constraints appearing as new examples are introduced? >>> The domain of a composition operator are functions themselves, >>> not the data structures that are domains of those functions. >>> A 'composition' that has to do with data structures is anything >>> else but composition of functions. >> >> You seem to be saying that context is irrelevant. > > The context of what? In defining composition, I see no context at all. The context under consideration. This is the context that supplies definitions for the functions and which defines their domains. >> And, some operations can be performed efficiently in compiled >> haskell and are inefficient in interpreted haskell. > > Yes, but that is nothing to wonder at – the same can be said of > any language that admits both modes of execution. And it doesn't > necessarily mean that such a language, when interpreted, is slower > than a language which is only interpreted. Whichever is faster > would also depend, I guess, on the problem being solved, as well as > on the language constructs and programming techniques used in the > solutions. Well.. I downloaded and tested a Haskell interpreter yesterday, and I do have to admit that it behaved much better than previous interpreters that I had tried (years ago). Still, every language has to deal with time/space tradeoffs in some fashion, and some cases can be resource intensive, and some of those resource intensive cases can be made more efficient by expending resources at compile time. -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm