{"id":19268396,"url":"https://github.com/permutatriangle/tilescope","last_synced_at":"2025-06-23T17:37:56.440Z","repository":{"id":71194825,"uuid":"121506041","full_name":"PermutaTriangle/TileScope","owner":"PermutaTriangle","description":null,"archived":false,"fork":false,"pushed_at":"2020-02-07T11:10:39.000Z","size":69440,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":11,"default_branch":"develop","last_synced_at":"2025-01-05T12:30:44.533Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PermutaTriangle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-02-14T12:01:38.000Z","updated_at":"2020-07-01T17:03:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"47b82150-514b-4d21-a33b-f99a9ce9cd94","html_url":"https://github.com/PermutaTriangle/TileScope","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PermutaTriangle%2FTileScope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PermutaTriangle%2FTileScope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PermutaTriangle%2FTileScope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PermutaTriangle%2FTileScope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PermutaTriangle","download_url":"https://codeload.github.com/PermutaTriangle/TileScope/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240371742,"owners_count":19790888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T20:16:08.974Z","updated_at":"2025-02-23T19:46:06.760Z","avatar_url":"https://github.com/PermutaTriangle.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tilescope\n\nTilescope is an algorithm that builds a proof tree using several different proof\nstrategies. The goal is to make the algorithm powerful enough to find proof\ntrees that allow us to enumerate permutation classes avoiding patterns of length\nfour. In the beginning we will start with a relatively simple algorithm that can\nhandle bases with many length four patterns. As we consider smaller bases we\nwill start seeing the algorithm fail and will then add new strategies to turn\nthose failures into successes. We feel that it is natural to start with a known\napproach to connect with the current state of the literature. Currently we want\nto take the regular insertion encoding as the starting point. This is mainly\nbecause this is the only automatic method for which you can know a priori\nwhether or not it will succeed. This depends on whether the basis of the\npermutation class intersects the permutation classes Av(123, 3142, 3412) and\nAv(132, 312), as well as the reversals of these classes. As the goal is to\nconsider all bases of length four patterns, this condition allows us discard a\nlarge number of bases and focus on more complicated ones.\n\nQuick note on the current versions: On the branch called v2 we have a version\nimplementing strategies that do *not* achieve mimicking regular insertion\nencoding. That version is hard to add to so we are starting from scratch, on the\nmaster branch. The current version is however quite powerful. Jay wrote another\nimplementation of the meta-tree that uses components to handle recursions. This\nis on the pantone_tree branch.\n\n## Roadmap\n\n### Step 0: Mimick the regular insertion encoding\nRecall how the regular insertion encoding finds the structure of the class\nAv(123, 132):\n\n![alt text](https://github.com/PermutaTriangle/Tilescope/blob/master/figures_for_README/rie_123_132.jpg \"Regular insertion encoding of Av(123, 132)\")\n\nThe most basic implementation of Tilescope mimicks the regular insertion encoding.\nNotation for the next figure: X is a permutation class, epsilon (e here) is the\nempty permutation, X with a dot in the middle (X-e here) is a class with the\nempty permutation removed, and o is the point. At this stage we are leaning\ntowards calling classes of the form X-e _positive_ classes. We start with X at\nthe root and use the following proof strategy to branch:\n\n_Cell insertion (ci)_: Given a cell marked with an X, create a left child\nwith X replaced by e, and a right child with X replaced by X-e.\n\n![alt text](https://github.com/PermutaTriangle/Tilescope/blob/master/figures_for_README/basic_atrap_123_132.jpg \"ATRAP mimicking regular insertion encoding\")\n\nThe left child is 'verified' meaning that it represents a subset of the class X.\nTo progress from the right child we need a new proof strategy:\n\n_Place new maximum (nm)_: If there are no cells marked with 'X' in the top row of\nthe tiling then branch (into as many branches as there are X-e's) depending on\nwhere the new maximum is. Note that illegal placements of the new maximum are\nnot drawn. (Also note that when this is applied with a single X-e then we don't\ndraw an edge pointing down, but rather an '=' since this is just another\nviewpoint on the same subset of X.)\n\nTo mimick the loops in the automaton created by regular insertion encoding we\nborrow reversibly-deletable points from enumeration schemes: A point o is\nreversibly-deletable if there is an isomorphism between the subset of the class\nX generated by a tiling T, and the subset of the class X generated by a tiling\nT-o. We call this strategy _recursion (r)_. These are drawn with dashed arrows.\n\nIt should be easy to argue that this version of Tilescope is equivalent to regular\ninsertion encoding. The proof trees outputted by it should also be easily\nturned into generating functions for the classes.\n\nA final note on this version: Since we need to turn all X's in the top row into\nX-e's before we can apply (nm) this implies that the algorithm explores exactly\none proof tree. This will change below when we have multiple choices for\nproceeding from a tiling.\n\n### Step 1: Generalizing (nm), adding (pp) and (rcs), and inferral of cells in a tiling\nA natural generalization of (nm) is choosing a row or column and inserting a\nnew bottom-most or top-most point in the row; or a left-most or right-most point\nin the column. We call this strategy row/column insertion (rci).\n\nIt is not settled what the first generalization of (r) will be, but probably\nat least allowing reversibly-deletable cells (not just points). Also keep in\nmind that non-ancestral recursions are easier to implement and understand.\nAlso note that recursions that stay within a proof tree are easier to\nunderstand.\n\nInstead of having to consider entire rows or columns when inserting new points\nwe can take a cell marked with X-e and insert the top-most, bottom-most,\nleft-most, or right-most point into it. This is _point-placement (pp)_.\n\n![alt text](https://github.com/PermutaTriangle/Tilescope/blob/master/figures_for_README/pp.jpg \"I like to think of these as different viewpoints on the same subset\")\n\nThe proof strategy _row-column separation (rcs)_ splits rows or columns depending\non whether crossing 12's or 21's are allowed. Think of the structure of\nAv(231). This can be generalized to multiple cells in a row or column.\n\nFor two cells ci and cj in the same row say ci \u003c cj if i \u003c j and placing a 21 is\nnot allowed or i \u003e j and placing 12 is not allowed. If a row's cells forms a\npartial order with this relation (it is possible for ci \u003c cj and cj \u003c ci) and\nthis forms a ranked poset (a poset that has the property that for every element\nx, all maximal chains among those with x as greatest element have the same\nfinite length - this ensure minimal elements have the same rank) then the row\nsplits into multiple rows. The ith row has the cells of rank i.\n\n![alt text](https://github.com/PermutaTriangle/Tilescope/blob/master/figures_for_README/rcs.jpg \"If a crossing 21 is forbidden, split the row\")\n\nFinally, whenever we apply a proof strategy that adds a point or an X-e we\nshould _infer (i)_ what the rest of the cells need to avoid, instead of just marking\nthem with an X.\n\n![alt text](https://github.com/PermutaTriangle/Tilescope/blob/master/figures_for_README/inf.jpg \"The right-most cell must be decreasing\")\n\n### Step 2: Generalizing (r)\n\nFirst a preliminary definition: Let T be a tiling with a cell c, and let w be a\npermutation in the grid class of T. Then w-c is the permutation obtained by\ndeleting the points in w that were contributed by c.\n\nSTART OF OLD DEFINITIONS OF RECURSION\n\nThere are four definitions that impact how we think about recursions:\n\n*Definition 1* Let T be a tiling before inferral, meaning that all the blocks are of the type\nAv(B) or Av(B)-e, where B is the input basis. A cell (containing a point or a\nclass) is _reversibly deletable_ if for any permutation w in the grid class of T\nsatisfies: If w contains a pattern from B, then so does w-c. Equivalently we can\nsay that if w contains a pattern from B then there is at least one occurrence of\na pattern from B that does not have points in c.\n\n*Definition 2* We can make the same definition about a tiling after inferral and\nthis leads to a slightly different behavior of the reversibly delatable cells.\n\nWe should probably prove a lemma that says that one type implies the other.\n\n*Definition 3* Let T be a tiling before inferral. Define graph structure on the\non the cells of T as follows: A cell u has an (undirected) edge to a cell v if\nthere exist a permutation in the grid class of T that contains an occurrence of\na basis pattern, that has points from both u and v. A _component_ of T is a\nconnected component of this graph.\n\n*Definition 4* We can make the same definition about a tiling after inferral and\nthis leads to a slightly different behavior of the reversibly delatable cells.\n\nWe should probably prove a lemma that says that one type implies the other.\n\nIn the v2 implementation Definition 2 is being used.\n\nIn Jay's implementation of the meta-tree Definition 4 is being used, and he\nlooks for recursions to a tiling made up of any combination of components.\n\nI think eventually we will consider all of these together: E.g., compute the\ncomponents (before or after inferral) and try deleting reversibly deletable\ncells from these.\n\nEND OF OLD DEFINITIONS OF RECURSION\n\nNote also that recursion to an ancester is good, while recursion to a\nnon-ancestor does not directly lead to verification.\n\nWith these proof strategies (and some version of recursion) we should be able to\nfind a proof tree for any Av(B) such that B contains at least one length 3\npattern and one length 4 pattern. (Note that out of about 14,000 such bases,\nonly 4 do not have a regular insertion encoding.) Also a host of interesting\nexamples, such as the separable permutations, and I would hope most of the 3x4\nclasses.\n\nNote that we can get a proof tree for Av(123) but it does not easily imply that\nthe class is counted by the Catalan numbers, see Step 3 below on isomorphic\nproof trees.\n\n![alt text](https://github.com/PermutaTriangle/Tilescope/blob/master/figures_for_README/current_atrap_123.png \"Note that there is a decreasing cell that mixes into the recursed part\")\n\n### Step 3: Generalizing (ci), adding fission/fusion (ff)\nTo be able to mimick Zeilberger's original enumeration schemes we need to have\n_fission and fusions (ff)_ of rows and columns.\n\n![alt text](https://github.com/PermutaTriangle/Tilescope/blob/master/figures_for_README/ff.jpg \"PSd = fission/fusion, PSe = row/column insertion\")\n\nHere is the enumeration scheme given by Zeilberger (he wrote it out in plain\nEnglish.)\n\n![alt text](https://github.com/PermutaTriangle/Tilescope/blob/master/figures_for_README/es123.jpg \"PSd = fission/fusion, PSe = row/column insertion\")\n\nWith these proof strategies we can find Zeilberger's original enumeration\nschemes. In particular we will be able to find a tree for Av(132)\nwhich is almost the same as the one for Av(123):\n\n![alt text](https://github.com/PermutaTriangle/Tilescope/blob/master/figures_for_README/es132.jpg \"Sorry for the bad handwriting\")\n\nIf we define isomorphisms of proof trees we can prove that Av(123) is\nWilf-equivalent to Av(132). From Step 1 we will have established that Av(132) is\nenumerated by the Catalan numbers. This will finally give us a fully automatic\nWilf-classification of all subsets of S3.\n\nThe strategy (ci) creates two branches depending on whether a cell avoids the\npattern 1 (= is empty) or contains the pattern 1 (= is non-empty). This can be\ngeneralized by replacing 1 with an arbitrary pattern p. On the right branch\nwhere the pattern is contained (assuming this tiling is not verified) we can\nuse a binary mesh pattern coincident with p (we say two patterns are coincident\nif Av(m) = Av(m'); a pattern is binary if it is contained in a permutation if\nand only if it is contained exactly once in the permutation) to place the points\nin the cell.\n\n![alt text](https://github.com/PermutaTriangle/Tilescope/blob/master/figures_for_README/bmp.jpg \"All the shadings are implied by the basis of X\")\n\nThe 'binaryness' of the mesh pattern allows the placement of the points to be\nunique, preserving enumeration. We call this generalization of (ci) _cell\ninsertion with a pattern (cip)_. Inserting a binary mesh pattern into the\ncell we call _binary mesh pattern placement (bmpp)_. In the above figure the\nbasis of X implied all the shadings. In general we sometimes need to use a\nresult like the shading lemma and the shading algorithm to make the pattern\nbinary.\n\nHaving (cip) would imply we can do any Av(132, p) where p is any pattern (see\npaper by Mansour and Vainshtein). We would want to prove a stronger result:\nthat we can do any subclass of Av(132).\n\nA natural follow-up to automatically Wilf-classifying S3 is to try to do as much\nas possible of S4. A nice goal would be at least all bases with four or more\npatterns.\n\nAt this stage we should have a powerful enough algorithm to to some interesting\nclasses, that have been enumerated by hand, as well as some unenumerated classes.\nJay suggests that if we have interesting results we should aim for a general\nmathematics journal. I would agree.\n\n### Step 4: Gap matrices and more\nVatter defined gap vectors for his enumeration schemes. In some sense they are\ntools for early termination of the nodes in the scheme. In another sense they\ncontrol how a point can mix into a block. In a third sense, they mess with\nenumerations. Our nodes are two-dimensional so we can define\n(completely analogously) gap matrices.\n\nChristian thinks we might be able to mimick substition decomposition. He'll put\nmore on that later.\n\nThere is a slight generalization of (rcs) which might be useful at some point:\nBranch into a left child where there is no crossing 12 between two cells, and\na right child where there is a crossing 12. This only works if the crossing 12\ncan be made unique some how (similar to a binary mesh pattern).\n\n![alt text](https://github.com/PermutaTriangle/Tilescope/blob/master/figures_for_README/321_1342.png \"A crossing inversion placed around the maximum\")\n\nThis strategy can also be thought of as part of the following more general idea:\n\nCan we define a space of proof strategies and search it for good ones? E.g., one\ncan generalize (ci) and (rci) to a common strategy which puts a pattern into a\ngroup of cells.\n\nAt this stage we will have a large collection of inputs (bases) and successful\noutputs (proof trees). Can we train an AI on this? Can we apply some big data or\nmachine learning methods to this data set? There are some people at RU that know\nalot about this kind of stuff. We were also able to get people at ICERM (Brown\nUniversity) excited about this, but are not ready with enough data.\n\n## The papers\n\nI put authors down according to what I guessed would make sense. Nothing is set\nin stone. I would love for everybody to be everywhere if they want.\n\n### First paper on atrap (Albert, Ardal, Bean, Claesson, Magnusson, Pantone, Tannock, Ulfarsson)\n* Initial proof strategies: (ci), (nm), basic (r) =\u003e regular insertion encoding\n* Generalized, or new proof strategies: (rci), general (r), (pp), (rcs), (i)\n* Say we can do all bases B with one S3 and one S4 pattern, point to PermPAL paper for enumerations\n* Say we can do all bases B that struct succeeded, on point to PermPAL paper for enumerations\n* New proof strategies: (ff) =\u003e Zeilberger's original enumeration schemes\n* Isomorphisms of proof trees: Fully automatic Wilf-classification of S3\n* Even more proof strategies: (cip), (bmpp), very general (r)\n* A collection of nice S4 bases that we handle\n\n### PermPAL paper (Undergrads, Ardal, Claesson, Bean, Pantone, Ulfarsson)\n* Turning struct covers into enumeration\n* Turning atrap trees into enumeration\n* Automatic Wilf-classification of bases B with one S3 and one S4 pattern\n* Automatic Wilf-classification of bases B that struct succeeded on\n* [PermPAL](http://permpal.ru.is \"Permutation Pattern Avoidance Library\").\n\n### Second paper on atrap - we need to see what overflows from the first (?)\n* Gap matrices?\n* Defining and searching a space of proof strategies\n* AI, machine learning, big data method?\n\n## Thesis work of students\n\n### Ragnar Ardal\nRagnar is the main implementer of the meta-tree of atrap and a lot of the\nunderpinnings of the algorithm. He wrote a very clever and fast algorithm for\navoidance testing which warrants a section of his thesis. He will be an author\non both atrap papers. He also wants to implement a Monte-Carlo version of atrap.\nThat might also become part of one of the atrap papers, or a separate paper.\n\n#### Papers from, or with a non-empty intersection with, thesis\n* First atrap paper (see above)\n* Second atrap paper (see above)\n* Perhaps a Monte-Carlo paper, or that becomes part of one of the atrap papers\n* The PermPAL paper (see above)\n\n### Christian Bean\nChristian is an author on the paper about struct. He will also be an author on\nboth atrap papers. His thesis can also include his work on vincular-covincular\npatterns and the independent subsets of graphs paper (both submitted)\n\n#### Papers from, or with a non-empty intersection with, thesis\n* Struct paper (with Gudmundsson and Ulfarsson), proof-reading\n* First atrap paper (see above)\n* Second atrap paper (see above)\n* Maybe: vincular-covincular (submitted)\n* Maybe: independent sets in graphs (submitted)\n\n### Bjarki Gudmundsson\nGudmundsson is also an author of the struct paper and implemented the algorithm.\nThat should can be a part of his thesis. Also the work he did with Magnusson on\nthe shading algorithm (the next student). He is currently working on something\nwith Claesson.\n\n#### Papers from, or with a non-empty intersection with, thesis\n* Shading algorithm (with Magnusson and Ulfarsson), mostly ready\n* Struct paper (with Bean and Ulfarsson), proof-reading\n* A paper with Claesson I think\n\n### Tomas Magnusson\nThe work Magnusson did with Gudmundsson on the shading algorithm (sha) is\nnecessary for finding (close to) all binary mesh patterns that are coincident\nwith a classical pattern. He will also need to combine that work with what\nTannock did in his MSc thesis about coincidences of patterns inside a\npermutation class. Finally building upon an example from Tannock's thesis, he\nwill implement the inductive shading algorithm (isha) which is a generalization\nof (sha) and is hopefully strong enough to complete the coincidence\nclassification of mesh patterns of length 3. He will implement the binary mesh\npattern placement of atrap and therefore be an author on the atrap paper where\nwe put that proof strategy.\n\n#### Papers from, or with a non-empty intersection with, thesis\n* Shading algorithm (with Gudmundsson and Ulfarsson), mostly ready\n* First atrap paper (see above)\n* Inductive shading algorithm paper (with Tannock and Ulfarsson)\n\n### Undergrad group (4 students)\nThese students have been parsing the logs from Struct (conjectured covers of\npermutation classes) and presenting them at [PermPAL](http://permpal.ru.is\n\"Permutation Pattern Avoidance Library\"). They have also turned the structural\ndescriptions into recurrence relations and are starting to turn them into\ngenerating functions as well. When Tilescope is able to find a proof tree for all\nbases B with at least one S3 patterna and at least on S4 pattern (almost\npossible now: 28 of them have external recursions - fixable), as well as all\n(most?) of the classes that Struct succeeded on I think we should write a paper\non the Wilf-classification of that set and about the\n[PermPAL](http://permpal.ru.is \"Permutation Pattern Avoidance Library\").\n[Here](http://permpal.ru.is/perms/av/132_1234_2314_2341_3214_3241_3412_3421_4231_4312/\n\"Av(132,1234,2314,2341,3214,3241,3412,3421,4231,4312)\") is a completely trivial\nclass that demonstrates what I really like about PermPAL (at least when it is\nfully populated): If you keep clicking the classes that your starting class\nrefers to you eventually reach a trivial class like Av(12,21) (Schroedinger's\npoint!).\n\n#### Papers from, or with a non-empty intersection with, thesis\n* The PermPAL paper (see above)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermutatriangle%2Ftilescope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpermutatriangle%2Ftilescope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermutatriangle%2Ftilescope/lists"}