3abc / cubicaltt Goto Github PK
View Code? Open in Web Editor NEWThis project forked from mortberg/cubicaltt
Experimental implementation of Cubical Type Theory
Home Page: https://arxiv.org/abs/1611.02108
License: MIT License
This project forked from mortberg/cubicaltt
Experimental implementation of Cubical Type Theory
Home Page: https://arxiv.org/abs/1611.02108
License: MIT License
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.