Skip to content

Instantly share code, notes, and snippets.

@soonhokong
soonhokong / small_exercises.lean
Created October 29, 2014 15:37
Small Exercises
-- Theorems/Exercises from "Logical Investigations, with the Nuprl Proof Assistant"
-- by Robert L. Constable and Anne Trostle
-- http://www.nuprl.org/MathLibrary/LogicalInvestigations/
import logic
-- 2. The Minimal Implicational Calculus
theorem thm1 {A B : Prop} : A → B → A :=
assume Ha Hb, Ha
theorem thm2 {A B C : Prop} : (A → B) → (A → B → C) → (A → C) :=
@soonhokong
soonhokong / nt_compose.lean
Last active August 29, 2015 14:08
Composition of Natural Transformation
import algebra.category.functor
open category eq eq.ops functor
inductive natural_transformation {C D : Category} (F G : C ⇒ D) : Type :=
mk : Π (η : Π(a : C), hom (F a) (G a)), (Π{a b : C} (f : hom a b), G f ∘ η a = η b ∘ F f)
→ natural_transformation F G
infixl `⟹`:25 := natural_transformation -- \==>
namespace natural_transformation
@soonhokong
soonhokong / init.el
Last active September 14, 2020 06:01
Emacs Configuration for Windows
;; Package
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(package-refresh-contents)
;; Install required/optional packages for lean-mode
(defvar lean-mode-required-packages
'(company dash dash-functional flycheck whitespace-cleanup-mode
@soonhokong
soonhokong / .gitconfig.md
Last active August 29, 2015 14:01
.gitconfig
[apply]
  whitespace = nowarn

[core]
        whitespace = trailing-space, space-before-tab
        autocrlf = input

[alias]
  a = "add"
@soonhokong
soonhokong / How_we_take_photos_at_GHC9232.md
Last active August 29, 2015 14:01
How we take photos at GHC9232

takeshot.sh

We are using imagesnap program to take a photo from command-line. On OSX, you can install it via homebrew.

#!/usr/bin/env bash
@soonhokong
soonhokong / how_to_copy_between_repos.md
Last active August 29, 2015 14:01
how do we copy files between repositories without losing the history?

Scenario

  • We want to move all files under library/hott in leanprover/library repo to src/library/hott in leanprover/lean repo.
  • We want to preserve the commit history of leanprover/library during the migration.

Solution

I assume that leanprover/lean repo is already cloned at ~/work/lean.