chars
int64
40
24k
content_type
stringclasses
9 values
id
stringlengths
13
64
source
stringclasses
5 values
subset
stringclasses
31 values
text
stringlengths
40
24k
2,349
lean_file_chunk
d2ed506f6322f75c3a4d3653d10c81d35761c77a04c463844a5a5dbc5e45d869
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg -/ module public import Lean.Data.PersistentHashMap @[expose] public section namespace Lean.PersistentHashMap variable [BEq α] [Hashable α] /-- Builds a `Persistent...
567
lean_file_chunk
13d975934f9897a55ab8d54141d6afe1c42bbc4cfb93877cd32246ee59a11fa7
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg -/ module public import Lean.Util.MonadBacktrack @[expose] public section namespace Lean /-- Execute the action `x`, then restore the initial state. Returns the stat...
832
lean_file_chunk
db6b4ebe8b4bfbed772eaf7b4b7da1b6a241915da7f6147f435649f5bebc6def
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg -/ module public import Std.Data.HashSet.Basic @[expose] public section namespace Std.HashSet variable [BEq α] [Hashable α] /-- `O(n)`. Returns `true` if `f` return...
3,664
lean_file_chunk
65634c807e62a8b6375ab1f033ba8cf8a022a4c637ca740b5f3a8a94db409c09
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ module public import Lean.Elab.Term public import Lean.Elab.Binders @[expose] public section /-! # Additional operations on Expr and related types This file defin...
4,534
lean_file_chunk
99e8f71f93bcac3d074e180b9ddcb233d7a951b0298bfe9d5db4458a1432e958
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ module public import Batteries.Lean.TagAttribute public import Std.Data.HashMap.Basic @[expose] public section open Lean namespace Lean open Std /-- `TagAttribu...
4,820
lean_file_chunk
f04c1216502a43bc55ab672d49a81c08ee0b62f09c17197d7605bbf8c8772c8d
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Thomas R. Murrills -/ module public import Lean.Syntax public import Lean.Data.Lsp.Utf16 public section namespace Lean /-- Return the beginning of the line contatin...
4,023
lean_file_chunk
e7627927fd52532bf7ec270d75b19d60494d1705a53b01ea3188b2731b99bf45
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Gabriel Ebner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner -/ module public meta import Lean.Elab.Command public meta section /-! # Define the `library_note` command. -/ namespace Batteries.Util open Lean /-- A library note ...
6,846
lean_file_chunk
0c8dd617c4537e6276d5304e84d20375b301b4e108bbbdd0df037f2f2c428fe2
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2021 Gabriel Ebner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner -/ module public import Lean.Meta.DiscrTree @[expose] public section /-! # Once-per-file cache for tactics This file defines cache data structures for tactics that are...
1,596
lean_file_chunk
9fe8c250d29a9ac41a7b37f75ebf0562b493df2f299f605c2d425d6188eeb06c
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ module public import Lean.Environment @[expose] public section /-! # Pickling and unpickling objects By abusing `saveModuleData` and `readModuleData` we can pickl...
2,183
lean_file_chunk
a0dadd4bf2816b294d145873f2e49af2d070618cab96faf16402ae51525edb0f
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2021 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner -/ module @[expose] public section /-! Defines an extended binder syntax supporting `∀ ε > 0, ...` etc. -/ namespace Batteries.ExtendedBinder open Lean -- We ...
1,592
lean_file_chunk
974547be3e062f54ec8b789a232bbb91524411529244b74a88afccac8e27fb33
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Thrane Christiansen -/ module public meta import Lean.Elab.Exception public meta import Lean.Elab.Command public meta section open Lean Parser Elab Command /-- This proof wou...
398
lean_file_chunk
daa7786be8a6f8c7e9ac3e8b0c14783659cca947e3d0bdb586397746cab37a07
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2024 François G. Dorais. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: François G. Dorais -/ module @[expose] public section namespace Batteries /-- Panic with a specific default value `v`. -/ def panicWith (v : α) (msg : String) : α := @panic α ⟨v...
6,634
lean_file_chunk
76f9e8314d1945778b0c56c4c386b04332cd95b9a16c77e76a0a3aa092aa09b9
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ module public meta import Lean.Elab.Command public meta import Batteries.Lean.AttributeExtra public meta import Lean.Linter.Basic public meta section namespace Bat...
4,886
lean_file_chunk
4cd19cf881488a45687bfcde807e0febcc46bf085c50eaa227cd8d0fe9bd6c9b
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ module public meta import Lean.Elab.Command public meta import Lean.Parser.Syntax public meta import Init.Try public meta import Batteries.Tactic.Unreachable public ...
17,547
lean_file_chunk
94ac6b8bd4056610647caf9536b29af05bdf696b5928ebcafc2ba78dd401c103
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ module public import Batteries.Classes.Order @[expose] public section /-! Deprecated Batteries comparison classes Examples are to ensure that old instances have e...
12,211
lean_file_chunk
07c18611c4d0d966f59d6793e35146f223a4c10cc124293603738932971dfcb5
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ module public import Batteries.Tactic.Basic public import Batteries.Tactic.SeqFocus @[expose] public section theorem lexOrd_def [Ord α] [Ord β] : (lexOrd : Ord...
12,704
lean_file_chunk
a0a5cad4a464862150e9083fb76de8c407331479c6109082190ab8823b98013a
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kim Morrison -/ module public import Batteries.Lean.EStateM public import Batteries.Lean.Except @[expose] public section /-! ## SatisfiesM The `SatisfiesM` predicat...
918
lean_file_chunk
efb8dede004f4ea5e500d956845b548f60a6cb38b94ad0270bdba577e1f28b95
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2014 Robert Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Lewis, Leonardo de Moura, Johannes Hölzl, Mario Carneiro, Gabriel Ebner -/ module @[expose] public section /-- Type class for the canonical homomorphism `Rat → K`. -/ class RatC...
822
lean_file_chunk
c716ef335692f48a905318060a1a33595b2eed5ee0a99439e0442a7705d6cb91
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2014 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Gabriel Ebner -/ module public import Batteries.Util.LibraryNote @[expose] public section library_note "coercion into rings" /-- Coercions such as `Nat.castCoe` that...
2,640
lean_file_chunk
210f85dd9eba66f2557182cf89f2f879f82203fbc337cf671d361eef30e9c907
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ module public meta import Lean.Server.CodeActions.Provider public meta section /-! # Code action for @[deprecated] replacements This is an opt-in mechanism for ma...
5,822
lean_file_chunk
06209f501607a5867d73d16d41e2e12a592b20a605c2ecb4f3b56ea3d0cbc523
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ module public import Lean.Server.CodeActions.Basic public import Lean.Compiler.IR.CompilerM @[expose] public section /-! # Initial setup for code action attributes...
3,022
lean_file_chunk
aa3fe92ed1b88ea70ee55431b5087024bf66b4e8e3346ea6777b800cc2cd1e97
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ module public meta import Lean.Elab.BuiltinTerm public meta import Lean.Elab.BuiltinNotation public meta import Lean.Server.InfoUtils public meta import Lean.Server....
18,039
lean_file_chunk
5dbd3593058fefe9ae04a106dec1e8ff212a0def6084097e7896103b50733b1e
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ module public meta import Lean.Elab.Tactic.Induction public meta import Batteries.Lean.Position public meta import Batteries.CodeAction.Attr public meta import Lean....
12,604
lean_file_chunk
3e80c80396d3e154f9b181210ff9702bdd666b2882a7515769b7a1be7415ef64
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2026 Moritz Roos. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Moritz Roos -/ module public meta import Batteries.CodeAction.Misc public meta import Batteries.Data.List.Basic @[expose] public meta section namespace Batteries.CodeAction open Lean ...
2,054
lean_file_chunk
cf538c180a3fbbc6cba2586ff6af8f5f3e355f225e565646513214ce6003e177
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2025 François G. Dorais. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: François G. Dorais -/ module public import Init.Data.Nat section /-! # Running Statistics This module implements Welford's one-pass algorithm for calculating the mean and stand...
227
lean_file_chunk
6192685a999091f153844fc7ee610fcb024b920898b9cf789503d599712fe7d9
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.String.AsciiCasing public import Batteries.Data.String.Basic public import Batteries.Data.String.Legacy public import Batteries.Data.String.Lemmas public import Batteries.Data.String.Matcher
210
lean_file_chunk
33c4209d4144fac6cbdc12963ea17e29190811a5f07969e5455d8f2e2c7ba1e5
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.RBMap.Alter public import Batteries.Data.RBMap.Basic public import Batteries.Data.RBMap.Depth public import Batteries.Data.RBMap.Lemmas public import Batteries.Data.RBMap.WF
164
lean_file_chunk
060af3605f5c008eef27405ecf33f57548364c4e7f420f0007fd21341272a8b3
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.Fin.Basic public import Batteries.Data.Fin.Fold public import Batteries.Data.Fin.Lemmas public import Batteries.Data.Fin.OfBits
1,969
lean_file_chunk
fc65c8d4e8e342b2f573f69eadf8df8c4472b586acc37e95c409c2c5fd90e3f3
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2025 François G. Dorais. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: François G. Dorais -/ module public import Batteries.Data.Nat.Lemmas @[expose] public section namespace Int /-- `testBit m n` returns whether the `(n+1)` least significant bit ...
46
lean_file_chunk
591138eaf7b0440d4b7dc068e7f671612397295ae384009cbffe2895d1f324ee
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.Rat.Float
1,222
lean_file_chunk
99827bfa3f1607d42b1d78a2242186c3e47a4332df76b71f8ea2837fbf333341
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2024 François G. Dorais. All rights reserved. Released under Apache 2. license as described in the file LICENSE. Authors: François G. Dorais -/ module @[expose] public section namespace FloatArray attribute [ext] FloatArray /-- Unsafe optimized implementation of `mapM`. This function is unsafe bec...
422
lean_file_chunk
29738d06b8ef1eacb54d9e5da0d8ee063bdec5c3504a6a1e6590df378258ed0c
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.List.ArrayMap public import Batteries.Data.List.Basic public import Batteries.Data.List.Count public import Batteries.Data.List.Init.Lemmas public import Batteries.Data.List.Lemmas public import Batteries.Data.List.Matcher public import Batteries.Data.List.Monadic public import Batt...
50
lean_file_chunk
bd538748123958c7c49713c63d1f443311b9ed49f0699051d61546075354f198
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.HashMap.Basic
252
lean_file_chunk
e02199012e624ce85dbe302ef69017b231d0e87c155fe590340a27fadba247dc
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.Nat.Basic public import Batteries.Data.Nat.Bisect public import Batteries.Data.Nat.Bitwise public import Batteries.Data.Nat.Bitwise.Lemmas public import Batteries.Data.Nat.Gcd public import Batteries.Data.Nat.Lemmas
92
lean_file_chunk
3af75736d978bd010d9d441550c1596e2abc2d0ca289f1a5685c171cd705acc6
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.BitVec.Basic public import Batteries.Data.BitVec.Lemmas
90
lean_file_chunk
4f8e9de2068ed88d31e631143f6db292e25019ec8686de1dd0e8826a20ed10ae
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.DList.Basic public import Batteries.Data.DList.Lemmas
135
lean_file_chunk
8981c5a7c3b22719df3cd968ab849dfefdc7e933e7937b81f48806d4a9845ef5
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.MLList.Basic public import Batteries.Data.MLList.Heartbeats public import Batteries.Data.MLList.IO
98
lean_file_chunk
77ae68c41075a502f66f5d71b42a2a639db4f6df137d30b710d0adb3c4a6225d
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.UnionFind.Basic public import Batteries.Data.UnionFind.Lemmas
136
lean_file_chunk
0c3a6e5da5761a05818d5117e683efa630811c71137ad1a3828f829a53ff534c
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.Vector.Basic public import Batteries.Data.Vector.Lemmas public import Batteries.Data.Vector.Monadic
644
lean_file_chunk
ad67286675de01294f0712a3a0b34dc91905144649a12f13ac10750158ef61f1
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ module public import Lean.Data.NameMap.Basic @[expose] public section namespace Lean.NameSet instance : Singleton Name NameSet where singleton := fun n => (∅ : Nam...
6,961
lean_file_chunk
8cc5a9654d03e15cd2b6879be41662faa0f62888c47d4b5da99c9ea765227878
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2021 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, François G. Dorais -/ module public import Std.Data.ByteSlice import all Std.Data.ByteSlice -- for unfolding `ByteSlice.size` @[expose] public section namespace Byt...
4,905
lean_file_chunk
1197788199df1af8e22dbe750e9aa1f2749df18518572d4bfc18ca25a769b798
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 François G. Dorais. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: François G. Dorais -/ module @[expose] public section namespace ByteArray attribute [ext] ByteArray instance : DecidableEq ByteArray := fun _ _ => decidable_of_decidable_of_i...
104
lean_file_chunk
5220e793028811b39e84ba5012a1e4b4ab874cd3d5a444e0916e44e905c19884
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.BinomialHeap.Basic public import Batteries.Data.BinomialHeap.Lemmas
14,594
lean_file_chunk
849499a4820550bd0cb2003738057f0f14bc4fc48d8fde95898e6dfac2e3ff23
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Yuyang Zhao. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yuyang Zhao -/ module public import Batteries.Classes.Order @[expose] public section namespace Batteries.PairingHeapImp /-- A `Heap` is the nodes of the pairing heap. Each node have t...
52
lean_file_chunk
917f3a30e49b5dc13e47552f5dcaca56a28df9179942f9b3dc1d999cf06149fb
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.BinaryHeap.Basic
928
lean_file_chunk
65902936946fc73c0741ca92326a9eb487afada9d7254a3f3283a4171e64d5b5
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2026 Chad Sharp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chad Sharp -/ module @[expose] public section /-! This file contains `WellFoundedRelation` instances `Bool`. They are provided as defs rather than instances, despite WellFoundedRelation...
49
lean_file_chunk
16e6c35d547469c0f30c15a08a134a63c24f7d3be256f0959e8d5e7fa5d85b52
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.Range.Lemmas
12,148
lean_file_chunk
864627160da42f06923d3f52ce9172907d63814e5ba67fcccf2c9d5afbc6c5f5
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2019 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Mario Carneiro -/ module public import Batteries.Data.List.Basic @[expose] public section namespace Batteries /-- `AssocList α β` is "the same as" `List (...
93
lean_file_chunk
7e3fc6f152c86f46624e05cc9cbb4f62c3b87b6523dd363121646f744bac66f0
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.Char.AsciiCasing public import Batteries.Data.Char.Basic
346
lean_file_chunk
3b28ab799dc14d5beafa999904af98abfa9522c2c62c3109714245eb6f8bea17
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.Array.Basic public import Batteries.Data.Array.Init.Lemmas public import Batteries.Data.Array.Lemmas public import Batteries.Data.Array.Match public import Batteries.Data.Array.Merge public import Batteries.Data.Array.Monadic public import Batteries.Data.Array.Pairwise public import...
7,965
lean_file_chunk
e940a5b0f5b4b2d35a22ba45d4eccf4153d26909cc8c2c2965e8307ee48a6d6f
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 François G. Dorais. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: François G. Dorais, Mario Carneiro -/ module public import Batteries.Classes.Order @[expose] public section /-! ### UInt8 -/ @[ext] theorem UInt8.ext : {x y : UInt8} → x.toNat ...
2,872
lean_file_chunk
1a10060f25d77db2e6d16fd0761b2c2fd5279c5bc69b6d94000694222e7319b3
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2024 François G. Dorais. All rights reserved. Released under Apache 2. license as described in the file LICENSE. Authors: François G. Dorais -/ module @[expose] public section namespace Std.Stream /-- Drop up to `n` values from the stream `s`. -/ def drop [Stream σ α] (s : σ) : Nat → σ | 0 => s ...
59
lean_file_chunk
880ca9419d9ad58bb186e0e609b301d1de3bca8b206d79f61f53d65d4b8124d7
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Data.Random.MersenneTwister
2,375
lean_file_chunk
7b407f71c54b48dffe074a58a0cd0de496f11d442ecc0002ebcc2401734b9f2b
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 François G. Dorais. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: François G. Dorais, Eric Wieser -/ module import all Init.Control.Reader import all Init.Control.State @[expose] public section namespace ReaderT attribute [ext] ReaderT.ext @[...
422
lean_file_chunk
018ef0ccdd9cf57ca1d9f3d5355a9b9764e30ed84409c834f4550b009ef93dc9
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2025 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ module public import Batteries.Tactic.Alias @[expose] public section @[deprecated (since := "2025-02-09")] alias LawfulFunctor.map_inj_right_of_nonempty := map_inj_ri...
8,280
lean_file_chunk
25318fe2658f819d5eaa10a80f7d49deef0db0f2f62d02f23a0f1c2ba84c4e9c
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2025 Devon Tuma. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Devon Tuma -/ module public import Batteries.Control.Lemmas public import Batteries.Control.OptionT import all Init.Control.Option import all Init.Control.State import all Init.Control.Re...
9,812
lean_file_chunk
2bcc1403a34c0a3d1d164cdf26aa962e1e339d582cc6d67dbcbc1b0876c79fc8
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2025 Devon Tuma. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Devon Tuma, Quang Dao -/ module import all Init.Control.StateRef @[expose] public section /-! # Laws for Monads with State This file defines a typeclass for `MonadStateOf` with compatib...
1,336
lean_file_chunk
d88871a04d3dc7d76c1bbc3c437acfa0ee335c290d644ade308faf8ea41ffc70
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sebastian Ullrich -/ module public import Batteries.Control.LawfulMonadState import all Init.Control.Option @[expose] public section /-! # Lemmas About Option Monad Transform...
104
lean_file_chunk
0ed6156f665c918b6948ba49d6792d097ba369856468f9920f70a2371701323b
lean_source_file
pkg_batteries_source_file_chunks
module public import Batteries.Control.ForInStep.Basic public import Batteries.Control.ForInStep.Lemmas
1,881
lean_file_chunk
b6e8f0657be1825770a1793718d0c215b33d0c6913ef104439642d1fa99eea7a
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner -/ module public meta import Lean.Meta.Instances public meta import Batteries.Tactic.Lint.Basic public meta section namespace Batteries.Tactic.Lint open Lean Me...
7,068
lean_file_chunk
971d3d9b25999241b5509238e748a76176d227e7b7183faa9b0c4297cbea2650
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Robert Y. Lewis, Gabriel Ebner -/ module public meta import Lean.Structure public meta import Lean.Elab.InfoTree.Main public meta import Lean.Elab.Exception public...
14,514
lean_file_chunk
3472d848ff43c0ca8a53cdf447e8a42877937758421d6ef03eaae4bc7e71afd8
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2020 Gabriel Ebner. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Gabriel Ebner -/ module public meta import Lean.Meta.Tactic.Simp.Main public meta import Batteries.Tactic.Lint.Basic public meta import Batteries.Tactic.OpenPrivate public meta import ...
14,760
lean_file_chunk
2d0a41f69ca9815fd258ef7dc3c32c2ef7315428f48b52e5d8b70ea9b1523c95
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Robert Y. Lewis, Gabriel Ebner -/ module public meta import Lean.Elab.Command public meta import Batteries.Tactic.Lint.Basic public meta section /-! # Linter fro...
13,397
lean_file_chunk
d518d3123ec66674e61f0df0ce2d73e4b914af65f16b4ff9edd9e83c224d3713
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2020 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Robert Y. Lewis, Arthur Paulino, Gabriel Ebner -/ module public meta import Lean.Util.CollectLevelParams public meta import Lean.Util.ForEachExpr public meta impor...
883
lean_file_chunk
47b53b7a3babec066e2f27aac24817680815690c6cdc33b34ed39a58461d502c
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2021 Shing Tak Lam. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Shing Tak Lam, Daniel Selsam, Mario Carneiro -/ module public import Batteries.Tactic.Lint.Misc namespace Lean /-- Find constants in current environment that match find options and p...
1,283
lean_file_chunk
ef8ff04ee7c60e9cc29daa1ee624b20cee8a1a8ba1472bb66f27ecb0dde0078e
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ module @[expose] public section /-! # Running external commands. -/ namespace IO.Process open System (FilePath) /-- Pipe `input` into stdin of the spawned process, t...
2,244
lean_file_chunk
f1ff996a999f3f8a1b896f889c746e300147efb0dbb79d58f3ae2d8b282a4a14
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg -/ module public import Batteries.Lean.Meta.Basic @[expose] public section open Lean Lean.Meta namespace Lean.MVarId /-- Instantiate metavariables in the type of th...
1,621
lean_file_chunk
4a87df583f9af0b2f84531bd654860cf5be4117a0001fce7082b9180ac3ba173
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg -/ module public import Batteries.Lean.Meta.Basic public import Batteries.Lean.MonadBacktrack @[expose] public section namespace Lean.Meta.SavedState /-- Run the act...
5,727
lean_file_chunk
d75c826e3237057b78db91c53758c1107e012740db086788921c6703f4a57038
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Jannis Limperg -/ module public import Lean.Meta.Tactic.Intro public import Batteries.Control.AlternativeMonad import Lean.Meta.SynthInstance public section open Lea...
2,289
lean_file_chunk
8cfc875f43f664235070f6d2b632e9ac2fd5f2382e1355a6fef6e4f504029271
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Gabriel Ebner, Floris van Doorn -/ module public import Lean.Elab.Tactic.Simp public import Batteries.Tactic.OpenPrivate import all Lean.Elab.Tactic.Simp -- for accessing...
2,275
lean_file_chunk
f2a50d54349e4057f1897f92fc32ae4e6e2f785d30e5e65427e59a5cf0b5e694
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg -/ module public import Lean.Meta.Basic @[expose] public section open Lean Lean.Meta Std /-- Obtain the inaccessible fvars from the given local context. An fvar is i...
427
lean_file_chunk
c76eeb21aeb2d73376fb254f94cedf456aaac6afe7eded60b8563dba4eb1b0ac
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg -/ module public import Lean.Expr @[expose] public section namespace Lean.Literal instance : Ord Literal where compare | natVal n₁, natVal n₂ => compare n₁ n₂ ...
4,065
lean_file_chunk
694fd7704ba2f3fc10cbc2b8342a9b7bd00d5f53de4ce2eea3559333f1ee3059
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg -/ module public import Lean.LocalContext public section open Lean Lean.Meta namespace Lean.Name private def parseIndexSuffix (s : String.Slice) : Option Nat := i...
1,748
lean_file_chunk
6a5b8d7051a0745339d98dbaee0f1e093dfb91f05ac0cb21e2778e411300a32e
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg, Kim Morrison -/ module public import Lean.Meta.DiscrTree public import Batteries.Data.Array.Merge public import Batteries.Lean.Meta.Expr public import Batteries.Lean.P...
912
lean_file_chunk
6763b702544ff949c6fc069e30a64a263779099c5de1d62a9e0eac856d52852f
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ module @[expose] public section /-! # Functions for manipulating a list of tasks * `IO.waitAny'` is a wrapper for `IO.waitAny` that also returns the remaining tasks. *...
1,146
lean_file_chunk
6ffb4aee6b16993aaea66515acf4dfe4b70154303559dda03a69713bc443aec7
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ module public import Batteries.Data.BinomialHeap.Basic @[expose] public section namespace Batteries.BinomialHeap namespace Imp theorem Heap.findMin_val : ((s : He...
23,950
lean_file_chunk
4c5f9fb56c9a38fae114609675d6f5a35d4f9df2e1291b26c15fde84d5998e62
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2019 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jannis Limperg, Mario Carneiro -/ module public import Batteries.Classes.Order public import Batteries.Control.ForInStep.Basic @[expose] public section nam...
88
lean_file_chunk
031b7d405a63464a895e64e9c976fd73a89e6c7b2578abfa305e94e2f648fa1f
lean_source_file
pkg_batteries_source_file_chunks
@[inline] def toArrayUnordered (b : BinomialHeap α le) : Array α := b.1.toArrayUnordered
1,803
lean_file_chunk
5320dd15bce5baaba69fc0ed8f87a61ee8dfdce5a8824b576e27136081b36806
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ module public import Batteries.Data.DList.Basic @[expose] public section /-! # Difference list This file provides a few results about `DList`. A differ...
2,768
lean_file_chunk
e63db10c97db8032f9f4999c57f58b2949e04a2f42f74993b5b00d59945ed60f
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2018 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ module @[expose] public section namespace Batteries /-- A difference List is a Function that, given a List, returns the original contents of the differenc...
7,332
lean_file_chunk
b869bbe8712567824f30316d438e8aa9b00ee62f3bceb13eedfc0b679fad7bca
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2025 François G. Dorais. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: François G. Dorais -/ module public import Batteries.Data.Char.Basic public import Batteries.Tactic.Basic @[expose] public section /-! # Lemmas for ASCII-casing These facts app...
6,203
lean_file_chunk
3a85d57163a8b3cd0692686b10c072eb71f5eb8494691b3aa5a84ed31bd34a4b
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg, François G. Dorais -/ module public import Batteries.Classes.Order public import Batteries.Data.List.Lemmas @[expose] public section namespace Char theorem le_antis...
17,236
lean_file_chunk
ff481807691215273d16aee861a7465c6a4bf5ca5c3b27df1df3d218e9dda8b8
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ module public import Batteries.Data.Fin.Basic public import Batteries.Data.Nat.Lemmas public import Batteries.Data.List.Basic public import Batteries.Util.ProofWante...
512
lean_file_chunk
1fa84065744911292f34927f9351b73f37adea75d42407b7c4de01a02437fd42
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2025 François G. Dorais. All rights reserved. Released under Apache 2. license as described in the file LICENSE. Authors: François G. Dorais -/ module public import Batteries.Data.Nat.Lemmas @[expose] public section namespace Fin /-- Construct an element of `Fin (2 ^ n)` from a sequence of bits (li...
5,042
lean_file_chunk
a058de1ec7749d97dc2ea12185fac7c6ba718217c713f66047433e2193a61642
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2017 Robert Y. Lewis. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Robert Y. Lewis, Keeley Hoek, Mario Carneiro, François G. Dorais, Quang Dao -/ module public import Batteries.Data.Nat.Lemmas @[expose] public section namespace Fin /-- `min n m` ...
6,345
lean_file_chunk
a459e770f51de4ba758bffbf4cf42df9497dfbd7295fb2f23aea49caec21831d
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2024 François G. Dorais. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: François G. Dorais, Quang Dao -/ module public import Batteries.Tactic.Alias public import Batteries.Data.Fin.Basic @[expose] public section namespace Fin /-! ### dfoldrM -/ t...
623
lean_file_chunk
0d2ebdf77ee8d3d91891c212625010d586250bcc4698b3cdcd59623f813d28b3
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ module public import Batteries.Lean.System.IO public import Batteries.Data.MLList.Basic @[expose] public section /-! # IO operations using monadic lazy lists. -/ name...
18,985
lean_file_chunk
11e002a827880519bc1007e1c9341591fea9314a07d780a8397d80763a5d5229
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2018 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Keeley Hoek, Simon Hudon, Kim Morrison -/ module public import Batteries.Control.AlternativeMonad public section /-! # Monadic lazy lists. Lazy lists with "laziness" ...
1,270
lean_file_chunk
826e5ba7a909eb60897b298c889c899fb50ee166e2bd495d02e131a1be24a4aa
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 Kim Morrison. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ module public import Batteries.Data.MLList.Basic public import Lean.Util.Heartbeats @[expose] public section /-! # Truncate a `MLList` when running out of available he...
2,256
lean_file_chunk
c821241420bacdf452eb29acfe1c3fea9f27be08d8a9cd2f630fae917b20e3ab
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2021 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Gabriel Ebner -/ module public import Batteries.Data.List.Lemmas @[expose] public section namespace Array @[deprecated forIn_toList (since := "2025-07-01")] theore...
2,421
lean_file_chunk
d34e0dab91aa080555121d6b83de89d88a3c74477b65fc88a959b472591b6d38
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2024 François G. Dorais. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: François G. Dorais -/ module public import Batteries.Tactic.Alias @[expose] public section namespace Array /-- `Pairwise R as` means that all the elements of the array `as` are...
4,123
lean_file_chunk
de6c5c7c8ba97d193611c5121473275f17d2f69acba1460ce6222738d50283e3
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2022 Jannis Limperg. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jannis Limperg -/ module @[expose] public section namespace Array /-- `O(|xs| + |ys|)`. Merge arrays `xs` and `ys`. If the arrays are sorted according to `lt`, then the result is so...
13,334
lean_file_chunk
15f3626c0e492af47bb0b62c15d88e11e684215b9ed443f208b801b9e01bb1b3
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2026 Chad Sharp. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Chad Sharp -/ module public import Batteries.Data.Array.Basic public import Batteries.Data.Array.Lemmas import Batteries.Data.List.Scan import Batteries.Data.List.Lemmas public section ...
8,366
lean_file_chunk
eb9820909aff489f7830081e1457f02abe15ce27e3c0b4a55ccf6e1e49de6215
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2021 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Gabriel Ebner -/ module public import Batteries.Classes.SatisfiesM public import Batteries.Util.ProofWanted import all Init.Data.Array.Basic -- for unfolding `modify...
15,547
lean_file_chunk
8740190605031166c50638cfee7ee9c649a9bdc439878334ae2517a928ff70dd
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2021 Floris van Doorn. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Arthur Paulino, Floris van Doorn, Jannis Limperg -/ module import Batteries.Tactic.Alias import Batteries.Data.UInt @[expose] public section /-! ## Definitions on Arrays This file...
6,022
lean_file_chunk
8689cb1f45ba1d3b00ddbb47167785407204db9865944bb4da940a82fa81557c
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2023 F. G. Dorais. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: F. G. Dorais -/ module @[expose] public section namespace Array /-- Prefix table for the Knuth-Morris-Pratt matching algorithm This is an array of the form `t = [(x₀,n₀), (x₁,n₁), ...
4,484
lean_file_chunk
00c5a32ed84e601d259cd43ddbc2d08b4ea39b4105fbe2dc6e9f6446b007cdcd
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2024 François G. Dorais. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: François G. Dorais -/ module public import Batteries.Tactic.Alias public import Batteries.Data.BitVec.Basic public import Batteries.Data.Fin.OfBits public import Batteries.Data.Na...
762
lean_file_chunk
7d07249796364ac9b45ccca956c91cc763691266fffb69c6854a20b75ca513ec
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2024 François G. Dorais. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: François G. Dorais -/ module @[expose] public section namespace BitVec /-- `ofFnLEAux f` returns the `BitVec m` whose `i`th bit is `f i` when `i < m`, little endian. -/ @[inline...
6,302
lean_file_chunk
fa6eea8b8d1aab16ad8d2e1c04f34faf9908daacc2a363c792dd34a48fe7f463
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2021 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ module public import Batteries.Data.UnionFind.Basic @[expose] public section namespace Batteries.UnionFind @[simp] theorem arr_empty : empty.arr = #[] := rfl @[si...
23,892
lean_file_chunk
2b93731640742be33a503ec419e4f1230cebfdc2a68fd162f6e69e761fca6fa8
lean_source_file
pkg_batteries_source_file_chunks
/- Copyright (c) 2021 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro -/ module public import Batteries.Tactic.Lint.Misc public import Batteries.Tactic.SeqFocus public import Batteries.Util.Panic @[expose] public section namespace Batte...