A Category Theoretical Investigation of the Type Hierarchy ...
Transcript of A Category Theoretical Investigation of the Type Hierarchy ...
A Category Theoretical Investigation of
the Type Hierarchy for Heterogeneous
Sensor Integration
CLIFF JOSLYN, EMILIE PURVINE, MICHAEL ROBINSON
Pacific Northwest National Laboratory American University
Outline
March 15, 2018 2
Setting the stage β information integration scenario [Michael Robinsonβs
flash talk]
Our strategy to encode data into a vector space
Examples
SET
PORDINAL
INTERVAL β a work in progress
Emilie Purvine, Cliff Joslyn, Michael Robinson. A Category Theoretical Investigation of the Type
Hierarchy for Heterogeneous Sensor Integration. https://arxiv.org/abs/1609.02883
Data type hierarchy
March 15, 2018 3
Data types fall into a few
categories β literally!
Can create categories for
each type of data so that
stalks are objects in that
category
Transform between
data types using
functors
Lose some information e.g., SCALAR β ORDINAL we lose addition
Transformation to FVECT allows us to turn any data type into a finite
dimensional vector space, keeping structure
Our strategy
March 15, 2018 4
Given a single stalk, or data type, e.g., set, boolean, partial ordinal,
ordinal, interval, scalar, probability, binary relationβ¦
1. Create a category, πΆ, where the stalk is an object.
E.g., if a stalk is a totally ordered set then it is an object in the category ORDINAL
Our strategy
March 15, 2018 5
Given a single stalk, or data type, e.g., set, boolean, partial ordinal,
ordinal, interval, scalar, probability, binary relationβ¦
1. Create a category, πΆ, where the stalk is an object.
E.g., if a stalk is a totally ordered set then it is an object in the category ORDINAL
2. Given a single object π β πΆ (your stalk), find a category π· such that there is
a surjection from π to the isomorphism classes of π·, π·ππππ‘(π·)
Our strategy
March 15, 2018 6
Given a single stalk, or data type, e.g., set, boolean, partial ordinal,
ordinal, interval, scalar, probability, binary relationβ¦
1. Create a category, πΆ, where the stalk is an object.
E.g., if a stalk is a totally ordered set then it is an object in the category ORDINAL
2. Given a single object π β πΆ (your stalk), find a category π· such that there is
a surjection from π to the isomorphism classes of π·, π·ππππ‘(π·)
3. Create a vector space π with basis elements from π·ππππ‘(π·)
Our strategy
March 15, 2018 7
Given a single stalk, or data type, e.g., set, boolean, partial ordinal,
ordinal, interval, scalar, probability, binary relationβ¦
1. Create a category, πΆ, where the stalk is an object.
E.g., if a stalk is a totally ordered set then it is an object in the category ORDINAL
2. Given a single object π β πΆ (your stalk), find a category π· such that there is
a surjection from π to the isomorphism classes of π·, π·ππππ‘(π·)
3. Create a vector space π with basis elements from π·ππππ‘(π·)
π π·ππππ‘(π·) πsurjection
(Probably should be βvector space-ificationβ)
Our strategy
March 15, 2018 8
Given a single stalk, or data type, e.g., set, boolean, partial ordinal,
ordinal, interval, scalar, probability, binary relationβ¦
1. Create a category, πΆ, where the stalk is an object.
E.g., if a stalk is a totally ordered set then it is an object in the category ORDINAL
2. Given a single object π β πΆ (your stalk), find a category π· such that there is
a surjection from π to the isomorphism classes of π·, π·ππππ‘(π·)
3. Create a vector space π with basis elements from π·ππππ‘(π·)
Bonus: if we put structure of π into π· via morphisms then we can get a
map π β π which encodes this structure β the adjacency matrix of
morphisms in Decat(D)
π π·ππππ‘(π·) πsurjection
(Probably should be βvector space-ificationβ)
Example βcategorical data
March 15, 2018 9
1. Create a category, πΆ, where stalk π is an object.
πΆ = SET as defined previously, clearly π is an object in SET
2. Find a category π· such that there is a surjection from π to the isomorphism
classes of π·, π·ππππ‘(π·)
3. Create a vector space π with basis elements from π·ππππ‘(π·)
π = {police officer, protester, bystander}
Example βcategorical data
March 15, 2018 10
1. Create a category, πΆ, where stalk π is an object.
πΆ = SET as defined previously, clearly π is an object in SET
2. Find a category π· such that there is a surjection from π to the isomorphism
classes of π·, π·ππππ‘(π·)
ππ(π·) = {police officer, protester, bystander}
π»ππππΈπ π₯, π¦ = {πππ₯} π₯ = π¦
β πππ π
3. Create a vector space π with basis elements from π·ππππ‘(π·)
π = {police officer, protester, bystander}
bystander
protesterpolice officer
π· =
Example βcategorical data
March 15, 2018 11
1. Create a category, πΆ, where stalk π is an object.
πΆ = SET as defined previously, clearly π is an object in SET
2. Find a category π· such that there is a surjection from π to the isomorphism
classes of π·, π·ππππ‘(π·)
ππ(π·) = {police officer, protester, bystander}
π»ππππΈπ π₯, π¦ = {πππ₯} π₯ = π¦
β πππ π
Then π·ππππ‘(π·) = { {police officer}, {protester}, {bystander} } and there is clearly a
surjection (bijection in this case) from π to π·ππππ‘(π·)
3. Create a vector space π with basis elements from π·ππππ‘(π·)
π = {police officer, protester, bystander}
bystander
protesterpolice officer
π· =
Example βcategorical data
March 15, 2018 12
1. Create a category, πΆ, where stalk π is an object.
πΆ = SET as defined previously, clearly π is an object in SET
2. Find a category π· such that there is a surjection from π to the isomorphism
classes of π·, π·ππππ‘(π·)
ππ(π·) = {police officer, protester, bystander}
π»ππππΈπ π₯, π¦ = {πππ₯} π₯ = π¦
β πππ π
Then π·ππππ‘(π·) = { {police officer}, {protester}, {bystander} } and there is clearly a
surjection (bijection in this case) from π to π·ππππ‘(π·)
3. Create a vector space π with basis elements from π·ππππ‘(π·)
V = β[{ {police officer}, {protester}, {bystander} }]
= { πΌ β {police officer} +π½ β {protester} +πΎ β {bystander} βΆ πΌ, π½, πΎ β β }
π = {police officer, protester, bystander}
bystander
protesterpolice officer
π· =
Example βcategorical data
March 15, 2018 13
1. Create a category, πΆ, where stalk π is an object.
πΆ = SET as defined previously, clearly π is an object in SET
2. Find a category π· such that there is a surjection from π to the isomorphism
classes of π·, π·ππππ‘(π·)
ππ(π·) = {police officer, protester, bystander}
π»ππππΈπ π₯, π¦ = {πππ₯} π₯ = π¦
β πππ π
Then π·ππππ‘(π·) = { {police officer}, {protester}, {bystander} } and there is clearly a
surjection (bijection in this case) from π to π·ππππ‘(π·)
3. Create a vector space π with basis elements from π·ππππ‘(π·)
V = β[{ {police officer}, {protester}, {bystander} }]
= { πΌ β {police officer} +π½ β {protester} +πΎ β {bystander} βΆ πΌ, π½, πΎ β β }
Bonus: There is no structure on π (or any categorical) which is seen by the
absence of morphisms other than identities in π·. Map π β π is just the identity
matrix in this case
π = {police officer, protester, bystander}
bystander
protesterpolice officer
π· =
Example βcategorical data (cont.)
March 15, 2018 14
Replace stalk {police officer, protester, bystander} with new stalk
β[{ {police officer}, {protester}, {bystander} }]
Now stalk is a vector space!
Example βcategorical data (cont.)
March 15, 2018 15
Replace stalk {police officer, protester, bystander} with new stalk
β[{ {police officer}, {protester}, {bystander} }]
Now stalk is a vector space!
Problem: what if our analysis indicates that
2 β {police officer} +3 β {protester} +1.9 β {bystander}
is part of a globally consistent assignment? How do we interpret this?
Example βcategorical data (cont.)
March 15, 2018 16
Replace stalk {police officer, protester, bystander} with new stalk
β[{ {police officer}, {protester}, {bystander} }]
Now stalk is a vector space!
Problem: what if our analysis indicates that
2 β {police officer} +3 β {protester} +1.9 β {bystander}
is part of a globally consistent assignment? How do we interpret this?
There canβt be any globally consistent assignments
Example βcategorical data (cont.)
March 15, 2018 17
Replace stalk {police officer, protester, bystander} with new stalk
β[{ {police officer}, {protester}, {bystander} }]
Now stalk is a vector space!
Problem: what if our analysis indicates that
2 β {police officer} +3 β {protester} +1.9 β {bystander}
is part of a globally consistent assignment? How do we interpret this?
There canβt be any globally consistent assignments
There are 2 police officers, 3 protesters, and β¦ 1.9 (???) bystanders
Example βcategorical data (cont.)
March 15, 2018 18
Replace stalk {police officer, protester, bystander} with new stalk
β[{ {police officer}, {protester}, {bystander} }]
Now stalk is a vector space!
Problem: what if our analysis indicates that
2 β {police officer} +3 β {protester} +1.9 β {bystander}
is part of a globally consistent assignment? How do we interpret this?
There canβt be any globally consistent assignments
There are 2 police officers, 3 protesters, and β¦ 1.9 (???) bystanders
I saw somebody. Itβs a protester with probability 3/6.9, a police officer with
probability 2/6.9, and a bystander with probability 1.9/6.9.
β¦
Example βcategorical data (cont.)
March 15, 2018 19
Replace stalk {police officer, protester, bystander} with new stalk
β[{ {police officer}, {protester}, {bystander} }]
Now stalk is a vector space!
Problem: what if our analysis indicates that
2 β {police officer} +3 β {protester} +1.9 β {bystander}
is part of a globally consistent assignment? How do we interpret this?
There canβt be any globally consistent assignments
There are 2 police officers, 3 protesters, and β¦ 1.9 (???) bystanders
I saw somebody. Itβs a protester with probability 3/6.9, a police officer with
probability 2/6.9, and a bystander with probability 1.9/6.9.
β¦
Interpretation must be situation dependent
Example βpartial order data
March 15, 2018 20
1. Create a category, πΆ, where stalk π is an object.
2. Find a category π· such that there is a surjection from π to the isomorphism
classes of π·, π·ππππ‘(π·)
3. Create a vector space π with basis elements from π·ππππ‘(π·)
π = [{cat, dog, mammal}, {cat β€ mammal, dog β€ mammal}]
Example βpartial order data
March 15, 2018 21
1. Create a category, πΆ, where stalk π is an object.
ππ πΆ = { π, β : π β ππ ππΈπ , β β π Γ π is reflexive, transitive, antisymmetric}
π»πππΆ π, β , π ,β³ = {order preserving functions π β π }
2. Find a category π· such that there is a surjection from π to the isomorphism
classes of π·, π·ππππ‘(π·)
3. Create a vector space π with basis elements from π·ππππ‘(π·)
π = [{cat, dog, mammal}, {cat β€ mammal, dog β€ mammal}]
Example βpartial order data
March 15, 2018 22
1. Create a category, πΆ, where stalk π is an object.
ππ πΆ = { π, β : π β ππ ππΈπ , β β π Γ π is reflexive, transitive, antisymmetric}
π»πππΆ π, β , π ,β³ = {order preserving functions π β π }
2. Find a category π· such that there is a surjection from π to the isomorphism
classes of π·, π·ππππ‘(π·)
ππ(π·) = {cat, dog, mammal}
π»ππππΈπ = {cat β mammal, dog β mammal} βͺ {identities}
Then π·ππππ‘(π·) = { {cat}, {dog}, {mammal} } and there is
clearly a surjection (bijection again) from π to π·ππππ‘(π·)
3. Create a vector space π with basis elements from π·ππππ‘(π·)
π = [{cat, dog, mammal}, {cat β€ mammal, dog β€ mammal}]
mammal
dogcat
π· =
Example βpartial order data
March 15, 2018 23
1. Create a category, πΆ, where stalk π is an object.
ππ πΆ = { π, β : π β ππ ππΈπ , β β π Γ π is reflexive, transitive, antisymmetric}
π»πππΆ π, β , π ,β³ = {order preserving functions π β π }
2. Find a category π· such that there is a surjection from π to the isomorphism
classes of π·, π·ππππ‘(π·)
ππ(π·) = {cat, dog, mammal}
π»ππππΈπ = {cat β mammal, dog β mammal} βͺ {identities}
Then π·ππππ‘(π·) = { {cat}, {dog}, {mammal} } and there is
clearly a surjection (bijection again) from π to π·ππππ‘(π·)
3. Create a vector space π with basis elements from π·ππππ‘(π·)
V = β[{ {cat}, {dog}, {mammal} }] = { πΌ β {cat} +π½ β {dog} +πΎ β {mammal} βΆ πΌ, π½, πΎ β β }
π = [{cat, dog, mammal}, {cat β€ mammal, dog β€ mammal}]
mammal
dogcat
π· =
Example βpartial order data
March 15, 2018 24
1. Create a category, πΆ, where stalk π is an object.
ππ πΆ = { π, β : π β ππ ππΈπ , β β π Γ π is reflexive, transitive, antisymmetric}
π»πππΆ π, β , π ,β³ = {order preserving functions π β π }
2. Find a category π· such that there is a surjection from π to the isomorphism
classes of π·, π·ππππ‘(π·)
ππ(π·) = {cat, dog, mammal}
π»ππππΈπ = {cat β mammal, dog β mammal} βͺ {identities}
Then π·ππππ‘(π·) = { {cat}, {dog}, {mammal} } and there is
clearly a surjection (bijection again) from π to π·ππππ‘(π·)
3. Create a vector space π with basis elements from π·ππππ‘(π·)
V = β[{ {cat}, {dog}, {mammal} }] = { πΌ β {cat} +π½ β {dog} +πΎ β {mammal} βΆ πΌ, π½, πΎ β β }
Bonus: There is structure on π (and all partial orders) which is seen through the
morphisms in π· encoding the partial order relation.
Basis elements mapped to their principle filter
π = [{cat, dog, mammal}, {cat β€ mammal, dog β€ mammal}]
mammal
dogcat
π· =
1 0 00 1 01 1 1
Example in progress βreal interval valued data
March 15, 2018 25
1. Create a category, πΆ, where stalk π is an object.
π = π, π βΆ π, π β β, π β€ π with structure of a semiring (addition, multiplication, identities are defined, but not inverses) and a partial
order relation π, π β€ π, π if and only if π β€ π, π β€ π
Example in progress βreal interval valued data
March 15, 2018 26
1. Create a category, πΆ, where stalk π is an object.
ππ πΆ = { partially ordered semirings }
π»πππΆ π 1, π 2 = { order preserving semiring homomorphisms }
π = π, π βΆ π, π β β, π β€ π with structure of a semiring (addition, multiplication, identities are defined, but not inverses) and a partial
order relation π, π β€ π, π if and only if π β€ π, π β€ π
Example in progress βreal interval valued data
March 15, 2018 27
1. Create a category, πΆ, where stalk π is an object.
ππ πΆ = { partially ordered semirings }
π»πππΆ π 1, π 2 = { order preserving semiring homomorphisms }
In this case, when c already has a lot of structure, going through an intermediate
category D is probably more trouble than is needed
A ring can be encoded as a preadditive category β a category in which all Hom sets
have the structure of an abelian group β with one object
β¦
π = π, π βΆ π, π β β, π β€ π with structure of a semiring (addition, multiplication, identities are defined, but not inverses) and a partial
order relation π, π β€ π, π if and only if π β€ π, π β€ π
Example in progress βreal interval valued data
March 15, 2018 28
1. Create a category, πΆ, where stalk π is an object.
ππ πΆ = { partially ordered semirings }
π»πππΆ π 1, π 2 = { order preserving semiring homomorphisms }
In this case, when c already has a lot of structure, going through an intermediate
category D is probably more trouble than is needed
A ring can be encoded as a preadditive category β a category in which all Hom sets
have the structure of an abelian group β with one object
β¦
Instead, starting with fields β closest to vector spaces β and working down to
semirings
For field F βcategorifyβ as vector space πΉ1
Work in progress to βcategorifyβ rings and then semirings
π = π, π βΆ π, π β β, π β€ π with structure of a semiring (addition, multiplication, identities are defined, but not inverses) and a partial
order relation π, π β€ π, π if and only if π β€ π, π β€ π
Summary & Future Work
March 15, 2018 29
Real-world data integration tasks need a way to put different data types
on the same footing
Finite dimensional vector spaces give that common footing and allow
topological invariants to be calculated
We developed a three step process and showed examples for three
different data types
Future work:
Implementing this into existing sheaf code packages
Showing examples using real data
Exploring how distances in the original sets get transformed