Code Monkey home page Code Monkey logo

cubicaltt's People

Contributors

5ht avatar abooij avatar cangiuli avatar cohencyril avatar coquand avatar dangrayson avatar david-christiansen avatar dlicata335 avatar favonia avatar georgydunaev avatar linusbo avatar mikeshulman avatar mortberg avatar nad avatar rafaelbocquet avatar rotsor avatar simhu avatar sobernard avatar vlopezj avatar xekoukou avatar

Watchers

 avatar

cubicaltt's Issues

An idea to simplify terms: flow

Here is something we can do to simplify terms and thus moving closer to computing the Brunerie's number, as an example I will do it by hand for the term test0To3 below.

open import Cubical.HITs.Everything public

p0 : (i j k : I)  join S¹ S¹ -- normal form of test0To3
p0 i j k = hcomp (λ l  λ { (i = i0)  hcomp (λ m  λ { (j = i0)  push base base (~ m ∧ ~ l)
                                                      ; (j = i1)  push base base (~ m ∧ ~ l)
                                                      ; (l = i0)  push (loop j) base (~ m)
                                                      ; (l = i1)  inl base
                                                      })
                                             (push base base (~ l))
                          ; (i = i1)  push base (loop k) (~ l)
                          ; (j = i0)  push base (loop k) (i ∧ ~ l)
                          ; (j = i1)  push base (loop k) (i ∧ ~ l)
                          ; (k = i0)  hcomp (λ m  λ { (i = i1)  push base base (~ l)
                                                      ; (j = i0)  push base base ((i ∨ ~ m) ∧ (~ l))
                                                      ; (j = i1)  push base base ((i ∨ ~ m) ∧ (~ l))
                                                      ; (l = i0)  push (loop j) base (i ∨ ~ m)
                                                      ; (l = i1)  inl base})
                                             (push base base (~ l))
                          ; (k = i1)  hcomp (λ m  λ { (i = i1)  push base base (~ l)
                                                      ; (j = i0)  push base base ((i ∨ ~ m) ∧ (~ l))
                                                      ; (j = i1)  push base base ((i ∨ ~ m) ∧ (~ l))
                                                      ; (l = i0)  push (loop j) base (i ∨ ~ m)
                                                      ; (l = i1)  inl base})
                                             (push base base (~ l))
                          }) (push (loop j) (loop k) i)

Above is the normal form of test0To3 in Agda.

Now let's add a variable z and write down the following term:

p : (i j k z : I)  join S¹ S¹
p i j k z = hcomp (λ l  λ { (i = i0)  hcomp (λ m  λ { (j = i0)  push base base (~ m ∧ ~ l ∨ z)
                                                       ; (j = i1)  push base base (~ m ∧ ~ l ∨ z)
                                                       ; (l = i0)  push (loop j) base (~ m)
                                                       ; (l = i1)  push base base (~ m ∧ z)
                                                       })
                                              (push base base (~ l ∨ z))
                           ; (i = i1)  push base (loop k) (~ l ∨ z)
                           ; (j = i0)  push base (loop k) (i ∧ ~ l ∨ z)
                           ; (j = i1)  push base (loop k) (i ∧ ~ l ∨ z)
                           ; (k = i0)  hcomp (λ m  λ { (i = i1)  push base base (~ l ∨ z)
                                                       ; (j = i0)  push base base ((i ∨ ~ m) ∧ (~ l ∨ z))
                                                       ; (j = i1)  push base base ((i ∨ ~ m) ∧ (~ l ∨ z))
                                                       ; (l = i0)  push (loop j) base (i ∨ ~ m)
                                                       ; (l = i1)  push base base ((i ∨ ~ m) ∧ z)})
                                              (push base base (~ l ∨ z))
                           ; (k = i1)  hcomp (λ m  λ { (i = i1)  push base base (~ l ∨ z)
                                                       ; (j = i0)  push base base ((i ∨ ~ m) ∧ (~ l ∨ z))
                                                       ; (j = i1)  push base base ((i ∨ ~ m) ∧ (~ l ∨ z))
                                                       ; (l = i0)  push (loop j) base (i ∨ ~ m)
                                                       ; (l = i1)  push base base ((i ∨ ~ m) ∧ z)})
                                              (push base base (~ l ∨ z))
                           }) (push (loop j) (loop k) i)

The idea is, when z = i0, it's the same as p0 above. And when z = i1, we don't know what it will be, but as it's mostly of the form - ∨ z, it will be simpler when z = i1 since i1 dominates when we compute .

What is it when z = i1? Well it's

p1 : (i j k : I)  join S¹ S¹
p1 i j k = hcomp (λ l  λ { (i = i0)  hcomp (λ m  λ { (j = i0)  push base base (~ m)
                                                      ; (j = i1)  push base base (~ m)
                                                      ; (l = i0)  push (loop j) base (~ m)
                                                      ; (l = i1)  push base base (~ m)
                                                      })
                                             (inr base)
                           ; (i = i1)  inr (loop k)
                           ; (j = i0)  push base (loop k) i
                           ; (j = i1)  push base (loop k) i
                           ; (k = i0)  hcomp (λ m  λ { (i = i1)  inr base
                                                       ; (j = i0)  push base base (i ∨ ~ m)
                                                       ; (j = i1)  push base base (i ∨ ~ m)
                                                       ; (l = i0)  push (loop j) base (i ∨ ~ m)
                                                       ; (l = i1)  push base base (i ∨ ~ m)})
                                              (inr base)
                           ; (k = i1)  hcomp (λ m  λ { (i = i1)  inr base
                                                       ; (j = i0)  push base base (i ∨ ~ m)
                                                       ; (j = i1)  push base base (i ∨ ~ m)
                                                       ; (l = i0)  push (loop j) base (i ∨ ~ m)
                                                       ; (l = i1)  push base base (i ∨ ~ m)})
                                              (inr base)
                           }) (push (loop j) (loop k) i)

I hope you agree this is actually (slightly) simpler! If we replace some hcomp by hfill (with the variable) maybe we can even remove some hcomp's. However in the example above end points no longer match so it's not a term in Ω³ (it's because I allowed those related to (l = i1) to flow). But we can write a (Agda or Haskell) program to keep trying various possibilities and measure the complexity of the results, so in the end we let the term "flow" to a simpler one.

I think this should be doable for test0To3 or test0To4, they are kinda small but still too complicated for human.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.