Dictionaries in Julia (and other programming languages) are onto functions, mathematically speaking. That is to say
f:A→B
where
f
is a function defined for every
x∈A,
and also for every
y∈B
there exists at least one
x∈A
such that
f(x)=y,
that is an onto (or surjective) function. The inverse image of
f
is a function
f(−1):℘(B)→℘(A)
where
℘(B)
is the collection of all the subsets of
B,
that is the power set of
B,
and where
f(−1)(C)={x∈A:f(x)∈C}
for any
C⊆B.
In other words, if
f
is a function that maps the elements of a set
A
onto a set
B
and if
C
is a subset of
B
then the inverse image
f(−1)(C)
is a subset of
A
with all the elements that are mapped by
f
onto the set
C.
If D is a Dict then D is the equivalent to
f
where
A=keys(D) and
B=values(D). To define the inverse image function
f(−1)
it is just necesary to code:
I added a comment «In other words...» I hope may help. Probably what I had in mind was more an invitation for mathematicians to see the advantages of using Julia to exemplify set theory concepts.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (2)
I am not sure I fully grasp this, can you add some commentary for folks who don't have a rigoruous math background like myself?
I added a comment «In other words...» I hope may help. Probably what I had in mind was more an invitation for mathematicians to see the advantages of using Julia to exemplify set theory concepts.