Re: Proposal: 6NF

From: vc <boston103_at_hotmail.com>
Date: 20 Oct 2006 22:25:22 -0700
Message-ID: <1161408322.548653.222160_at_i3g2000cwc.googlegroups.com>


Marshall wrote:
> On Oct 20, 1:52 pm, "vc" <boston..._at_hotmail.com> wrote:
> > Marshall wrote:
> > > On Oct 20, 3:12 am, "vc" <boston..._at_hotmail.com> wrote:
> > > > Marshall wrote:
> > > > > On Oct 19, 8:40 pm, "vc" <boston..._at_hotmail.com> wrote:
> > > > > > Marshall wrote:
> >
> > > > > > > > "return new ModFour((val+a.val)%4)" is called a bug or cheating
> > > > > > > > because you used a function defined on the entire domain NxN (where N
> > > > > > > > is a subset of the natural numbers implemented by the computer) to
> > > > > > > > generate a result which is undefined for the (2,3) pair.
> >
> > > > > > > It's not a bug, since the program produces the correct result, which is
> > > > > > > 1. It's not "cheating" because WTF does cheating even mean in
> > > > > > > this context. What it is, is the absence of closure over the subclass.
> > > > > > > Which is no big deal.
> >
> > > > > > So producing an absurd result is no big deal ? You seem to have agreed
> > > > > > that in the {2,3} subset there is no '1', how come your java
> > > > > > implementation manages to extract '1' out of nowhere ?
> >
> > > > > Consider the below function:
> >
> > > > > Let S4 = {0, 1, 2, 3}
> > > > > Let S23 = {2, 3}
> > > > > f : S23, S23 -> S4
> >
> > > > The binary operation over S23 is g:S23:S23 -> S23, your f does not
> > > > qualify. A common example is '+'.
> >
> > > > > f(2,2) = 0
> > > > > f(2,3) = 1
> > > > > f(3,2) = 1
> > > > > f(3,3) = 2
> >
> > > > > Your claim is what, exactly? That this is not a function? That
> > > > > it doesn't exist? That it's cheating? That it's invalidly defined
> > > > > because the result type is not the same as the types of
> > > > > both parameters?
> > > > It's not a binary opeartion that we've been talking about all along.
> > > > Did you read the reference I gave earlier or not ?
> >
> > > So we agree that my f does not meet the definition of binary operation.
> > OK.
> >
> > > Do we also agree that:
> >
> > > 1) f is a function
> > > 2) f exists
> > > 3) f is well-defined
> > > ?Yes.
> >
> > > Apparently you also think that f is "absurd." Can we take
> > > as a definition of "absurd" to be any function that is not of
> > > the type g:A,A->A? Because it seems to me that there
> > > are many such functions.
> > No, we can take as absurd the contention that addMod4 is a
> > binary operation over {2,3 } yielding 1.

>

> I beg your pardon, but I never said addMod4 was a binary
> operation over {2,3} and in fact above I specifically say
> that it is not. In fact, I've repeatedly said that it's not.

OK, I am sorry if I nisunderstood you.

> I have, however, asserted that it is closed over {0,1,2,3},
> which I believe you agreed with, and also that it's well-defined,
> but *not* closed, over the subset of the above that is {2,3},
> which you also agreed with.

I do not know what you mean by "well defined", but AM4:S23xS23->S23 is a partial function, while AM4:S23xS23->S0123 is indeed defined fo every element in S23xS23.

>AddMod4 is *not* closed

> over {2,3}, obviously and no one has ever said otherwise;
> since it is not closed it does not meet the strict definition
> of "binary operation" which mandates closure.

OK, so far so good.

> That
> does not mean it is somehow forbidden from being
> inherited. Do you think it does?

It's not forbidden but the inheritance makes little sense because what you inherit is structurally different -- it's not an operation anymore, instead of f:SxS->S, you inherit f:SxS->T. In other words, one would expect to get a subgroup, not just an amorphous set with some function. Your subthing is sructurallly different from the thing you inherited from. You would have had that for {0, 4}, but not for every subset of {0,1,2,3}.

>
>

