Git Product home page Git Product logo

martinescardo / hott-uf-agda-lecture-notes Goto Github PK

View Code? Open in Web Editor NEW
216.0 16.0 18.0 5.94 MB

Lecture notes on univalent foundations of mathematics with Agda

License: GNU General Public License v3.0

Agda 99.28% Shell 0.20% CSS 0.15% Haskell 0.14% HTML 0.04% Ruby 0.01% Makefile 0.15% TeX 0.03%
hott-uf univalent-foundations univalent-mathematics agda homotopy-type-theory mltt martin-lof-type-theory lecture-notes dependent-types univalence-axiom

hott-uf-agda-lecture-notes's People

Contributors

ayberkt avatar martinescardo avatar scott-fleischman avatar tomdjong avatar walck avatar wenkokke avatar williamdemeo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hott-uf-agda-lecture-notes's Issues

Spoilers for exercises in "The hlevels are upper closed"

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.

empty recursion

We give the two names `is-empty` and `Β¬` to the same function now:

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.

What is the purpose of Hedberg's Theorem?

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?

What font to use in Emacs?

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 : β„• β†’ β„•

Default

Before setting a font this is what an example file looks like:
image

Consolas

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:
image

DejaVu Sans Mono

Better looking blackboard bold "N" but lots of missing characters.
image

DejaVu Math TeX Gyre

Has all characters but does not seem to be a monospace font:
image

Lucida Bright

Has all characters but does not seem monospaced:
image

I also tried Lucida Console but many characters were missing.

Monokai

Missing lots of characters:
image

JuliaMono

Has all characters and is monospaced:
image

Above was 10pt; perhaps looks better at 12pt:
image

Conclusion

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)

Questions

I would be interested in answers to the following questions:

  1. Does DejuVu Sans Mono work better for other people?
  2. The Agda code block I included at the start of this renders perfectly in my browser. What font is Chrome actually using?

The Bourbaki Google books link is paywalled

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?

The book takes too long to typecheck

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?

suggestion for users who have an older version of agda already installed

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.

simple way to get agda in nixos/nix now works

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.

Various dead links in the lecture notes

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.

  • ./_site/HoTT-UF-Agda.html
  • ./_site/Universes.html
    • internally linking to MLTT-Agda, which does not exist (line 24)
      <a href="MLTT-Agda">MLTT in Agda</a>
    • internally linking to toc.html#contents, which does not exist (line 16)
      <a href="toc.html#contents"><sub>Table of contents ⇑</sub></a>
    • trying to find hash of toc.html#contents, but /Users/wen/Projects/HoTT-UF-Agda-Lecture-Notes/_site/Universes.html/toc.html does not exist (line 16)
      <a href="toc.html#contents"><sub>Table of contents ⇑</sub></a>
  • ./_site/index.html
    • internally linking to Inhabitedness.html#choice, which does not exist (line 1723)
      <a href="Inhabitedness.html#choice">axiom of choice</a>
    • linking to HoTT-UF-Agda.html#equivalence-induction, but equivalence-induction does not exist (line 4254)
      <a href="HoTT-UF-Agda.html#equivalence-induction">equivalence induction</a>
    • linking to HoTT-UF-Agda.html#hlevels, but hlevels does not exist (line 3247)
      <a href="HoTT-UF-Agda.html#hlevels">hlevel</a>
    • linking to HoTT-UF-Agda.html#hlevels, but hlevels does not exist (line 3245)
      <a href="HoTT-UF-Agda.html#hlevels">singleton type</a>
    • trying to find hash of Inhabitedness.html#choice, but ./_site/index.html/Inhabitedness.html does not exist (line 1723)
      <a href="Inhabitedness.html#choice">axiom of choice</a>

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.