Skip to content

Instantly share code, notes, and snippets.

@kenwebb
Last active November 27, 2017 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenwebb/6ff8d2978db7a168c5b0250b220c537f to your computer and use it in GitHub Desktop.
Save kenwebb/6ff8d2978db7a168c5b0250b220c537f to your computer and use it in GitHub Desktop.
Pullbacks
<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/gwt/ MIT License, Copyright (C) Ken Webb, Mon Nov 27 2017 10:46:24 GMT-0500 (EST)-->
<XholonWorkbook>
<Notes><![CDATA[
Xholon
------
Title: Pullbacks
Description:
Url: http://www.primordion.com/Xholon/gwt/
InternalName: 6ff8d2978db7a168c5b0250b220c537f
Keywords:
My Notes
--------
November 24, 2017
Exercise 3.2.1.3. [1]
a. Draw a set X with five elements and a set Y with three elements. Color each element of X and each element of Y red, blue, or green,2 and do so in a random-looking way. Considering your coloring of X as a function X → C, where C = {red, blue, green}, and similarly obtaining a function Y → C, draw the fiber product X ×C Y.
b. The universal property for products guarantees a function X ×C Y → X × Y, which will be an injection. This means that the drawing you made of the fiber product can be embedded into the 5 × 3 grid. Draw the grid and indicate this subset.
Solution 3.2.1.3.
a. Let X = {1, 2, 3, 4, 5} and Y = {a, b, c}.
TODO
- use XholonSpreadsheet to implement this
References
----------
(1) http://category-theory.mitpress.mit.edu/chapter003.html
3.2.1 Pullbacks, exercise 3.2.1.3
]]></Notes>
<_-.XholonClass>
<PhysicalSystem/>
<RandomColorer/>
</_-.XholonClass>
<xholonClassDetails>
<RandomColorer implName="org.primordion.xholon.base.Behavior_gwtjs"/>
</xholonClassDetails>
<PhysicalSystem>
<XholonSet roleName="X">
<Attribute_String roleName="1"/>
<Attribute_String roleName="2"/>
<Attribute_String roleName="3"/>
<Attribute_String roleName="4"/>
<Attribute_String roleName="5"/>
</XholonSet>
<XholonSet roleName="Y">
<Attribute_String roleName="a"/>
<Attribute_String roleName="b"/>
<Attribute_String roleName="c"/>
</XholonSet>
<XholonSet roleName="C">
<Attribute_String roleName="red"/>
<Attribute_String roleName="blue"/>
<Attribute_String roleName="green"/>
</XholonSet>
<RandomColorer><![CDATA[
var me;
var beh = {
postConfigure: function() {
me = this.cnode;
me.println(me);
var colorsetNode = me.xpath("../XholonSet[@roleName='C']");
var colorsetSize = this.size(colorsetNode);
me.println(colorsetNode);
// X
var node = me.xpath("../XholonSet[@roleName='X']").first();
while (node) {
this.colorize(node, colorsetNode, colorsetSize);
node = node.next();
}
// Y
node = me.xpath("../XholonSet[@roleName='Y']").first();
while (node) {
this.colorize(node, colorsetNode, colorsetSize);
node = node.next();
}
me.remove();
},
colorize: function(node, colorsetNode, colorsetSize) {
var colorIx = Math.ceil(Math.random() * colorsetSize);
me.println(colorIx);
var colorNode = colorsetNode.xpath("*[" + colorIx + "]");
me.println(colorNode);
me.println(colorNode.role());
node.color(colorNode.role());
node.couleur = colorNode; // this is a port
},
// return size of a Set node
size: function(node) {
var count = 0;
var cnode = node.first();
while (cnode) {
count++;
cnode = cnode.next();
}
return count;
}
}
]]></RandomColorer>
</PhysicalSystem>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="100" height="50" xmlns="http://www.w3.org/2000/svg">
<g>
<title>Set X</title>
<rect id="PhysicalSystem/XholonSet[@roleName='X']" fill="#98FB98" height="50" width="50" x="25" y="0"/>
<g>
<title>Set C</title>
<rect id="PhysicalSystem/XholonSet[@roleName='C']" fill="#6AB06A" height="50" width="10" x="80" y="0"/>
</g>
</g>
</svg>
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient>
</XholonWorkbook>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment