This commit is contained in:
parent
970a8b6e9f
commit
e31a8ba367
5 changed files with 87 additions and 5 deletions
|
@ -1,5 +1,7 @@
|
|||
@import "footer";
|
||||
|
||||
$breakpoint: 720px;
|
||||
|
||||
html {
|
||||
min-height: 100vh;
|
||||
margin: 0;
|
||||
|
@ -68,7 +70,8 @@ footer {
|
|||
|
||||
.side-nav .side-nav-content {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
justify-content: center;
|
||||
gap: 20px;
|
||||
|
||||
.me {
|
||||
display: flex;
|
||||
|
@ -91,7 +94,7 @@ footer {
|
|||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 672px) {
|
||||
@media screen and (max-width: $breakpoint) {
|
||||
.flex-wrapper {
|
||||
flex-direction: column;
|
||||
.container {
|
||||
|
@ -116,6 +119,7 @@ footer {
|
|||
.portrait {
|
||||
max-height: 80px;
|
||||
}
|
||||
|
||||
.bio {
|
||||
display: none;
|
||||
}
|
||||
|
@ -123,7 +127,7 @@ footer {
|
|||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 672px) {
|
||||
@media screen and (min-width: $breakpoint) {
|
||||
.flex-wrapper {
|
||||
flex-direction: row;
|
||||
.container {
|
||||
|
@ -137,7 +141,8 @@ footer {
|
|||
left: 0;
|
||||
top: 0;
|
||||
// Capital Min to avoid invoking SCSS min
|
||||
max-width: Min(30%, 30em);
|
||||
width: 30%;
|
||||
min-width: 300px;
|
||||
|
||||
.side-nav-content {
|
||||
padding-top: 32px;
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
name: blog
|
||||
depend: standard-library
|
||||
depend: standard-library cubical
|
||||
include: content/posts
|
||||
|
|
75
content/posts/2023-02-04-proving-true-from-false.lagda.md
Normal file
75
content/posts/2023-02-04-proving-true-from-false.lagda.md
Normal file
|
@ -0,0 +1,75 @@
|
|||
+++
|
||||
title = "Proving true from false"
|
||||
slug = "proving-true-from-false"
|
||||
date = 2023-02-04
|
||||
tags = ["type-theory"]
|
||||
math = true
|
||||
draft = true
|
||||
+++
|
||||
|
||||
<details>
|
||||
<summary>Imports</summary>
|
||||
|
||||
These are some imports that are required for code on this page to work properly.
|
||||
|
||||
```agda
|
||||
{-# OPTIONS --cubical #-}
|
||||
|
||||
open import Cubical.Foundations.Prelude
|
||||
open import Data.Bool
|
||||
open import Data.Unit
|
||||
open import Data.Empty
|
||||
|
||||
¬_ : Set → Set
|
||||
¬ A = A → ⊥
|
||||
|
||||
_≢_ : ∀ {A : Set} → A → A → Set
|
||||
x ≢ y = ¬ (x ≡ y)
|
||||
```
|
||||
</details>
|
||||
|
||||
Let's say you wanted to prove that `true` and `false` diverge, a.k.a are not
|
||||
equal to each other. In a theorem prover like Agda, you could write this
|
||||
statement as something like this:
|
||||
|
||||
```
|
||||
true≢false : true ≢ false
|
||||
```
|
||||
|
||||
For many "obvious" statements, it suffices to just write `refl` since the two
|
||||
sides are trivially true via rewriting. For example:
|
||||
|
||||
```
|
||||
open import Data.Nat
|
||||
1+2≡3 : 1 + 2 ≡ 3
|
||||
1+2≡3 = refl
|
||||
```
|
||||
|
||||
However, in cubical Agda, this following statement doesn't work. I've commented
|
||||
it out so the code on this page can continue to compile.
|
||||
|
||||
```
|
||||
-- true≢false = refl
|
||||
```
|
||||
|
||||
It looks like it's not obvious to the interpreter that this statement is
|
||||
actually true. Why is this?
|
||||
|
||||
Well, in homotopy type theory, TODO
|
||||
|
||||
The strategy here is we define some kind of "type-map". Every time we see true,
|
||||
we'll map it to some type, and every time we see false, we'll map it to empty.
|
||||
|
||||
Because the `≢` type actually means "having `a ≡ b` can produce `⊥`", all we
|
||||
need to do is to produce an empty type. To do this, we need to do something
|
||||
called _transport_.
|
||||
|
||||
In homotopy type theory, is a way of generating functions out of paths.
|
||||
|
||||
```
|
||||
bool-map : Bool → Type
|
||||
bool-map true = ⊤
|
||||
bool-map false = ⊥
|
||||
|
||||
true≢false p = transport (λ i → bool-map (p i)) tt
|
||||
```
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
{{ if .IsHome }}
|
||||
<link rel="me" href="https://fosstodon.org/@mzhang" />
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="/index.xml" />
|
||||
{{ end }}
|
||||
|
||||
{{ $style := resources.Get "sass/main.scss" | resources.ToCSS }}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bio">
|
||||
{{ os.ReadFile "layouts/partials/left-nav.md" | .RenderString }}
|
||||
|
||||
|
|
Loading…
Reference in a new issue