> > > > > > > > At thispoint, it may be useful to recall what a function is and
> > > > > > > > apply the memory, if any, to the addMod4 operation.
> >
> > > > > > > Indeed. A function is a mapping from one set to another.
> > > > > > > In this case, the domain is pairs of values from {0,1,2,3}
> > > > > > > and the range is that same set. This particular
> > > > > > > function qualifies as a binary function, and also
> > > > > > > exhibits closure over the set {0,1,2,3}. Since {2,3} is a
> > > > > > > subset of {0,1,2,3}, the function is fully defined over
> > > > > > > that subset. However, since that function is not closed
> >
> > > > > > How can it be 'fully defined' over {2,3} and 'not closed' at the same
> > > > > > time ? What does (2,3) map to ? If you say to one, then you
> > > > > > exctract '1' out of nowhere again.
> >
> > > > > I don't understand this "out of nowhere" business. It's just
> > > > > a plain, regular number one. Nothing could be simpler.
> >
> > > > Where is '1' in {2,3} ?
> >
> > > It's not there, but so what? There's no sqrt(2) in there either;
> > > does that mean the sqrt function is absurd? Or am I simply
> > > not allowed to take the square root of values in {2,3}?
> > > What requires me to have *every* function have {2,3} as
> > > its range?
> > Your desire for any such function to be an operation over the
> > set in question.
>

> I have explicitly stated, several times, that addModFour() is
> a *function* over pairs from {2,3} and I have also explicitly
> stated that it is *not* a "binary operation" because that
> requires closure, and addModFour() is not closed over
> {2,3}. I am unclear what specifically you mean by the
> unadorned "operation" here; so far we have only used
> the terms "function" and "binary operation"; is "operation"
> an abbreviation for "binary operation?"

Yes, the operation is usually a synonym of the binary operation, as in '+', '-', etc.

>
>

> > > You ask "How can it be 'fully defined' over {2,3} and 'not closed'
> > > at the same time ?" It appears that you believe that for
> > > a function to be fully defined, it has to have its return type
> > > the same as its two argument types.
> > Your imagination is playing tricks on you -- I never said that, it was
> > not 'a function', but the specific addMod4 operation (which happens
> > to be a special kind of function of course). For that operation the
> > pair ((2,3), ..) does not exist which clearly means that the operation
> > is not defined for this element of S23xS23.
>

> But immediately above you agreed that my f function was
> a function and was well defined. The definition of f explicitly
> included the statement that
>

> f(2,3) = 1
>

> so it is demonstrably the case that for (2,3), f *does*
> exist. Your claim that f(2,3) does not exist is bizarre
> given that I explicitly included that in the definition of
> f which you agreed was a function.

The confusion stems from the fact that you are not careful with the function domains/codomains. There is no single addMod4, there is addMod4:S23xS23->S23 and addMod4:S23xS23->S0123 and S0123xS0123->S0123,  only the latter being an operation.

>

> Is this then all about the "operation-ness" of things? Everyone
> agrees that addModFour is not *closed* over the subset
> {2,3}, and hence everyone agrees that addModFour does
> not qualify as a "binary operation" over {2,3}, but it
> appears you are going further and saying that addModFour()
> somehow ceases to exist in the context of {2,3} because
> it isn't closed.

No, see above.

>
>

> > >Is closure required
> > > for a function to be defined? We agree that closure is
> > > required to meet the definition of "binary operation" but
> > > I'm asking about the more general definition of "function."
> > > (I claim that to qualify as a function something has to
> > > be well-defined.)
> > It would probably be prudent to ask at this point what you mean by "to
> > qualify as a function something has to be well-defined", but t's a nice
> > diversion that has nothing to do with the binary operation inheritance
> > discussion.
>

> Wait, what do you mean by "binary operation inheritance?" Is it
> your contention that inheritance only applies to functions that
> are binary operations in both the original class and also qualify
> as binary operations in the subclass?

Yes, the apparently should either preserve or lose binary operations in order to preserve the accepted understanding of what the mathematical structures like N, Z, Q etc. are.

>

> I am aware of inheritance as it is defined in, say, the Java
> Language Spec, but I cannot recall ever seeing any
> definition of inheritance that require both before and
> after closure.

The OOP definition, whatever it might be. is irrelevant if as a result of such definition you get something different from what it should be.

>
>

