Skip to content

Instantly share code, notes, and snippets.

View jcommelin's full-sized avatar

Johan Commelin jcommelin

View GitHub Profile
@jcommelin
jcommelin / howto_lean_with_elan.md
Last active June 17, 2024 15:18
Getting started with Lean, mathlib, and elan
@jcommelin
jcommelin / five_lemma_statement.lean
Last active April 24, 2018 12:30
Proposed statement of the five lemma
import tactic
import tactic.find
import init.function
import algebra.group
import group_theory.subgroup
open function
section five_lemma
@jcommelin
jcommelin / five_lemma.lean
Last active April 24, 2018 14:33
Proof of the five lemma in Lean
import tactic
import tactic.find
import init.function
import algebra.group
import group_theory.subgroup
open function
section five_lemma
@jcommelin
jcommelin / delta_ring.lean
Last active July 20, 2018 13:20
delta rings
import data.nat.prime
import algebra.group_power
import tactic.ring
universes u v
namespace nat
class Prime :=
(p : ℕ) (pp : nat.prime p)
@jcommelin
jcommelin / witt_vector.lean
Created July 24, 2018 14:51
start on witt vectors
import data.nat.prime
import algebra.group_power
import tactic.ring
import linear_algebra.multivariate_polynomial
import ring_theory.localization
universes u v w u₁
-- ### FOR_MATHLIB
-- everything in this section should move to other files
@jcommelin
jcommelin / eckmann_hilton.lean
Last active July 18, 2024 07:38
Eckmann–Hilton in Lean
-- Written by Johan Commelin; golfed by Kenny Lau
import tactic.interactive
universe u
namespace eckmann_hilton
variables (X : Type u)
local notation a `<`m`>` b := @has_mul.mul X m a b
@jcommelin
jcommelin / subst.py
Created October 9, 2018 12:11
Apply replacement script on file
#!/bin/python3
### Read a replacement script from stdin
### Read a filename from commandline args
### Output to stdout
### Replacement script has the following form
# ----eofmarker
# line:col:line:col
@jcommelin
jcommelin / open_set_basis.lean
Created October 16, 2018 12:16
Basis of open_set
import category_theory.examples.topological_spaces
import order.lattice order.galois_connection
import category_theory.tactics.obviously
universes u v
open category_theory
open category_theory.examples
namespace open_set
@jcommelin
jcommelin / derive_bundled.lean
Last active April 8, 2019 20:22
Derive bundled
-- Big thanks to Simon Hudon for dictating this file to me
-- and explaining what's going on!
import category_theory.concrete_category
namespace string
def camel_case (s : string) : string :=
(join $ split (λ c, c = '_') s) ++ "'"
-- TODO make first char uppercase of each elem in list
import data.real.basic
structure complex :=
(re : ℝ)
(im : ℝ)
-- type ℝ as \R
-- type ℂ as \com or \Com
notation `ℂ` := complex