martinescardo / hott-uf-agda-lecture-notes Goto Github PK
View Code? Open in Web Editor NEWLecture notes on univalent foundations of mathematics with Agda
License: GNU General Public License v3.0
Lecture notes on univalent foundations of mathematics with Agda
License: GNU General Public License v3.0
HoTT-UF-Agda-Lecture-Notes/HoTT-UF-Agda.lagda
Line 2847 in 07c7078
the last sentence
The exercise for The hlevels are upper closed...
Exercise. Formulate and prove the following. The type π has minimal hlevel 0. The type π has minimal hlevel 1, the type β has minimal hlevel 2. More ambitiously, after univalence is available, show that the type of monoids has minimal hlevel 3.
...contains spoilers for the exercise for β is a set.
Exercise. Prove that the types of magmas, monoids and groups have hlevel 3 (they are 1-groupoids) but not hlevel 2 (they are not sets). Prove that this is their minimal hlevel. It is possible to do this what what we have learned so far?
Moreover, the latter is directly followed by the former in the text.
HoTT-UF-Agda-Lecture-Notes/HoTT-UF-Agda.lagda
Line 688 in f394163
Follow the pattern of presenting recursion as the particular case of induction, for reading,
it might be better to say, another name for this is π-recursion
. Maybe first than these names is-empty
and negation.
Hedberg : {X : π€ Μ } (x : X)
β ((y : X) β collapsible (x β‘ y))
β (y : X) β is-subsingleton (x β‘ y)
Hedberg {π€} {X} x c y p q =
p β‘β¨ a y p β©
f x (refl x)β»ΒΉ β f y p β‘β¨ ap (Ξ» - β (f x (refl x))β»ΒΉ β -) (ΞΊ y p q) β©
f x (refl x)β»ΒΉ β f y q β‘β¨ (a y q)β»ΒΉ β©
q β
where
f : (y : X) β x β‘ y β x β‘ y
f y = collapser (x β‘ y) (c y)
ΞΊ : (y : X) (p q : x β‘ y) β f y p β‘ f y q
ΞΊ y = collapser-wconstancy (x β‘ y) (c y)
a : (y : X) (p : x β‘ y) β p β‘ (f x (refl x))β»ΒΉ β f y p
a x (refl x) = (β»ΒΉ-leftβ (f x (refl x)))β»ΒΉ
The above is quite difficult to understand, so I decided to play with it in Agda in order to gain a deepen my understanding. I tried proving it myself and here is the first thing I tried.
Hedberg' : {X : π€ Μ } (x : X)
β ((y : X) β collapsible (x β‘ y))
β (y : X) β is-subsingleton (x β‘ y)
Hedberg' {π€} {X} x c .x (refl .x) (refl .x) = refl (refl x)
It typechecks. Is there something wrong with proving it like this instead?
Thank you @martinescardo for creating these notes and making them available. One aspect of these notes that I found attractive was being able to follow along in Agda. This is easier if Emacs is using a font which can render all (or most) of the characters used in the notes. It took me some time to find some candidate fonts and I thought I would document my experience below. The goal of this "issue" is to share what I found as a novice Emacs user on Windows 10.
Summary: JuliaMono seems like a nice choice. There may be other choices (such as DejaVu Mono; however on its own it seems to be missing some characters, so it may require a fallback font.)
I'm using running a stock GNU Emacs 29.1 and my .emacs
file consists of code to load agda-mode
.
(load-file (let ((coding-system-for-read 'utf-8))
(shell-command-to-string "agda-mode locate")))
The example Agda file is
{- Unicode: lambda = Ξ», BB "B" = πΉ -}
{-# OPTIONS --without-K --exact-split --safe --auto-inline #-}
module HoTT-UF-Agda where
variable
π€ π₯ π¦ π£ : Universe
data π : π€β Μ where
β : π
π-induction : (A : π β π€βΜ ) β A β β (x : π) β A x
π-induction A a β = a
data π : π€ββΜ where
data β : π€β Μ where
zero : β
succ : β β β
Before setting a font this is what an example file looks like:
I believe the default font used by Chrome for fixed-width text on my machine is Consolas, so I tried it in Emacs by using Options -> Set Default Font. (For all fonts below that's how I will test them.) It looks like:
Better looking blackboard bold "N" but lots of missing characters.
Has all characters but does not seem to be a monospace font:
Has all characters but does not seem monospaced:
I also tried Lucida Console but many characters were missing.
Has all characters and is monospaced:
Above was 10pt; perhaps looks better at 12pt:
JuliaMono seemed to work best. I added the following to my .emacs
(based on Fonts in Emacs):
(set-face-attribute 'default nil
:family "JuliaMono"
:height 120
:weight 'normal
:width 'normal)
I would be interested in answers to the following questions:
A [magma](https://en.wikipedia.org/wiki/Magma_(algebra)) is a *set* equipped with a binary operation subject to no laws
[[Bourbaki](https://books.google.co.uk/books?id=STS9aZ6F204C&pg=PA1&redir_esc=y#v=onepage&q&f=false)]. We can define the type of magmas in a universe `π€` as follows:
The Google books link is to a copyrighted book and the page does not display for me. Maybe it would be good to change it to something else?
HoTT-UF-Agda-Lecture-Notes/HoTT-UF-Agda.lagda
Line 2481 in d4e5da6
Maybe I missed something at this point. I want to make clear whether this should be
transport A p a β‘ b
HoTT-UF-Agda-Lecture-Notes/HoTT-UF-Agda.lagda
Line 6128 in 06db6ff
for each universe ?
It might be good to split it into multiple modules, or to make it into a library with the exercises placed separately because right now it really does take too long. It would also be good design for the exercises to not have the reader backtrack to them after the later chapters, and instead introduce them after relevant concepts are introduced such as for the 'x β€ y' if and only if 'Ξ£ \(z : β) β x + z β‘ y'
and (x β€ y) β‘ Ξ£ \(z : β) β x + z β‘ y
exercises.
Also I had an issue with figuring out what fonts to use yesterday. Right now I am using DejaVu Sans Mono as the default and Symbola as the fallback. I am wondering what fonts you are using?
Carry out the installation instructions, but instead of
echo 'PATH=$PATH:~/mgs-2019/agda/.cabal-sandbox/bin/ emacs --no-init-file --load ~/mgs-2019/.emacs' >> mgs-emacs
try this:
echo 'PATH=~/mgs-2019/agda/.cabal-sandbox/bin/:$PATH emacs --no-init-file --load ~/mgs-2019/.emacs' >> mgs-emacs
Then, when you launch mgs-emacs
and load a .agda file, you shouldn't get a version conflict between your old agda version (2.5.*) and the new version (2.6) of agda-mode that mgs-emacs is using.
Thanks to pushing the latest Agda to hackage (2.6.0), the following puts you in a shell environment with agda installed. I did not issue a pull request because I am not sure how to fully test it. However it does appear to work with emacs. If you start emacs from within the environment the script that was previously installed in .emacs picks up the latest agda mode that comes with the Agda package.
$ nix-shell -p "haskellPackages.ghcWithPackages (p: [p.Agda])
Note: I am using nixpkgs/master. Not sure when nix-unstable will pick up the new version.
I ran html-proofer on the lecture notes, and it detected various dead links βΒ and, in one case, a link to a subscription-only service, which it's understandably upset about.
<a href="Inhabitedness.html#choice">axiom of choice</a>
<a href="HoTT-UF-Agda.html#equivalence-induction">equivalence induction</a>
<a href="HoTT-UF-Agda.html#hlevels">hlevel</a>
<a href="HoTT-UF-Agda.html#hlevels">singleton type</a>
<a href="Inhabitedness.html#choice">axiom of choice</a>
<a href="MLTT-Agda">MLTT in Agda</a>
<a href="toc.html#contents"><sub>Table of contents β</sub></a>
<a href="toc.html#contents"><sub>Table of contents β</sub></a>
<a href="Inhabitedness.html#choice">axiom of choice</a>
<a href="HoTT-UF-Agda.html#equivalence-induction">equivalence induction</a>
<a href="HoTT-UF-Agda.html#hlevels">hlevel</a>
<a href="HoTT-UF-Agda.html#hlevels">singleton type</a>
<a href="Inhabitedness.html#choice">axiom of choice</a>
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.