Skip to content

Instantly share code, notes, and snippets.

View gebner's full-sized avatar
🐌
🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌

Gabriel Ebner gebner

🐌
🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌🐌
View GitHub Profile
--- available.txt 2024-02-12 21:24:05.872721696 -0800
- 1 B2T.fst
- 1 Bug3210.fsti
- 1 StaticHeaderAPI.fst
- 1 titles.fsti
- 2 EverParse3d.Actions.BackendFlag.fst
- 2 EverParse3d.Actions.BackendFlagValue.fsti
- 2 ExtractPulseC.fsti
- 2 ExtractSteelC.fsti
- 2 LowParseExamplePair.fst
/- REDUNDANT SIMP LEMMAS.
Some simp lemmas can be derived from other simp lemmas using `by simp`: -/
-- topology/metric_space/hausdorff_distance.lean
#print metric.Hausdorff_dist_closure /- is redundant: by simp [metric.Hausdorff_dist_closure₁, metric.Hausdorff_dist_closureβ‚‚] -/
#print metric.Hausdorff_dist_self_closure /- is redundant: by simp [metric.Hausdorff_dist_self_zero, metric.Hausdorff_dist_closureβ‚‚] -/
#print emetric.Hausdorff_edist_self_closure /- is redundant: by simp [emetric.Hausdorff_edist_self, emetric.Hausdorff_edist_closureβ‚‚] -/
#print emetric.Hausdorff_edist_closure /- is redundant: by simp [emetric.Hausdorff_edist_closure₁, emetric.Hausdorff_edist_closureβ‚‚] -/
-- topology/category/Top/opens.lean
@gebner
gebner / inv_mul_cancel_left.p
Created February 10, 2020 11:20
inv_mul_cancel_left.p
fof(ccanonically__ordered__comm__semiring_o_to__comm__semiring, axiom,
(![X_ga_n2]: (p(ccanonically__ordered__comm__semiring(X_ga_n2)) => p(ccomm__semiring(X_ga_n2))))).
fof(ccanonically__ordered__comm__semiring_o_to__zero__ne__one__class, axiom,
(![X_ga_n3]: (p(ccanonically__ordered__comm__semiring(X_ga_n3)) => p(czero__ne__one__class(X_ga_n3))))).
fof(ccomm__group_o_to__comm__monoid, axiom, (![X_ga_n5]: (p(ccomm__group(X_ga_n5)) => p(ccomm__monoid(X_ga_n5))))).
fof(ccomm__group_o_to__group, axiom, (![X_ga_n6]: (p(ccomm__group(X_ga_n6)) => p(cgroup(X_ga_n6))))).
@gebner
gebner / char_zero_lt_d800.txt
Created January 7, 2018 15:26
char_zero_lt_d800.txt
1 #NS 0 u
2 #NS 0 eq
3 #NS 0 Ξ±
1 #UP 1
0 #ES 1
4 #NS 0 a
1 #EV 0
2 #EV 1
3 #ES 0
4 #EP #BD 4 2 3
@gebner
gebner / syntax2.lean
Created July 14, 2017 20:25
Proposed syntax tree data structure for Lean
/- syntax -/
structure position :=
(line : β„•) (column : β„•)
structure range :=
(left : position) (right : position)
structure location :=
(file : string) (range : range)
import data.stream
universes u
/-
coinductive alternating : stream bool β†’ Prop
| f : βˆ€ s, alternating (ff :: s) β†’ alternating (tt :: ff :: s)
| t : βˆ€ s, alternating (tt :: s) β†’ alternating (ff :: tt :: s)
-/
@gebner
gebner / parser2.lean
Created April 1, 2017 14:51
Parser combinators for char_buffers
import data.buffer
universes u v
inductive parse_result (Ξ± : Type u)
| done (pos : β„•) (result : Ξ±) : parse_result
| fail (pos : β„•) (expected : list (unit β†’ string)) : parse_result
def parser (Ξ± : Type u) :=
βˆ€ (input : char_buffer) (start : β„•), parse_result Ξ±
@gebner
gebner / hash_map_lens.lean
Last active March 14, 2017 13:42
nbuckets lens for hash_map
import data.hash_map
universes u v w
def lens (Ξ± Ξ² : Type u) :=
βˆ€ (f : Type u β†’ Type w) [functor f], (Ξ² β†’ f Ξ²) β†’ (Ξ± β†’ f Ξ±)
def lens.compose {Ξ± Ξ² Ξ΄ : Type u} (lβ‚‚ : lens Ξ± Ξ²) (l₁ : lens Ξ² Ξ΄): lens Ξ± Ξ΄ :=
Ξ» f h, @lβ‚‚ f h ∘ @l₁ f h
instance : applicative id :=
-- standard setup
lemma they_are_isomorphic (x : false) : β„• = (β„• Γ— β„•) :=
by contradiction
def repack (x : unit β†’ false) (y : β„•) : β„• Γ— β„• :=
cast (they_are_isomorphic (x ())) y
def proj_nat (x : unit β†’ false) : β„• β†’ β„• :=
prod.fst ∘ repack x
import data.stream
open list
def list_rev_bench (size : β„•) : β„• :=
head $ stream.iterate reverse (iota (10*size)) size
vm_eval let size := 1200 in
timeit ("list_rev_bench " ++ size^.to_string ++ ":") (list_rev_bench size)