jhrcek / relation-explorer

A hobby project where I learn basic undegraduate math through programming

Home Page:https://janhrcek.cz/relation-explorer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Relation Explorer

(Ideas for) features

  • Show a relation editor that allows user to select

    • A number n from 1 to 10
    • A rectangular matrix with checkboxes that allows specifying arbitraty relation on a set with n elements
    • Basic history support - ability to undo relation edits
    • Show a graph (as in graph theory) of the relation
    • Show a bipartite graph of the relation (TODO how is this called?)
  • Multiple ways to initialize relation

    • Initialize as empty
    • Resize existing relation without changing its elements
    • Generate random relation
      • any
      • (left-)total
      • functional (also called right-unique or univalent)
        • bijective
          • involution
          • derangement
      • random relation that is any of the well defined types (equivalence, function, reflexive, lattice etc.)
  • Show whether the specified relation satisfies well-known properties:

    • reflexivity
    • irreflexivity
    • symmetry
    • antisymmetry
    • transitivity
    • asymmetric (<=> antisymmetric and irreflexive)
    • connected
    • acyclic
    • functional
    • (left-)total
      • surjective
      • injective
      • bijective
        • derangement
        • involution
  • Add an explanation for each property, showing why given relation satisfied given property (or not). Highlight relevant elements in explanation

    • reflexive
    • irreflexive
    • symmetric
    • antisymmetric
    • asymmetric
    • transitive
    • connected
    • acyclic
    • functional (also called right-unique or univalent)
    • (left-)total
    • bijection
    • derangement
    • involution
  • Given the properties that it satisfies show whether it is one of well know structures:

    • Equivalence relation
      • show corresponding partition
      • show equivalence classes
    • Preorder
      • show poset arising from identifying equivalent elements
    • Poset
    • Total order
      • highlight incomparable elements if not
    • Lattice
      • Show table of meet and join operations (if not full lattice, show why it fails to be, e.g. 2 elements don't have meet / have multiple minimal elements in upper set)
      • show infimum and supremum-irreducible elements
    • Function
      • Show fixed points
  • For each of the above shows the total number of structures of this kind (with links to OEIS, see counting transitive relations)

  • Provides operations like

    • reflexive closure
    • reflexive reduction
    • symmetric closure
    • transitive closure
    • transitive reduction (only on acyclic graphs)
    • equivalence closure
    • composition (with itself)
    • converse
    • complement
    • strongly connected components (of relation viewed as a graph)
    • topological sort (only on acyclic graphs)
    • calculate concept lattice (induced concept lattice)
      • highlight attribute and object concepts within concept lattice
  • mention properties of various operations (E.g. The union of two transitive relations need not be transitive, but intersection always is; converse and complement preserve symmetry etc.)

  • use inclusion-exclusion principle to show exact numbers of relations within each cocnept of concept lattice or relations

Various interesting facts that could be shown in UI:

  • We can reconstruct the order relation from the lattice operation infimum and supremum by x ≤ y <=> x = x ⋀ y <=> x ⋁ y = y
  • Number of labeled and unlabeled lattices: https://oeis.org/A055512 and https://www.researchgate.net/publication/225384356_Counting_Finite_Lattices
  • Show various powers of the relation (what happens if we keep composing relation with itself?)
  • Identify (lattice) antichain within given lattice
  • Implement a function that (only for posets) gives cover relation
  • There should be bunch of functions like toPoset : Rel -> Maybe Poset, toLattice : Rel -> Maybe Lattice etc., in the spirit of "parse, don't validate" and then there should be operations that are valid e.g. only on lattices
  • Implement a way to generate all posets (find paper?)
  • Implement a way to generate all lattices
  • get better understanding of antichains in posets: https://en.wikipedia.org/wiki/Antichain

About

A hobby project where I learn basic undegraduate math through programming

https://janhrcek.cz/relation-explorer/


Languages

Language:Elm 99.5%Language:Makefile 0.3%Language:Shell 0.2%