{"action":"created","issue":{"url":"https://api.github.com/repos/sympy/sympy/issues/14661","repository_url":"https://api.github.com/repos/sympy/sympy","labels_url":"https://api.github.com/repos/sympy/sympy/issues/14661/labels{/name}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/14661/comments","events_url":"https://api.github.com/repos/sympy/sympy/issues/14661/events","html_url":"https://github.com/sympy/sympy/issues/14661","id":317410425,"number":14661,"title":"Better definition of AccumBounds","user":{"login":"asmeurer","id":71486,"avatar_url":"https://avatars3.githubusercontent.com/u/71486?v=4","gravatar_id":"","url":"https://api.github.com/users/asmeurer","html_url":"https://github.com/asmeurer","followers_url":"https://api.github.com/users/asmeurer/followers","following_url":"https://api.github.com/users/asmeurer/following{/other_user}","gists_url":"https://api.github.com/users/asmeurer/gists{/gist_id}","starred_url":"https://api.github.com/users/asmeurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmeurer/subscriptions","organizations_url":"https://api.github.com/users/asmeurer/orgs","repos_url":"https://api.github.com/users/asmeurer/repos","events_url":"https://api.github.com/users/asmeurer/events{/privacy}","received_events_url":"https://api.github.com/users/asmeurer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-24T21:58:45Z","updated_at":"2018-04-25T06:08:47Z","closed_at":null,"author_association":"OWNER","body":"I was looking at this behavior:\r\n\r\n```\r\n>>> AccumBounds(-oo, oo)*0\r\nAccumBounds(-oo, oo)\r\n```\r\n\r\nand I can't figure out if it is correct or not. \r\n\r\nThe definitions in the docstring simply indicate that the accumulation bounds are a closed extended real interval and multiplication is done element-wise, ignoring that `0*oo` is not defined. It also doesn't really specify how `AccumBounds*nonAccumBounds` should be defined.  If I think of non-AccumBounds, like just `0` as `AccumBounds(0, 0)`, then the definition makes no sense (what is `0*oo`?). If I think of it as accumulation points of a function that oscillates infinitely largely as x goes to infinity, say, `x*sin(x)`, times 0, then the answer should be 0. Actually, if I think of it it as only an upper bound on the accumulation points, then it is correct, because any function that is defined for large enough x is AccumBounds(-oo, oo). \r\n\r\nI think we need more rigour in our definition of AccumBounds. \r\n\r\nHere are some musings on a possible definition. Let A be the accumulation bounds interval <a, b>. Then A represents the set of all functions `f(x)` whose accumulation points as `x -> oo` are in the closed interval `[a, b]`. That is, `A = {f: f(x) is such that f(x) has accumulation points in [a, b] as x -> oo}` (here `f` varies over all (continuous?) real functions defined for sufficiently large `x`). Define `A*g(x) = g(x)*A` is the accumulation bounds object representing the set `{g*f: f ∈ A}`. Note that this definition gives every accumulation bounds object as a subset of `<-oo, oo>`.  I believe it is well-defined (there might need to be some infimums and supremums in there). We can similarly define `A*B`, as well as other operators (division still has an issue unless you exclude 0).\r\n\r\nThe issue here is that this really defines \"tight\" accumulation bounds. What we have in SymPy is a more loose definition, which requires only that AccumBounds(a, b) is a subset of <a, b> (as I defined it above). I'll have to think more on how to flesh out a real definition that represents the `AccumBounds` object we currently have in SymPy. \r\n\r\nDoes this seem like it is a good approach? CC @jksuom "},"comment":{"url":"https://api.github.com/repos/sympy/sympy/issues/comments/384171028","html_url":"https://github.com/sympy/sympy/issues/14661#issuecomment-384171028","issue_url":"https://api.github.com/repos/sympy/sympy/issues/14661","id":384171028,"user":{"login":"jksuom","id":6929119,"avatar_url":"https://avatars3.githubusercontent.com/u/6929119?v=4","gravatar_id":"","url":"https://api.github.com/users/jksuom","html_url":"https://github.com/jksuom","followers_url":"https://api.github.com/users/jksuom/followers","following_url":"https://api.github.com/users/jksuom/following{/other_user}","gists_url":"https://api.github.com/users/jksuom/gists{/gist_id}","starred_url":"https://api.github.com/users/jksuom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jksuom/subscriptions","organizations_url":"https://api.github.com/users/jksuom/orgs","repos_url":"https://api.github.com/users/jksuom/repos","events_url":"https://api.github.com/users/jksuom/events{/privacy}","received_events_url":"https://api.github.com/users/jksuom/received_events","type":"User","site_admin":false},"created_at":"2018-04-25T06:08:47Z","updated_at":"2018-04-25T06:08:47Z","author_association":"MEMBER","body":"The set of accumulation values of a function `f` at `oo` can be defined as the intersection of the closures of the images of all intervals `(x, oo)` contained in the domain of `f`, or symbolically `⋂_x f((x, oo))^` (where ^ denotes the closure). (It is also the same as the set of limits of `f(x_n)` for all sequences `(x_n)` tending to `oo` such that the limit exists.) This means that the limit of `f` at `oo` can be denoted by `<a, b>` if `f((x, oo))` is contained in `[a, b]` for some `x`. But note that this condition is not necessary. The set of accumulation values may be contained in `[a, b]` even if every image `f((x, oo))` extends (slightly) out of that interval.\r\n\r\nAs to `AccumBounds(-oo, oo)`, I think that it should be treated as `nan`. (In fact, it should probably be changed to `nan`. It does not give any information of the limits.) In the same way as `nan*0` is `nan`, the following could be considered correct (in case `AccumBounds(-oo, oo)` should be used).\r\n```\r\n>>> AccumBounds(-oo, oo)*0\r\nAccumBounds(-oo, oo)\r\n```\r\nIt is in line with other definitions like `oo*0 == nan` that have been derived from the study of limits of products `f(x)*g(x)` where `f(x) -> oo` and `g(x) -> 0`."}}
{"actor":{"display_login":"jksuom"}}