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
23,994
lean_file_chunk
e3e69bfbfbbe79dc0028a2533d8aa7d0ad711d5af773754297fb0e9dc34e089d
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2026 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Paul Reichert -/ module prelude public import Init.Data.List.MinMaxOn import Init.Data.List.Nat.TakeDrop import Init.ByCases import Init.Data.Bool import Init.Data.List.Sublist import ...
9,931
lean_file_chunk
2a26e6de13f326da6298a7df2ecd00946803789a1dddbdc5b89e96be87f1631c
lean_source_file
lean_toolchain_source_file_chunks
protected theorem maxIdxOn_replicate [LE β] [DecidableLE β] [Refl (α := β) (· ≤ ·)] {n : Nat} {a : α} {f : α → β} (h : replicate n a ≠ []) : (replicate n a).maxIdxOn f h = 0 := letI : LE β := (inferInstance : LE β).opposite List.minIdxOn_replicate h @[simp] protected theorem minIdxOn?_nil [LE β] [Decidable...
22,483
lean_file_chunk
cc5128298761436860b05980418cd555eb9ee2f36e35af7a9891575e01596f42
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ module prelude public import Init.Ext import Init.Data.Array.Bootstrap import Init.Data.Bool import Init.Data.List.Lemmas import Init.Data.Option.Lemmas p...
17,131
lean_file_chunk
4e576cb32f0018fade7398a9fc491e56b77f4eb336ccb9c43e7c42aaf0b28d8f
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ module prelude import all Init.Data.List.Basic public import Init.BinderPredicates public imp...
10,878
lean_file_chunk
4efe36fcd7edcac9fef259e19b0ab98e324bc37bac9d22ed7e2ad082e8f711f9
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro -/ module prelude public import Init.BinderPredicates public import Init.Ext public import Init....
6,182
lean_file_chunk
691fb71787b7c721aae398e88f441c6dec34f526de768ed269f200809a5350a8
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2024 Lean FRO. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Kim Morrison -/ module prelude public import Init.Data.Fin.Fold public import Init.NotationExtra import Init.Data.Fin.Lemmas import Init.Data.List.Lemmas import Init.Data.Na...
254
lean_file_chunk
27fec553d048084240ac3dede2f29d9879f9effb94e39a207d86324377f96611
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2026 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ module prelude public import Init.Data.List.SplitOn.Basic public import Init.Data.List.SplitOn.Lemmas
23,923
lean_file_chunk
1a44db66084068a12f00fa560fac81fe37a22510bd4965457e627e6bd63bb158
lean_source_file
lean_toolchain_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 prelude import all Init.Data.List.Lemmas -- for dsimping with `getElem?_cons_succ` public import Init.Data.List.Lemmas import Init.Data.List.Count import Ini...
10,685
lean_file_chunk
b997d6986dd432d1c1645db098ffd9bdce614f5e52eb761d16457a902c139982
lean_source_file
lean_toolchain_source_file_chunks
theorem countP_attachWith {p : α → Prop} {q : α → Bool} {l : List α} (H : ∀ a ∈ l, p a) : (l.attachWith p H).countP (fun a : {x // p x} => q a) = l.countP q := by simp only [← Function.comp_apply (g := Subtype.val), ← countP_map, attachWith_map_subtype_val] @[simp, grind =] theorem count_attach [BEq α] {l : List...
20,293
lean_file_chunk
02b35ca1e300e240f7043599e636df1ff74de682f52ff1145e90517f58414a62
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2024 Lean FRO. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Mario Carneiro -/ module prelude public import Init.Data.Option.Attach public import Init.Data.List.OfFn import Init.ByCases import Init.Data.Array.Bootstrap import Init.Data...
23,941
lean_file_chunk
051fd62d6b3a58ca04136c92e5b15bb39964b07e72b7e69a76e62d040cdaccdb
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro, Yury Kudryashov -/ module prelude public import Init.BinderPredicates public import Init.Ext ...
629
lean_file_chunk
d05913a8200acb3f2cd829a38d634d7149e233e628cd5601e17219378a797e4e
lean_source_file
lean_toolchain_source_file_chunks
-- See also `mem_eraseIdx_iff_getElem` and `mem_eraseIdx_iff_getElem?` in -- `Init/Data/List/Nat/Basic.lean`. theorem erase_eq_eraseIdx_of_idxOf [BEq α] [LawfulBEq α] {l : List α} {a : α} {i : Nat} (w : l.idxOf a = i) : l.erase a = l.eraseIdx i := by subst w rw [erase_eq_iff] by_cases h : a ∈ l · right...
23,976
lean_file_chunk
bd3dcb397ef8e76dc9c49a0ab685c3798a7bc08a301b6072d346f46fa504089d
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2014 Parikshit Khanna. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Parikshit Khanna, Jeremy Avigad, Leonardo de Moura, Floris van Doorn, Mario Carneiro, Kim Morrison, Jannis Limperg -/ module prelude import all Init.Data.List.Attach public import...
23,975
lean_file_chunk
55743c74b2b100aa812fa9943393564628a6d2ba96d6401a2a300670cb8e5c87
lean_source_file
lean_toolchain_source_file_chunks
exact absurd (@findIdx_getElem _ p xs (Nat.lt_trans f h)) (by simpa using h2 (xs.findIdx p) f) /-- If `¬ p xs[j]` for all `j ≤ i`, then `i < xs.findIdx p`. -/ theorem lt_findIdx_of_not {p : α → Bool} {xs : List α} {i : Nat} (h : i < xs.length) (h2 : ∀ j (hji : j ≤ i), ¬p (xs[j]'(Nat.lt_of_le_of_lt hji h))) : i < x...
3,774
lean_file_chunk
070b121c863dd80373d93bc53f592c6a23428f9834b25b0ae22afce8c0293013
lean_source_file
lean_toolchain_source_file_chunks
theorem lookup_eq_findSome? {l : List (α × β)} {k : α} : l.lookup k = l.findSome? fun p => if k == p.1 then some p.2 else none := by induction l with | nil => rfl | cons p l ih => match p with | (k', v) => simp only [lookup_cons, findSome?_cons] split <;> simp_all @[simp, grind =] theorem...
1,560
lean_file_chunk
57a73ee8bf7bde653d80535592c0a3b2cea398983c6845b0fb7a7a9484f0e12c
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2020 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura -/ module prelude import Init.Data.String.Search public import Init.Data.ToString.Basic import Init.Data.Iterators.Consumers.Collect public section open Std ...
2,320
lean_file_chunk
9cd979c8332d86568bf0e0bf2748f33652e749180e39eb145c60326ebcb172d0
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2021 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura -/ module prelude import Init.Data.ToString.Name public import Init.Data.ToString.Basic import Init.Data.Format.Instances import Init.Data.Format.Macro public...
15,979
lean_file_chunk
cd9f9017f060aa7f0139a2f85dcd9334d098191f11087027c56f202375afddfb
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2018 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura -/ module prelude public import Init.Data.Int.Basic public import Init.Data.String.Bootstrap import Init.Control.State import Init.Data.Nat.Bitwise.Basic publ...
425
lean_file_chunk
920debaf7d8e0a986cc1e21c804719fcad9ae94fd78502d34943fd041bf1c31c
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2020 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura -/ module prelude public meta import Init.Meta public import Init.Notation public section namespace Std syntax:max "f!" interpolatedStr(term) : term macro_...
3,929
lean_file_chunk
ec3d3bad915418503bd88cfe1cd1c13bc8788a34d90465e223ed44b021d8a9e5
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2020 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura -/ module prelude public import Init.Data.Repr import Init.Data.Char.Basic public section open Sum Subtype Nat open Std /-- Types that can be converted int...
399
lean_file_chunk
b645464d2f91e42a2490c06462dd25cd7728598d98d2476f7b86cd4aed5fcc03
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2020 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura -/ module prelude public meta import Init.Meta public import Init.Notation public section syntax:max "s!" interpolatedStr(term) : term macro_rules | `(s! ...
5,474
lean_file_chunk
a312c3e442de48f8b340cea26db59c54f4c76c2dc5c151f9729141b3a13bce06
lean_source_file
lean_toolchain_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 and Sebastian Ullrich -/ module prelude public import Init.Data.String.Substring import Init.Data.String.TakeDrop import Init.Data.String.Search /-! Here we ...
1,231
lean_file_chunk
0ca0b7ca421a9a4b8ebaea1a39a8e36816c93708440255dfd3858ce6a69bc01c
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2020 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura -/ module prelude public import Init.Data.String.Defs public import Init.Data.Int.Repr public section /-- Converts a list into a string, using `ToString.toSt...
418
lean_file_chunk
0dc04f6979d09f54b95fd54ba949879afa8310585c4da98795af1b5c8fcab33e
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2026 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Markus Himmel -/ module prelude public import Init.Data.Hashable public import Init.Data.String.Defs public section namespace String deriving instance Hashable for String.Pos.Raw der...
8,404
lean_file_chunk
9c128740dc15fab24e2459b2cc2eecf2d0fffd6ba19de4203cfef219334d4f3d
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2026 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ module prelude public import Init.Data.String.Basic import Init.Data.String.Lemmas.IsEmpty import Init.Data.String.Lemmas.Basic set_option doc.verso true public sect...
16,905
lean_file_chunk
e7616968fc417f969313922d75bc9064f9d87a8dae595b1d7cc555ed8ae79b98
lean_source_file
lean_toolchain_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: Henrik Böving, Markus Himmel -/ module prelude public import Init.Data.String.Basic public import Init.Data.String.FindPos public import Init.Data.Iterators.Combinators.FilterMap publi...
880
lean_file_chunk
eb64b880991a3827ef571008680b6f0e69aff5336880162014f1e35e5c3819da
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ module prelude public import Init.Data.String.Lemmas.Splits public import Init.Data.String.Lemmas.Modify public import Init.Data.String.Lemmas...
4,137
lean_file_chunk
7deab69ff8e4d2b63e8ca0d49461096c8eab5c8d71e1c9e0a55ead7cfbd765aa
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura, Mario Carneiro -/ module prelude public import Init.Data.String.Basic /-! # Legacy string functions This file contains `String` functions which have since b...
9,829
lean_file_chunk
03f88110ea0dfdffd85277be3a440de24f3a170df58718c49b2ae86990fcb799
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura, Mario Carneiro -/ module prelude public import Init.Data.String.Termination import Init.Data.ByteArray.Lemmas import Init.Data.Char.Lemmas /-! # Modification...
346
lean_file_chunk
b6bc26680405c3e540264393d031b826190e27da411d9b76237717155b3af4e7
lean_source_file
lean_toolchain_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: Henrik Böving -/ module prelude public import Init.Data.String.Pattern.Basic public import Init.Data.String.Pattern.Char public import Init.Data.String.Pattern.String public import Ini...
837
lean_file_chunk
b4e01f561a29b2aa1a6e4d9ec216bed59f6f724fc4cfb6ef93f4f6be448b1a43
lean_source_file
lean_toolchain_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: Markus Himmel -/ module prelude public import Init.Data.String.Defs /-! # The `ToSlice` typeclass -/ public section namespace String /-- Typeclass for types that have a conversion ...
23,989
lean_file_chunk
34479ff97b1781e4234fe7cff914c58f7f8f684c561460e1fb3cedfdf828cf06
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura, Mario Carneiro, Markus Himmel -/ module prelude public import Init.Data.String.Decode public import Init.Data.String.Defs import Init.Data.ByteArray.Lemmas im...
23,982
lean_file_chunk
f52a9d1bc5162d472ba47dddab8a72ad7cf40e0b3302667b6e9316343b02f755
lean_source_file
lean_toolchain_source_file_chunks
· exact Or.inl h · omega @[simp] theorem utf8ByteSize_push {s : String} {c : Char} : (s.push c).utf8ByteSize = s.utf8ByteSize + c.utf8Size := by simp [← size_toByteArray, List.utf8Encode_singleton] @[simp] theorem rawEndPos_push {s : String} {c : Char} : (s.push c).rawEndPos = s.rawEndPos + c := by simp [...
23,935
lean_file_chunk
b9f97878b7157d5431c765ad2a584862fc3ccb65e2e55fb22940ecb44bbc4184
lean_source_file
lean_toolchain_source_file_chunks
theorem Pos.Raw.isValidForSlice_sliceTo {s : Slice} {p : s.Pos} {off : Pos.Raw} : off.IsValidForSlice (s.sliceTo p) ↔ off ≤ p.offset ∧ off.IsValidForSlice s := by refine ⟨fun ⟨h₁, h₂⟩ => ⟨?_, ?_, ?_⟩, fun ⟨h₁, ⟨h₂, h₃⟩⟩ => ⟨?_, ?_⟩⟩ · simpa using h₁ · simp only [Slice.rawEndPos_sliceTo] at h₁ exact Pos.Ra...
23,959
lean_file_chunk
1ff776542fd67e078d80a02e983099475437d66a8df22cffd14336184be77745
lean_source_file
lean_toolchain_source_file_chunks
theorem Slice.Pos.offset_cast {s t : Slice} {pos : s.Pos} {h : s.copy = t.copy} : (pos.cast h).offset = pos.offset := (rfl) @[simp] theorem Slice.Pos.cast_rfl {s : Slice} {pos : s.Pos} : pos.cast rfl = pos := Slice.Pos.ext (by simp) @[simp] theorem Slice.Pos.cast_le_cast_iff {s t : Slice} {pos pos' : s.Pos} {h ...
23,984
lean_file_chunk
db955a1e4e9709561a19bb0406d933252d701b5152686cbc084bf6b0238f43d8
lean_source_file
lean_toolchain_source_file_chunks
{q r : (s.sliceTo p).Pos} : Pos.ofSliceTo q < Pos.ofSliceTo r ↔ q < r := by simp [Pos.lt_iff, Slice.Pos.lt_iff, Pos.Raw.lt_iff] @[simp] theorem Pos.ofSliceTo_le_ofSliceTo_iff {s : String} {p : s.Pos} {q r : (s.sliceTo p).Pos} : Pos.ofSliceTo q ≤ Pos.ofSliceTo r ↔ q ≤ r := by simp [Pos.le_iff, Slice.Pos.le_iff,...
5,464
lean_file_chunk
7e04e4d6b48fca5d5e87d4d4ea26eee1b979d4ba2443940da324151ee0058b1e
lean_source_file
lean_toolchain_source_file_chunks
* `"L∃∀N".offsetOfPos ⟨2⟩ = 2` * `"L∃∀N".offsetOfPos ⟨4⟩ = 2` * `"L∃∀N".offsetOfPos ⟨5⟩ = 3` * `"L∃∀N".offsetOfPos ⟨50⟩ = 4` -/ @[inline] def Pos.Raw.offsetOfPos (s : String) (pos : Pos.Raw) : Nat := offsetOfPosAux s pos 0 0 @[deprecated String.Pos.Raw.offsetOfPos (since := "2025-11-17")] def offsetOfPos (s : String...
3,947
lean_file_chunk
dbd412109c820ebf2134e970570670d6615c290e0fbbd7b80de884a6d465705b
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2025 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Markus Himmel -/ module prelude public import Init.Data.String.Defs public import Init.Grind.ToInt public import Init.Data.Order.Classes import Init.Data.Order.PackageFactories import I...
6,487
lean_file_chunk
4eba2222b904cefc28338347bf5d54e18dd6fd721f02d5781e88c324e7739089
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura, Mario Carneiro -/ module prelude public import Init.Data.ByteArray.Bootstrap import Init.Data.Char.Basic public section namespace String instance : OfNat S...
21,447
lean_file_chunk
15320fae3a0ca0e255dd83422c76130411eebf38ccd3866ae36e410312f534d1
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura, Mario Carneiro -/ module prelude public import Init.Data.String.Slice import Init.Data.Option.BasicAux /-! # The `Substring` type This file contains API for...
22,630
lean_file_chunk
5d81fa180101d834220d12f605d067a370bf1dacd566f6b73b2cca952895797d
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura, Mario Carneiro -/ module prelude public import Init.Data.String.PosRaw import Init.Data.ByteArray.Lemmas import Init.Omega /-! # Preliminary developments for...
14,000
lean_file_chunk
6f7d2a945d23d98df477ca81efb92ad65cd83fbc13eb09645dc27da07a3b6bd6
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura, Mario Carneiro -/ module prelude public import Init.Data.ByteArray.Basic import Init.Data.Nat.Simproc import Init.Omega /-! # Arithmetic of `String.Pos.Raw` ...
18,928
lean_file_chunk
8177d08e4e497f3e0a49e773c57cda251cc0b38c1b6b9d8e4c091bcf1911e41d
lean_source_file
lean_toolchain_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: Markus Himmel -/ module prelude public import Init.Data.String.Slice import Init.Data.Iterators.Consumers.Collect -- shake: keep (used in verso) set_option doc.verso true /-! # Stri...
20,054
lean_file_chunk
63acc328e449a2397dddab10fe1d4e2b31bfa861d20351b0a38754a8e056bce6
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura, Mario Carneiro, Markus Himmel -/ module prelude public import Init.Data.String.Substring set_option doc.verso true /-! # `String.take` and variants This fi...
5,257
lean_file_chunk
abdca23a906e810c7c45b2e0a2fd05057682c084f60019579e1039c40e1e58e1
lean_source_file
lean_toolchain_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: Markus Himmel -/ module prelude public import Init.Data.String.Basic import Init.Omega import Init.Data.String.OrderInstances import Init.Data.String.Lemmas.Basic set_option doc.verso...
10,372
lean_file_chunk
0e2c97b8b03f5b88ba8ca1aa74d989639dc6b723cedcf8b6dc9640c5663884ba
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2025 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Markus Himmel -/ module prelude public import Init.Data.String.Lemmas.Splits public import Init.Data.String.FindPos import Init.Data.Option.Lemmas import Init.Omega import Init.ByCases ...
257
lean_file_chunk
62241f736b76efd77628b4b756c36009897064c441bc0bc85e55a6341c518bf2
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2026 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Markus Himmel -/ module prelude public import Init.Data.String.Iter.Basic public import Init.Data.String.Iter.Intercalate
11,209
lean_file_chunk
527931a2b4f765267042e57cd2423a5929f05a8667815b38b333ad7269c16650
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura, Mario Carneiro -/ module prelude public import Init.Data.String.Modify /-! # `String.Iterator` This file contains `String.Iterator`, an outgoing API to be r...
23,983
lean_file_chunk
c083f7a0eeb5ef206a6520c583943e4b48dbed72c6daa720e6ab9102489242e5
lean_source_file
lean_toolchain_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: Henrik Böving, Markus Himmel -/ module prelude public import Init.Data.String.Pattern public import Init.Data.Ord.Basic public import Init.Data.Iterators.Combinators.FilterMap public i...
21,031
lean_file_chunk
736a35c09d96f50c34ae1a3fc4e55fe00bf8ff98849aef8a28673699d933422a
lean_source_file
lean_toolchain_source_file_chunks
| ⟨.operating _ s⟩, .yield ⟨.atEnd ..⟩ _ => True | ⟨.operating _ s⟩, .skip ⟨.operating _ s'⟩ => s'.IsPlausibleSuccessorOf s | ⟨.operating _ s⟩, .skip ⟨.atEnd ..⟩ => False | ⟨.operating _ s⟩, .done => True | ⟨.atEnd⟩, .yield .. => False | ⟨.atEnd⟩, .skip _ => False | ⟨.atEnd⟩, .done => True ste...
4,664
lean_file_chunk
538726bdd5c17d28f91713c89f62dfd6848a774211868491cdb6786c3cb7fff8
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2020 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura -/ module prelude import all Init.Data.ByteArray.Basic public import Init.Data.String.Basic import all Init.Data.String.Basic import Init.Data.String.Search im...
23,994
lean_file_chunk
b242962fe987cb9cf183c463d924802d9f119563d4c3a63ae02a6b7d6d390d10
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2025 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Markus Himmel -/ module prelude import Init.Data.Char.Lemmas public import Init.Data.ByteArray.Basic import Init.Data.ByteArray.Lemmas public import Init.Data.UInt.Basic import Init.Dat...
23,951
lean_file_chunk
9d894c53f6bc0762efc36f18903ef3ba0adf26e0835b2939f2e593a862652c3b
lean_source_file
lean_toolchain_source_file_chunks
simp only [assemble₁, Option.some.injEq] rintro rfl rfl theorem val_assemble₁_le {w : UInt8} {h} {c : Char} (h' : assemble₁ w h = some c) : c.val ≤ 127 := by have := toBitVec_val_assemble₁ h' have hx := helper₅ h simp only [UInt8.lt_iff_toNat_lt, UInt8.reduceToNat] at hx rw [UInt32.le_iff_toBitVec_le, this...
23,926
lean_file_chunk
549a9b9f689b9111363e004a920f7702dcf360d0af05ef0e8035cc82d9749298
lean_source_file
lean_toolchain_source_file_chunks
have hc : c.utf8Size = 4 := String.length_utf8EncodeChar _ ▸ h₀ obtain ⟨rfl, rfl, rfl, rfl⟩ : w = (String.utf8EncodeChar c)[0] ∧ x = (String.utf8EncodeChar c)[1] ∧ y = (String.utf8EncodeChar c)[2] ∧ z = (String.utf8EncodeChar c)[3] := by simp [h] refine ⟨parseFirstByte_utf8EncodeChar_eq_threeMore...
1,924
lean_file_chunk
0079296c77ba1fc9aac483dbfef0173e2f0ef727bb66f6b7dea709fff1bf6293
lean_source_file
lean_toolchain_source_file_chunks
public theorem ByteArray.isUTF8FirstByte_of_isSome_utf8DecodeChar? {b : ByteArray} {i : Nat} (h : (utf8DecodeChar? b i).isSome) : (b[i]'(lt_size_of_isSome_utf8DecodeChar? h)).IsUTF8FirstByte := by rw [utf8DecodeChar?_eq_utf8DecodeChar?_extract] at h suffices ((b.extract i b.size)[0]' (by simpa using lt_si...
482
lean_file_chunk
53cfa93e46c90da2a22196c148b5ee4c5798033522a71053d69f3f3066d1f30f
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2020 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Sebastian Ullrich, Andrew Kent, Leonardo de Moura -/ module prelude public import Init.Data.String.Basic public import Init.Data.Stream public instance : Std.Stream Substring....
1,153
lean_file_chunk
a2a44baea207b63cca7b1e985d21341386a6c30b49ecd728f0019fb0111796fe
lean_source_file
lean_toolchain_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: Markus Himmel, Paul Reichert, Robin Arnez -/ module prelude public import Init.Data.Order.Ord public import Init.Data.String.Basic import Init.Data.Char.Lemmas import Init.Data.String....
734
lean_file_chunk
dae11647e2782f231ecc76910ee14610fa18b2d09dca87e5910dba2ee8f99b29
lean_source_file
lean_toolchain_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: Markus Himmel, Paul Reichert, Robin Arnez -/ module prelude public import Init.Data.Order.Ord import Init.Data.BitVec.Lemmas public section /-! # Instances for strings. -/ set_opti...
3,580
lean_file_chunk
706894b3a23bb0dcd6ccbeffdcaa8c2e8ca1cacc64900955cf793fa277442877
lean_source_file
lean_toolchain_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: Markus Himmel, Paul Reichert, Robin Arnez -/ module prelude public import Init.Data.Order.Ord public import Init.Data.Order.ClassesExtra public import Init.Data.SInt.Basic import Init....
23,952
lean_file_chunk
d39e4faa6670383f4c42b1f11a1a7daecad910fc89aebe094eece6942364cfc6
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2021 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dany Fabian, Sebastian Ullrich -/ module prelude import Init.ByCases import Init.Ext public import Init.PropLemmas public import Init.Data.Char.Basic import Init.Classical pub...
1,333
lean_file_chunk
78333f31614f1c5378baf81ca0aee4a725d7b0d125e7711580b25b724e30346d
lean_source_file
lean_toolchain_source_file_chunks
and that returns `Ordering.gt` when `ord` would return `Ordering.lt`. -/ @[expose, implicit_reducible] protected def opposite (ord : Ord α) : Ord α where compare x y := ord.compare y x /-- Constructs an `Ord` instance that compares values according to the results of `f`. In particular, `ord.on f` compares `x` and `...
2,760
lean_file_chunk
af1d348c73d0fefdbdd4b7aa18ca2194a63fffed9f0d13b9e279b9926ddc955f
lean_source_file
lean_toolchain_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: Markus Himmel, Paul Reichert, Robin Arnez -/ module prelude public import Init.Data.Order.Ord public import Init.Data.Vector.Basic import Init.Data.Vector.Lemmas public section /-! #...
2,610
lean_file_chunk
24c75673b1e6b2c9d40daaa82bca5a35bb7af0d5100af06dbadda1dff63f5049
lean_source_file
lean_toolchain_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: Markus Himmel, Paul Reichert, Robin Arnez -/ module prelude public import Init.Data.Ord.Basic import Init.Omega import Init.ByCases import Init.Data.Array.Basic import Init.WFTactics ...
3,630
lean_file_chunk
b267cdff50a575293d2ad7b05c5bff168409b64fec48b33fb94b619b6f4b1a02
lean_source_file
lean_toolchain_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: Markus Himmel, Paul Reichert, Robin Arnez -/ module prelude public import Init.Data.Order.Ord public import Init.Data.Order.ClassesExtra public import Init.Data.UInt.Basic import Init....
4,020
lean_file_chunk
01de438f1231391f659feb617309ba2116dddc0d57e5ce6f6530506a28fadf74
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2024 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ module prelude public import Init.Data.Range.Basic import all Init.Data.Range.Basic public import Init.Data.List.Control import Init.Data.List.Monadic import Init.Data....
3,288
lean_file_chunk
69aa0e8d399b15c64bd410bd67ab4777b86c9ab56d1ec1257ed530afa762e93d
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2020 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura -/ module prelude public import Init.Control.Basic public import Init.Grind.Tactics public meta import Init.Grind.Tactics import Init.Omega import Init.WFTact...
1,663
lean_file_chunk
762f1dbdaaeb3afbcf9be3bbc127787afc92405e8fc1511ee648ba4f1cc91fcd
lean_source_file
lean_toolchain_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: Paul Reichert -/ module prelude public import Init.Data.Range.Polymorphic.Basic public import Init.Data.Range.Polymorphic.Iterators public import Init.Data.Range.Polymorphic.Stream pub...
23,966
lean_file_chunk
b4d2987ba88261ae5272c10ac6f24abcc8a966df5374bbf8f8d07920e275e296
lean_source_file
lean_toolchain_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: Markus Himmel -/ module prelude import all Init.Data.UInt.Basic import all Init.Data.BitVec.Basic import all Init.Data.BitVec.Lemmas import all Init.Data.SInt.Basic public import Init....
23,982
lean_file_chunk
ed87b179ad0dc387f09fe65917d33770eb1f8837208a97f8b901666373ce17a3
lean_source_file
lean_toolchain_source_file_chunks
instance : Std.IdempotentOp (α := Int32) (· ||| ·) := ⟨fun _ => Int32.or_self⟩ instance : Std.IdempotentOp (α := Int64) (· ||| ·) := ⟨fun _ => Int64.or_self⟩ instance : Std.IdempotentOp (α := ISize) (· ||| ·) := ⟨fun _ => ISize.or_self⟩ @[simp] protected theorem Int8.or_zero {a : Int8} : a ||| 0 = a := Int8.toBitVec_i...
9,388
lean_file_chunk
c46334eef2270511c6a5367dcff731c791965fdce8416b3a7ade5d8237b11298
lean_source_file
lean_toolchain_source_file_chunks
@[simp] theorem Int64.not_ne_self {a : Int64} : ~~~a ≠ a := by simp [← Int64.toBitVec_inj] @[simp] theorem ISize.not_ne_self {a : ISize} : ~~~a ≠ a := by simp [← ISize.toBitVec_inj] theorem Int8.not_xor {a b : Int8} : ~~~a ^^^ b = ~~~(a ^^^ b) := by simp [← Int8.toBitVec_inj, BitVec.not_xor_left] theorem Int16.not_x...
4,686
lean_file_chunk
2fd861f34854e85ce73bad3cb0d503cbc87c76a0a1cca132b95f4c6a89765294
lean_source_file
lean_toolchain_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: Markus Himmel -/ module prelude public import Init.Data.Float32 public import Init.Data.SInt.Basic public section set_option linter.missingDocs true /-- Truncates a floating-point n...
4,343
lean_file_chunk
46d69646a191f4f8578265da694c98c5c29d188c5e7d2afd451f00ee30dc5ad5
lean_source_file
lean_toolchain_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: Markus Himmel -/ module prelude public import Init.Data.Float public import Init.Data.SInt.Basic public section set_option linter.missingDocs true /-- Truncates a floating-point num...
23,929
lean_file_chunk
1d3598e2b7a437e5771a523db4f440c09d3d721831ff1d6c58d16f2fd1385229
lean_source_file
lean_toolchain_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: Markus Himmel -/ module prelude import all Init.Data.Nat.Bitwise.Basic public import Init.Data.SInt.Basic import all Init.Data.SInt.Basic import all Init.Data.BitVec.Basic import all I...
23,975
lean_file_chunk
315d8ad50d1c5f739183703074d149bef0fc57b815bffd452274217ad8a116a3
lean_source_file
lean_toolchain_source_file_chunks
rw [minValue, toInt_ofInt_of_two_pow_numBits_le] <;> cases System.Platform.numBits_eq <;> simp_all theorem ISize.le_toInt_maxValue : 2 ^ 31 - 1 ≤ ISize.maxValue.toInt := by rw [maxValue, toInt_ofInt_of_two_pow_numBits_le] <;> cases System.Platform.numBits_eq <;> simp_all theorem Int8.iSizeMinValue_le_toInt ...
23,966
lean_file_chunk
52e90a031fd66047f4c28a923d385198f66d02c5b9636ef0eeff9c2eab4eb4ae
lean_source_file
lean_toolchain_source_file_chunks
@[simp] theorem ISize.ofInt_int64ToInt (x : Int64) : ISize.ofInt x.toInt = x.toISize := (rfl) @[simp] theorem Int8.toInt_ofIntLE {x : Int} {h₁ h₂} : (ofIntLE x h₁ h₂).toInt = x := by rw [ofIntLE, toInt_ofInt_of_le h₁ (Int.lt_of_le_sub_one h₂)] @[simp] theorem Int16.toInt_ofIntLE {x : Int} {h₁ h₂} : (ofIntLE x h₁ h₂)...
23,924
lean_file_chunk
b7952deb0c3c74d4dd089ac32e3ac760b13c11ccd86b87818aec45ac61b2dd06
lean_source_file
lean_toolchain_source_file_chunks
@[simp] theorem Int64.toNatClampNeg_ofBitVec (b) : (Int64.ofBitVec b).toNatClampNeg = b.toInt.toNat := (rfl) @[simp] theorem ISize.toNatClampNeg_ofBitVec (b) : (ISize.ofBitVec b).toNatClampNeg = b.toInt.toNat := (rfl) theorem Int8.toNatClampNeg_ofInt_of_le {n : Int} (h₁ : -2 ^ 7 ≤ n) (h₂ : n < 2 ^ 7) : (Int8.ofInt...
23,919
lean_file_chunk
992f83d32f760a4359891f44b483cce3ba1f750e3cc07f7c6c9b0fde321c28eb
lean_source_file
lean_toolchain_source_file_chunks
@[simp] theorem Int16.toInt32_ofBitVec (b) : (Int16.ofBitVec b).toInt32 = Int32.ofBitVec (b.signExtend _) := (rfl) @[simp] theorem Int16.toInt64_ofBitVec (b) : (Int16.ofBitVec b).toInt64 = Int64.ofBitVec (b.signExtend _) := (rfl) @[simp] theorem Int16.toISize_ofBitVec (b) : (Int16.ofBitVec b).toISize = ISize.ofBitVec (...
23,961
lean_file_chunk
d9067180d602db67c8816044b27e991dffeea9d70ba09de3ff2eceb3586efd2b
lean_source_file
lean_toolchain_source_file_chunks
theorem Int8.toInt16_div_of_ne_right (a b : Int8) (hb : b ≠ -1) : (a / b).toInt16 = a.toInt16 / b.toInt16 := Int16.toInt_inj.1 (by rw [toInt_toInt16, toInt_div_of_ne_right _ _ hb, Int16.toInt_div_of_ne_right _ _ (b.toInt16_ne_neg_one hb), toInt_toInt16, toInt_toInt16]) theorem Int8.toInt32_div_of_ne_right (a b : ...
23,895
lean_file_chunk
0c8697d5033b7fd5f2c18fcc4c3a5f2d4ec49ee89273b4fa211150d4a70951f5
lean_source_file
lean_toolchain_source_file_chunks
@[simp] theorem Int64.ofNat_mul (a b : Nat) : Int64.ofNat (a * b) = Int64.ofNat a * Int64.ofNat b := by simp [← Int64.ofInt_eq_ofNat] @[simp] theorem ISize.ofNat_mul (a b : Nat) : ISize.ofNat (a * b) = ISize.ofNat a * ISize.ofNat b := by simp [← ISize.ofInt_eq_ofNat] theorem Int8.ofIntLE_mul {a b : Int} {hab₁ hab₂...
23,973
lean_file_chunk
5d35f15354deb15913d9d90751090e509cab51a14a65ed1d28a9a9472fed9e5b
lean_source_file
lean_toolchain_source_file_chunks
@[simp] protected theorem Int16.sub_zero (a : Int16) : a - 0 = a := Int16.toBitVec_inj.1 (BitVec.sub_zero _) @[simp] protected theorem Int32.sub_zero (a : Int32) : a - 0 = a := Int32.toBitVec_inj.1 (BitVec.sub_zero _) @[simp] protected theorem Int64.sub_zero (a : Int64) : a - 0 = a := Int64.toBitVec_inj.1 (BitVec.sub_z...
23,985
lean_file_chunk
6bf1a5902561e730c0be02e4da8314f50382019b6156d0d4800b966488bd16b1
lean_source_file
lean_toolchain_source_file_chunks
protected theorem Int16.neg_mul_comm (a b : Int16) : -a * b = a * -b := Int16.toBitVec_inj.1 (BitVec.neg_mul_comm _ _) protected theorem Int32.neg_mul_comm (a b : Int32) : -a * b = a * -b := Int32.toBitVec_inj.1 (BitVec.neg_mul_comm _ _) protected theorem Int64.neg_mul_comm (a b : Int64) : -a * b = a * -b := Int64.toBi...
23,906
lean_file_chunk
44c4539e0ce9c2d87b0da4cca418d411476353da2ba1276ad8cd9410d653c4ff
lean_source_file
lean_toolchain_source_file_chunks
theorem Int8.neg_eq_neg_one_mul (a : Int8) : -a = -1 * a := Int8.toInt_inj.1 (by simp) theorem Int16.neg_eq_neg_one_mul (a : Int16) : -a = -1 * a := Int16.toInt_inj.1 (by simp) theorem Int32.neg_eq_neg_one_mul (a : Int32) : -a = -1 * a := Int32.toInt_inj.1 (by simp) theorem Int64.neg_eq_neg_one_mul (a : Int64) : -a = -...
3,952
lean_file_chunk
db2e4028e656720d5207b84c390be355692df98e10dc8b044d487ddd87057839
lean_source_file
lean_toolchain_source_file_chunks
(hb₁ : minValue.toInt ≤ b) (hb₂ : b ≤ maxValue.toInt) : ISize.ofInt (a.tmod b) = ISize.ofInt a % ISize.ofInt b := by rw [ISize.ofInt_eq_iff_bmod_eq_toInt, ← toInt_bmod_size, toInt_mod, toInt_ofInt, toInt_ofInt, Int.bmod_eq_of_le (n := a), Int.bmod_eq_of_le (n := b)] · exact le_of_eq_of_le (by cases System.Platf...
23,992
lean_file_chunk
718349e6a0619cb7da9bce6c4c727d2d04a34dfbd810fdfe6ca1b9369956552c
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2024 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Henrik Böving -/ module prelude public import Init.Data.UInt.Basic public import Init.Data.ToString.Extra @[expose] public section set_option linter.missingDocs true /-! This module...
23,942
lean_file_chunk
63fe1bc7edf2b888b8eec013c7cb2daf23a5d68cbafce63f2ba56b0c64dbf810
lean_source_file
lean_toolchain_source_file_chunks
Computes the absolute value of a 16-bit signed integer. This function is equivalent to `if a < 0 then -a else a`, so in particular `Int16.minValue` will be mapped to `Int16.minValue`. This function is overridden at runtime with an efficient implementation. -/ @[extern "lean_int16_abs"] protected def Int16.abs (a : In...
23,436
lean_file_chunk
15f2e9a9da8f4a00dbb34b2c0f30fe91ce5933850a11d9441169abdd211869d8
lean_source_file
lean_toolchain_source_file_chunks
protected def Int64.add (a b : Int64) : Int64 := ⟨⟨a.toBitVec + b.toBitVec⟩⟩ /-- Subtracts one 64-bit signed integer from another, wrapping around on over- or underflow. Usually accessed via the `-` operator. This function is overridden at runtime with an efficient implementation. -/ @[extern "lean_int64_sub"] protect...
10,968
lean_file_chunk
b2a0192548fc9448e4627b3427679a423beb1d6ebd74e1e1f3af8f45df475591
lean_source_file
lean_toolchain_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 prelude import all Init.Data.Array.Basic import all Init.Data.Vector.Basic public import Init.Data.Function public import Init.Data.Vector.Basic import Init.Data...
9,475
lean_file_chunk
805c936ea68532470437753ec4516b800ae113818fd48dd5ce359a596d1602cf
lean_source_file
lean_toolchain_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 prelude import all Init.Data.Array.Count import all Init.Data.Vector.Basic public import Init.BinderPredicates public import Init.Data.Vector.Basic import Init.D...
1,089
lean_file_chunk
56770a5fa27fde8968640922f91fc07954892e796eec7686bfb0c2f983a3a9ca
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2026 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Sebastian Graf, Paul Reichert -/ module prelude public import Init.Data.Vector.Basic import Init.Data.Array.Int import Init.Data.Int.Lemmas import Init.Data.Vector.Lemmas...
23,993
lean_file_chunk
2656778d87a20daa7fd9bef8aede205942fa24e662edfb78c5e7c2457c9737d1
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2024 Shreyas Srinivas. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Shreyas Srinivas, Francois Dorais, Kim Morrison -/ module prelude import all Init.Data.Array.Basic public import Init.Data.Vector.Basic import all Init.Data.Vector.Basic public impo...
23,978
lean_file_chunk
5332286aed18b0ef6123ea1aae28d04d253fafad2394ecdaa62616d803a5e36f
lean_source_file
lean_toolchain_source_file_chunks
(xs.mapFinIdx f).toList = xs.toList.mapFinIdx (fun i a h => f i a (by simpa [xs.size_toArray] using h)) := by simp [toList] theorem toList_ofFn {f : Fin n → α} : (Vector.ofFn f).toList = List.ofFn f := by simp [toList] theorem toList_pop {xs : Vector α n} : xs.pop.toList = xs.toList.dropLast := by simp [toLis...
23,993
lean_file_chunk
1071b66df08b235eeb6f2b56277e78383ae4d146de70a7965c9786ceda68a2ee
lean_source_file
lean_toolchain_source_file_chunks
rcases as with ⟨as, rfl⟩ simp @[simp] theorem contains_push [BEq α] {xs : Vector α n} {a : α} {b : α} : (xs.push a).contains b = (xs.contains b || b == a) := by rcases xs with ⟨xs, rfl⟩ simp [Array.contains_push] /-! ### set -/ @[grind =] theorem getElem_set {xs : Vector α n} {i : Nat} {x : α} (hi : i < n)...
23,981
lean_file_chunk
69266f6663d4b5eddfa183eafbde457452c0334d99bd4852f599cbd674009f2e
lean_source_file
lean_toolchain_source_file_chunks
xss[i / m][i % m] := by rcases xss with ⟨⟨l⟩, rfl⟩ simp only [flatten_mk, List.map_toArray, getElem_mk, List.getElem_toArray, Array.flatten_toArray] induction l generalizing i with | nil => simp at hi | cons xs l ih => simp only [List.map_cons, List.map_map, List.flatten_cons, toList_toArray] by_cases...
22,531
lean_file_chunk
72c7fe1732959c310a574a0c5440c0058430d4ee402009d969cebdd62cc2dc1e
lean_source_file
lean_toolchain_source_file_chunks
xs.foldr op (op a₁ a₂) = op (xs.foldr op a₁) a₂ := by rcases xs with ⟨xs, rfl⟩ simp [Array.foldr_assoc] -- The argument `f : α₁ → α₂` is intentionally explicit, as it is sometimes not found by unification. theorem foldl_hom (f : α₁ → α₂) {g₁ : α₁ → β → α₁} {g₂ : α₂ → β → α₂} {xs : Vector β n} {init : α₁} (H : ...
2,010
lean_file_chunk
11a3ebe3278756d26f375da2e5d3b2083936242b0f94e4fa013de32009dad85d
lean_source_file
lean_toolchain_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 prelude public import Init.Data.Vector.Basic import Init.Data.Vector.Lemmas public section set_option linter.listVariables true -- Enforce naming conventions f...
4,611
lean_file_chunk
83cad0f146c9f63577ba6d3ec16cc61e8b6a41496548841bd36be9226eb1ec6d
lean_source_file
lean_toolchain_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 prelude public import Init.Data.Vector.Basic import Init.Data.Array.InsertIdx import Init.Data.Vector.Lemmas import Init.Omega public section /-! # insertIdx ...
11,009
lean_file_chunk
d58fe7a831cde98711a8f6488c097e8673156ff7cb24cacee7e7550a5bb0f596
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2024 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison -/ module prelude import all Init.Data.Vector.Basic import all Init.Data.Array.Lex.Basic import Init.Data.Range.Polymorphic.Lemmas public import Init.Data.Array.Lex.Basic ...
6,578
lean_file_chunk
104d4ae413bd1934604eba692af3c613942055d18d01f67af6301077778cfd6a
lean_source_file
lean_toolchain_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 prelude public import Init.Data.Vector.Basic import Init.ByCases import Init.Data.Array.Bootstrap import Init.Data.Array.Extract import Init.Data.Vector.Lemmas i...
1,427
lean_file_chunk
6f2f935241f4c00c6cf72653b966d6b4decb71b6973fb753e493dd090065f15c
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2026 Lean FRO, LLC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kim Morrison, Sebastian Graf, Paul Reichert -/ module prelude public import Init.Data.Vector.Basic import Init.Data.Array.Nat public import Init.BinderPredicates import Init.Data.Vecto...
1,474
lean_file_chunk
be7e480c88818f517dea16ca084629bbfb5767592c036b1ccc9be9f4ae210433
lean_source_file
lean_toolchain_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 prelude public import Init.Data.Vector.Basic import Init.Data.Fin.Lemmas import Init.Data.Vector.Lemmas import Init.Data.Vector.OfFn import Init.Omega...