> > In any case, you can easily find out that a fucntion is
> > defined as a relation, mathematical, of course such that it uniquely
> > associates elements of one set with elements of some other set, or
> > possibly the same set.
>
> Sure, and addModFour() qualifies as a function.

Technically one of the addMod4's is a partial function but it's not important here.

>
>

> > > > > > We may tackle those issues later after we come to some agreement re.
> > > > > > the trivial stuff like functions and binary operations.
> >
> > > > > Okay. What is your definition of a function, then, and how
> > > > > does my f above stack up with regards to your
> > > > > definition?
> > > >
> > > > Your 'f' has nothing to do with the whole discussion of 'inheriting'
> > > > a binary operation from a type.
> >
> > > Why doesn't it?
> > >
> > Because your function ain't a binary operation derivable from the
> > supertype operation (see the definition of waht the operation is).
> > You've defined something different which is structurally different from
> > the supertype operation.
>

> It's *not* structurally different, though, it's still itself, and it's
> structurally
> identical to itself.

How can f:SxS->T be the same as f:TxT->T ? Clearly, it is not.

> And in fact it's a binary operation on the
> supertype
> but not a binary operation on the subtype. But we can certainly
> inherit it even though in the context of the subclass it doesn't
> possess closure.

That's the crucial point, we do not inherit 'it' which used to be an operation, we inherit something which is pretty useless because our group is not a group any more. This circumstance might not have mattered for home brewn classes, but it destroys the structure or adds unexpected propeties to the mathematical objects like N, Z, Q etc.

> My Java code showed exactly that: an
> inherited method with closure in the superclass but without
> closure in the subclass. The addModFour() in the subclass
> is *exactly* the addModFour() in the superclass; there is
> only one method definition, and only one set of bytecodes,
> for that method.

>

> Now, I would agree that the *relationship* between
> Four and Four.addModFour() is different than the
> relationship between TwoOrThree and
> TwoOrThree.addModFour(). However I would not
> agree that Four.addModFour() was different in
> any way, structurally or otherwise, from
> TwoOrThree.addModFour() because *they are
> the same method.*
>

See above.

>

> > >I already showed an example of working Java
> > > code in which a function is defined over pairs of ints mod 4,
> > > and that function is *inherited,* in the literal concrete Java Language
> > > Spec sense, by a subclass consisting of only the values {2, 3}.
> >
> > The specifc implementation is irrelevant, you might as well have just
> > used System.out.println(1).
>

> That would not have accurately modelled addModFour().
>
>

> > What is important is the fact that the
> > base type has a binary operation and the derived type does not have it
> > any more, instead you implemented a function which I hope by now is
> > clearly a different animal altogether.
>

> The base type has a method; the derived type has that
> exact same method. The method meets the definition of
> binary operation relative to the base class and does not
> meet the definition relative to the derived class. That doesn't
> mean that we failed to inherit it, or that inheritance only
> applies to binary operations.

It means that your lost the group structure with your inheritance model which is not very useful with math objects represented as classes although, I am ready to admit, might be useful with some application clases.

>
>

> > > Now, you called that "cheating" but I haven't heard your
> > > definition of cheating yet, so I'm unclear as to how to
> > > respond. I don't recall the word "cheating" being used
> > > in the JLS.
> > See above re. the S23xS23 -> S0123 function vs. the S0123xS0123 ->
> > S0123 operation.
>

> All that says is that it's not a binary operation because it lacks
> closure, which no one ever disputed.

See above.

>
>

> > > Again, the only problem here is your assertion that
> > > sets are inextricably bound to functions defined
> > > over them, in some OOPL (but not very mathematical)
> > > sense.
> >
> > Again, the above is pure fantasy of yours, I never said that.
> > The operations, on the other hand, are "inextricably bound to"
> > [...] some familiar sets
>

> Okay. If I understand you position correctly, you claim that
> sets are implicitly bound only to those functions defined over
> them that are binary operations, is that correct?
>
>

> > such as the set of natural
> > numbers with addition (or successor). Without the successor/addition
> > operation, calling the thing 'natural numbers' is as absurd as calling
> > addMod4 an operation over {2, 3}.
>

> Okay. So are you saying it's impossible to add two numbers drawn
> from the set {2,3}, or are you saying that you can add them, but
> in this case addition is not an operator?

