I don't see a good reason Elixir wouldn't allow it, since Erlang (yes I know it's not Elixir) often compiles anonymous functions ("Funs") into top-level definitions...
Here's some IR showing how a top-level fun from this Erlang module...
-module(foo).
-export([f/1]).
f(X) ->
G = fun (Y) -> X + Y end,
G(X * 4) * G(X * 2).
...gets converted into a top-level function called '-f/1-fun-0-': {module, foo}. %% version = 0
{exports, [{f,1},{module_info,0},{module_info,1}]}.
{attributes, []}.
{labels, 9}.
{function, f, 1, 2}.
[SNIPPED FOR HN]
{allocate,1,2}.
{move,{x,0},{y,0}}.
{swap,{x,0},{x,1}}.
{call,2,{f,8}}. % '-f/1-fun-0-'/2
{'%',{var_info,{x,0},[{type,number}]}}.
{gc_bif,'*',{f,0},1,[{tr,{y,0},number},{integer,2}],{x,1}}.
{move,{y,0},{x,2}}.
{move,{x,0},{y,0}}.
{move,{x,1},{x,0}}.
{move,{x,2},{x,1}}.
{call,2,{f,8}}. % '-f/1-fun-0-'/2
{'%',{var_info,{x,0},[{type,number}]}}.
{gc_bif,'*',{f,0},1,[{tr,{y,0},number},{tr,{x,0},number}],{x,0}}.
{deallocate,1}.
return.
{function, '-f/1-fun-0-', 2, 8}.
{label,7}.
{line,[{location,"foo.erl",5}]}.
{func_info,{atom,foo},{atom,'-f/1-fun-0-'},2}.
{label,8}.
{gc_bif,'+',{f,0},2,[{x,1},{x,0}],{x,0}}.
return.