X~u      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t Safe    All the topology is here. Adam Saltz BSD3 saltz.adam@gmail.com  experimental Safe(+/35  A resolved   has a  and a set of  s. A  8 is represented by a set of integer labels for its arcs.A a is a collection of integers. These should all be 0 or 1. At some point I will change this to type Resolution = [Resolution'] and 6data Resolution' = One | Zero deriving (Show, Eq, Ord) or somesuch.uA u& (Planar BDiagram) is a collection of s./A braid can also be written as a collection of #s. See knotatlas for more info on  and .A b is a width and word. Integers in the word represent Artin generators and their invereses. E.g. [1,3,-2]0 represents the word sigma_1sigma_3sigma_2^{-1}.Returns the mirror of b.Turn a  into a u.Turn a crossing into a .Utility function to return all the resolutions of a planar diagram. This amounts to all sequences of 0s and 1s of some length.Take a u and a  and returns the resolved u.. Note that the output is always a list of s.Compute all resolutions of a u.This is the only use for  Data.Graph.Take a u and returns a list of all the   s of its s.*The total cube of resolutions for a braid. uv    uvSafe "Construct a family of braids from  NgLand Khandawit's paper http://www.math.duke.edu/~ng/math/papers/nonsimple.pdf.. This will fail if either input is negative.    Mod 2 vector space. Adam Saltz BSD3 saltz.adam@gmail.com  experimental Safe!!) is a map from (a linear combination of) ''s to a set of (linear combinations of) 's.")Stands for sums of generators modulo 2. . wraps a single generator. | Should be a type synonym instead? | This is something like an implementation of mod 2 vector spaces. Could this be done better with vector-spaces or linear?$These stand for v_+ and v_- in Khovanov homology. We could include some more algebra here, but | for now I don't see a reason to.'A ' is a w of  Components labled with $@s. Strictly speaking, we could make do without components, as 6components = Data.Set.fromList . Data.Map.keys $ signsC. kgrade depends totally on signs, so it should be taken out too. 0&Generates all arrows from elements of s to elements of s'& with the latter wrapped as singleton w`s. This is purely algebraic -- the function doesn't check if their ought to be any such arrows.1BThe next three functions implement mod 2 addition at the level of ws and xs.4;Adds a x to the key key (but only if key is a key of mors).!"#$%&'()*+,-./01234y!"#$%&'()*+,-./01234'()*+,$%&-"#./!12340 !"#$%&'()*+,-./01234y"Implements the Khovanov "functor". Adam Saltz BSD3 saltz.adam@gmail.com  experimental Safe5(An elementary morphism is determined by  Components. We distinguish between 6 and 7 5s6"merges the first set to the second7$splits the first set into the second8pData type to represent whether a circle is trivial or not. Used to be Bool' but I got confused about which was True and which was False.; Return the diagram underlying a '.<%Compute the homological grading of a '.=Compute the q-grading of a 'M. In this convention, the Khovanov differential *lowers* the q-grading by 1.>Determine if a component is non-trivial. To compute the mod 2 winding number about the braid axis, check how many of the 'top arcs' live in a component. ?Compute the k-grading of a '.@s"Apply the filtered Khovanov functor to a diagram." We still need the braid width as input to get the k-grading. A]The next three functions apply the Khovanov functor to the vertices of a cube of resolutions.B"Take two diagrams and returns the 5"s between them, if there is one. C/Take a morphism and two generators and returns True6 if there should be a 'Morphism from one to the other.D0Compute the difference in k-grading between two 's.E#Compute the filtration level of an ".GLike C, but only connects two  GeneratorsK if the drop in k-grading from one to the other is less than or equal to a.HReturn ! from the ' into the set with D less than or equal to k.IApplies H to every ' in a list into the same list.J Produces the '6 corresponding to the transverse invariant of a braid.K)Produces the portion of the cube of resolutions of a braid which is relevant for computing kappa. This means only using resolutions whose weights are less than or equal to psi's. Note that this only uses the homological grading of psi, so we don't need a separate function for the quotient. 56789:;<=>?@ABCDEFGHIJK56789:;<=>?@ABCDEFGHIJK;<=89:>?@A567BCDEFGHIJK56789:;<=>?@ABCDEFGHIJKPImplements the "cancellation lemma". Most of the work to compute kappa is here. Adam Saltz BSD3 saltz.adam@gmail.com  experimental Safe z'Return the complex simplified at (g,g')L@Compute all morphisms which change the k-grading by less than k.M Compute all 's which map to psi'.N Compute all 's which map to psi' with Ds less than k. (I've tried to stick to this pattern throughout: the k-version of a function just filters by kDrop.){| if and only if the '! is the source of a single arrow.O6Determine which generators have single arrows to psi'.PSame as O: but only checks for arrows which shift the filtration by k or less.Q$Cancel g in mors while dodging psi'.RSimplify the complex at filtration k while dodging psi' Uses the Writer monad to keep track of what's canceled (but that information isn't used, presently)S;Simplify the complex up to filtration k while dodging psi'.T'Test whether psi' dies at filtration k. zLMN{OPQRST LMNOPQRST LMNOPQRST zLMN{OPQRSTFunctions to compute kappa. Adam SaltzBSD3saltz.adam@gmail.com experimentalSafeUReturn +(Maybe kappa, Maybe the simplified complex).VReturns  Just kappa) if kappa is finite. Otherwise, returns Nothing.UVUVUVUV4Reads commandline input and prints Morphisms nicely. Adam SaltzBSD3saltz.adam@gmail.com experimentalSafeW]Parse command line input into a braid. | e.g. @Parse "[1,2,-2,-3] 4" == Braid [1,2,-2,-3] 4fXPrints kappa in a nice way.YPrints Morphisms nicely.Z Prints a single morphism nicely.WXYZWXYZWXYZWXYZ 6Draws braids, their closures, and Khovanov generators. Adam SaltzBSD3saltz.adam@gmail.com experimentalNone35[A newtype wrapper for  to create an } instance. aThe identity braid of index index.bThe identity braid of index index with arc names starting at  lastlabel + 1.cA negative crossing.dDraws a positive crossing.eA cup-cap combo.f'A cup-cap combo with names starting at  lastLabel + 1.gThe k)th Artin generator of the braid group on n& strands. To draw the inverse of the kth generator, use -k.hDraws a braid.iDraws a braid closure.j Draws the r resolution of the kth Artin generator in the n1 strand braid group. To draw the inverse of the kth generator, use -k.k Draws the r resolution of the kth Artin generator in the n+ strand braid group with names starting at  lastLabel + 1. To draw the inverse of the kth generator, use -k.lDraws the braid b resolved according to rs.mDraws the closure of the braid b resolved according to rs.nA Map from <s to a diagram of the corresponding resolution of the braid b.oA Map from Ks to a diagram of the corresponding resolution of the closure of the braid b.pPrints Maps like the output of n and `cubeOfResolutionsClosureD.`qDiagrams for an " indexed by their resolutions.rDiagram for a single '" -- mostly exists to be called by q.sMarks a component of diagram.[\]^_`abcdefghijklmnopqrst[\]^_`abcdefghijklmnopqrs`_^][\tabcdefghijklmnopqrs[\]^_`abcdefghijklmnopqrst~     !"#$%&'()**+,-../0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` a a b c d e f g h i j k l m n o p q r s t u v w x yz{|}~|braid_BYpyDh7iYGu3yzEwhIrGW8UtilBraids ExampleBraidsComplexKh CancellationKappaParse BraiddiagramsdeleteAt maybeTuplecomposegraphisNotASubsetOf getSubmap deleteKeys cartesianexpBDiagram resolution' components' Component ResolutionNodeCrossJoinBraid braidWidth braidWordmirror braidToPDcrossingToNodesallResresolve resolutionsresolutionToComponentscubeOfResolutions braidCubengkRightngkLeft MorphismsAlgGenSignPlusMinus Generator resolution componentssignskgrade signToNumwrapGentoSetfromToaddMod2 addMod2Set addMod2MapaddToKeyElMoMergeSplit TrivialityTrivial NonTrivialgToD homGradingqGradingnonTrivialCirclekGradingkhovanovkhovanovComplex whichMorphismmorphismActionkDropkgrade'kDrop'filteredMorphismActionfilteredMorphismsFromfilteredComplexLevelpsipsiCubekFilteredMorphisms whoHasPsi kWhoHasPsi psiKillers kPsiKillers cancelKey kSimplifykSimplifyComplexkDoesPsiVanish computeKappa' computeKappaparse showKappa' showMorphisms showMorphismNameNodeArtinGen BraidIndexHeightArcLabelidentity identityAtnegativeCrossingpositiveCrossingcupCap cupCapLevelAtartin drawBraiddrawBraidClosure resolutionD resolutionAtresolveDresolveClosureDcubeOfResolutionsDcubeOfResolutionsClosureD printCube bigGeneratorD generatorDmarkIn$fIsNameNameNodePDisCrossconta_LKCPrTJwOTOLk4OU37YmeN Data.Set.BaseSet Data.Map.BaseMap$fMonoidAlgGensimplifyEdgeGraph soloArrowghc-prim GHC.TypesTruediagr_BC6dduSBYqwEJU3mXUFmz5Diagrams.Core.NamesIsName