Addition is not an operation here therefore you cannot do anything with the numbers without appealing to the larger set operation. You can of course define any function you want but the function will be an unrelated addon, not something like addition in N which is an intrinsic property of N

>
>

> > >The algebra books I have read (admitedly few
> > > in number) have always made a clear distinction
> > > between a set and algebraic structures that include
> > > a set with binary operations defined over the set.
> >
> > > I bet there's a relevant wikipedia article. Let's keep
> > > it simple:
> >
> > >http://en.wikipedia.org/wiki/Monoid
> >
> > > "A monoid is a set M with binary operation ∗ : M × M → M,
> > > obeying the following axioms: [associativity, identity]"
> >
> > > Here, an algebraic structure is defined as a tuple consisting
> > > of a set and a binary operation. It's not just the set itself;
> > > it can't be. This example is particularly telling to me, because
> > > we can immediately see that Z participates in (at least) two
> > > monoids: (Z, +) and (Z, *). So if I say "the monoid Z" I'm
> > > being appallingly imprecise; I *cannot* assume an implicit
> > > relationship between the set and its operations. While
> > > the definition of +:Z,Z->Z depends on the definition of Z,
> > > it is entirely *distinct* from it; the relation + is a set, and
> > > Z is a set, and they are two distinct sets; + is not an element
> > > of Z.
> > It does not matter whether you consider, for example, the natural
> > numbers as a primitive abstract objects with some intrinsic operations
> > or an algebraic structure satisfying the commutative monoid axioms. In
> > any interpretations, you will lose the addition operation when you
> > move to the subset of odd numbers for instance.
>

> What does it mean exactly to "lose the addition operation?" Does
> it mean we can't add odd numbers? If not, in what sense is it
> "lost?" I would agree that the odd numbers do not, for example,
> form a monoid with + or *; is that what you mean by "lost?"

I am not sure why it's so hrad to undestand that you cannot add odd numbers without going outside the set of odd numbers if you know what a group is. You cannot subtract arbitrary natural numbers either, that's why integers were invented.

>
>

> > Much less do they give one a license to
> > throw away existing mathematical object properties, where did that
> > come from ?
>

> You're the one talking about things being lost, not me.
>
>
>

> > Example :
> >
> > class Natural {
> > Rational '+' { .. return .. }
> >
> > }
> > class oddNatural extends Natural {
> > ...
> > }
> >
> > -- Assuming the language implements covariance (as Java 5 does):
> >
> > o, x =3, y =5 oddNatural;
> > n Natural;
> > ...
> >
> > o = x + y; -- makes sense
> >
> > z = x + y; -- does not make sense mathematically but is something the
> > programmer would expect
>
> I think something got mistyped here; did you mean to declare z?

Sorry for that, it should be:

Example :

class Natural {
  Rational '+' { .. return .. }

}

class oddNatural extends Natural {
...
 }

  • Assuming the language implements covariance (as Java 5 does):

o, x =3, y =5 oddNatural;
n Natural;
...

n = x + y; -- makes sense

o = x + y; -- does not make sense mathematically but is something the programmer would expect

> Perhaps you could re-enter this example? As it stands, it appears
> to me that you're saying that it "does not make sense mathematically"
> to add two odd natural numbers. However I have no confidence that
> that is what you mean.

>
>

> > > You're very hung up on the construction issue; it's not the only
> > > way of thinking about this. I agree that we can validly take
> > > that viewpoint; I also agree that we can take a type-theoretic
> > > approach and reach the same conclusion that 2 and 2.0 are
> > > not the same number. Those are valid conclusions when
> > > embedded within the appropriate theoretical framework.
> > > There also exist (fairly simple) set-theoretic frameworks
> > > under which 2 and 2.0 *are* the same number,
> >
> > Although that is correct up to a point, what framework do you have in
> > mind ?
>

> Well, you've repeatedly mentioned secondary school arithmetic;
> does that qualify?

 No it does not.

>I do not recall learning anything in secondary

> school which would suggest 2 and 2.0 were numerically different
> in any way. Nor can I think of any *arithmetic* way to distinguish
> between 2 and 2.0.

You have to construct all the real numbers and prove that 2 is an element of the set.

>
>
> Marshall
Received on Sat Oct 21 2006 - 07:25:22 CEST

Original text of this message