Skip to content

Instantly share code, notes, and snippets.

View jcommelin's full-sized avatar

Johan Commelin jcommelin

View GitHub Profile
{ "nodes" :
[{ "name" : "partial_order",
"topic" : "core",
"file" : "core/init/algebra/order.lean",
"line" : 26 }
, { "name" : "has_ssubset",
"topic" : "core",
"file" : "core/init/core.lean",
"line" : 340 }
{ "nodes" :
[{ "name" : "partial_order",
"topic" : "core",
"file" : "core/init/algebra/order.lean",
"line" : 26 }
, { "name" : "has_coe_t_aux",
"topic" : "core",
"file" : "core/init/coe.lean",
"line" : 123 }
@jcommelin
jcommelin / freek.yaml
Last active May 15, 2020 09:09
freek.yaml, initial version
freek:
1:
- title : The Irrationality of the Square Root of 2
- decl : irr_sqrt_two
- author : mathlib
2:
- title : Fundamental Theorem of Algebra
- decl : exists_root
- author : Chris Hughes
3:
@jcommelin
jcommelin / wolf_geit_kool.lean
Created August 31, 2019 18:23
De wolf, geit en kool puzzel
import data.list.basic
/-
Om het spel te spelen moet u helemaal naar beneden scrollen.
Daar vindt u meer uitleg.
De volgende code is een gedeeltelijke vertaling van code
die geschreven is door Mario Carneiro.
-/
@jcommelin
jcommelin / vieta.lean
Last active October 17, 2020 17:50
Constant descent Vieta jumping
import data.rat.basic
import tactic.linarith
import tactic.omega
import tactic.wlog
local attribute [instance] classical.prop_decidable
local attribute [simp] nat.pow_two
section for_mathlib
@jcommelin
jcommelin / wf_inv.lean
Created July 12, 2019 12:14
Stuck on defining the inverse of a power series using well-founded recursion
import data.finsupp order.complete_lattice algebra.ordered_group data.mv_polynomial
import algebra.order_functions
namespace multiset
variables {α : Type*} [decidable_eq α]
def to_finsupp (s : multiset α) : α →₀ ℕ :=
{ support := s.to_finset,
to_fun := λ a, s.count a,
mem_support_to_fun := λ a,
@jcommelin
jcommelin / mv_polynomial_coeff_mul.lean
Last active July 9, 2019 14:20
mv_polynomial.coeff_mul
/-
Copyright (c) 2019 Johan Commelin. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johan Commelin, Kenny Lau
-/
import data.finsupp order.complete_lattice algebra.ordered_group data.mv_polynomial
namespace eq
variables {α : Type*} {a b : α}
import data.real.basic
structure complex :=
(re : ℝ)
(im : ℝ)
-- type ℝ as \R
-- type ℂ as \com or \Com
notation `ℂ` := complex
@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
@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