{"action":"created","issue":{"url":"https://api.github.com/repos/ekmett/algebra/issues/16","repository_url":"https://api.github.com/repos/ekmett/algebra","labels_url":"https://api.github.com/repos/ekmett/algebra/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/ekmett/algebra/issues/16/comments","events_url":"https://api.github.com/repos/ekmett/algebra/issues/16/events","html_url":"https://github.com/ekmett/algebra/pull/16","id":200290331,"number":16,"title":"Document `mult`","user":{"login":"Rufflewind","id":6571068,"avatar_url":"https://avatars.githubusercontent.com/u/6571068?v=3","gravatar_id":"","url":"https://api.github.com/users/Rufflewind","html_url":"https://github.com/Rufflewind","followers_url":"https://api.github.com/users/Rufflewind/followers","following_url":"https://api.github.com/users/Rufflewind/following{/other_user}","gists_url":"https://api.github.com/users/Rufflewind/gists{/gist_id}","starred_url":"https://api.github.com/users/Rufflewind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rufflewind/subscriptions","organizations_url":"https://api.github.com/users/Rufflewind/orgs","repos_url":"https://api.github.com/users/Rufflewind/repos","events_url":"https://api.github.com/users/Rufflewind/events{/privacy}","received_events_url":"https://api.github.com/users/Rufflewind/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-01-12T06:40:25Z","updated_at":"2017-01-13T00:07:02Z","closed_at":"2017-01-12T13:06:32Z","pull_request":{"url":"https://api.github.com/repos/ekmett/algebra/pulls/16","html_url":"https://github.com/ekmett/algebra/pull/16","diff_url":"https://github.com/ekmett/algebra/pull/16.diff","patch_url":"https://github.com/ekmett/algebra/pull/16.patch"},"body":"This is based on my reading of the quaternion implementation.  If this is correct, is there perhaps a cleaner way to express this?"},"comment":{"url":"https://api.github.com/repos/ekmett/algebra/issues/comments/272323529","html_url":"https://github.com/ekmett/algebra/pull/16#issuecomment-272323529","issue_url":"https://api.github.com/repos/ekmett/algebra/issues/16","id":272323529,"user":{"login":"ekmett","id":304657,"avatar_url":"https://avatars.githubusercontent.com/u/304657?v=3","gravatar_id":"","url":"https://api.github.com/users/ekmett","html_url":"https://github.com/ekmett","followers_url":"https://api.github.com/users/ekmett/followers","following_url":"https://api.github.com/users/ekmett/following{/other_user}","gists_url":"https://api.github.com/users/ekmett/gists{/gist_id}","starred_url":"https://api.github.com/users/ekmett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekmett/subscriptions","organizations_url":"https://api.github.com/users/ekmett/orgs","repos_url":"https://api.github.com/users/ekmett/repos","events_url":"https://api.github.com/users/ekmett/events{/privacy}","received_events_url":"https://api.github.com/users/ekmett/received_events","type":"User","site_admin":false},"created_at":"2017-01-13T00:07:02Z","updated_at":"2017-01-13T00:07:02Z","body":"It is a good starting intuition for the enumerable cases, but x really\ndoesn't have to be enumerable.\n\nThat sum can be much less well defined than the actual cases that arise in\npractice. Nothing requires us to be able to draw from x or that the sums be\nfinite. You can get this in many ways, e.g. using your notation, by c i j k\nbeing very sparse and knowing the shape of that pattern rather than\nenumerating all of x and summing over the result, etc.\n\nx can be a vector space in its own right. (y -> r) -> r with a constraint\nthat the outer function is linear is a way to model covectors for instance.\nThe things we can do with this Cont like monad are quite handy. All the\nmonad combinators, etc. correspond to doing things like currying/tensoring\nvector spaces, etc.\n\nOn Thu, Jan 12, 2017 at 6:14 PM, Phil Ruffwind <notifications@github.com>\nwrote:\n\n> Shouldn't you comment / document the particular instance, not the class?\n>\n> I was trying to come up with a more general interpretation.\n>\n> In this representation most of the math for the properties of such a\n> bilinear form follows automatically.\n>\n> OK, that helped clear things up. Maybe that should be added to the docs?\n>\n> I still think interpreting them as structure constants is useful since\n> that establishes a link between the your abstract definition of an algebra\n> vs the more traditional presentation, even if it's not fully general.\n> ------------------------------\n>\n> Let me see if I can elaborate this a bit. The structure constants c are\n> defined by the relationship:\n>\n> i × j = ∑[c i j k ⋅ k | k ← x]\n>\n> where i and j are basis vectors and x is the basis. In Haskell, I would\n> perhaps render this as:\n>\n> mult' (delta (i, j)) == \\ k -> c i j k\n>\n> where for convenience I defined\n>\n> mult' :: ((x, x) -> a) -> x -> a\n> mult' f k = mult (uncurry f) k\n> -- | Kronecker deltadelta :: x -> x -> a\n> delta e e'\n>   | e == e'   = one\n>   | otherwise = zero\n>\n> From here, the bilinear product (×) is given by (this might be useful to\n> include in the documentation too):\n>\n> v1 × v2 = mult' (v1 ⊗ v2)\n>\n> where (⊗) is the outer product:\n>\n> (⊗) :: (x -> a) -> (x -> a) -> ((x, x) -> a)\n> v1 ⊗ v2 = \\ (i, j) -> v1 i * v2 j\n>\n> To ensure bilinearity, I figure mult' has to be linear too (right?):\n>\n> mult' ((+) <$> v1 <*> v2) == (+) <$> mult' v1 <*> mult' v2\n> mult' ((s *) <$> v) == (s *) <$> mult' v\n>\n> Now suppose I apply mult to some arbitrary vector f, which I decompose\n> into some linear combination of the basis elements:\n>\n> f = ∑[f i j ⋅ i × j | i ← x, j ← x]\n>\n> This should always be possible (by virtue of being a basis). Translating\n> this into Haskell:\n>\n> f == \\ i' j' -> sum [f i j * delta (i, j) (i', j') | i <- x, j <- x]\n>   == liftedSum [(f i j *) <$> delta (i, j) | i <- x, j <- x]\n>   where liftedSum = foldr (liftA2 (+)) (pure zero)\n>\n> If I use the linearity laws for mult', then I get:\n>\n> mult' f\n>   == mult' (liftedSum [(f i j *) <$> delta (i, j) | i <- x, j <- x])\n>   == liftedSum [(f i j *) <$> mult' (delta (i, j)) | i <- x, j <- x]\n>   == liftedSum [(f i j *) <$> (\\ k -> c i j k) | i <- x, j <- x]\n>   == \\ k -> sum [f i j * c i j k | i <- x, j <- x]\n>\n> I did assume here that a is Unital, and that x could be enumerated, but I\n> don't think I made any big leaps of faith here did I?\n>\n> —\n> You are receiving this because you modified the open/close state.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/ekmett/algebra/pull/16#issuecomment-272314192>, or mute\n> the thread\n> <https://github.com/notifications/unsubscribe-auth/AASmEfUhuwcCXQk8luR1_5p-nYZ8akwsks5rRrPJgaJpZM4Lha9W>\n> .\n>\n"}}
{"actor":{"display_login":"ekmett"}}