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
3,760
lean_file_chunk
11bbf38711230119390dc4cfaee70b75912140bb404c80dd65493d305f7d2b8b
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2023 Lean FRO. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joe Hendrix -/ module prelude public import Init.Grind.Tactics import Init.Data.Bool import Init.Data.Nat.Lemmas public section /-! This contains lemmas used by the Nat simprocs for simpl...
23,989
lean_file_chunk
062476f221a29427275081f43dc7f13322d6267134a7f2c675ba31e2088e2f46
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2014 Floris van Doorn (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Mario Carneiro, Floris van Doorn -/ module prelude import all Init.Data.Nat.Bitwise.Basic public import Init.Data.Na...
23,932
lean_file_chunk
2c20987a508504662667daf33a998467ecf220ff70ff87bdc3a33a253e4e7777
lean_source_file
lean_toolchain_source_file_chunks
protected theorem mul_ne_zero : n ≠ 0 → m ≠ 0 → n * m ≠ 0 := (Nat.mul_ne_zero_iff.2 ⟨·,·⟩) protected theorem ne_zero_of_mul_ne_zero_left (h : n * m ≠ 0) : n ≠ 0 := (Nat.mul_ne_zero_iff.1 h).1 protected theorem mul_left_cancel {n m k : Nat} (np : 0 < n) (h : n * m = n * k) : m = k := by match Nat.lt_trichotomy m k...
23,993
lean_file_chunk
478c631f65d7302ecb429921b224d244491a404050fd7168508028a232562309
lean_source_file
lean_toolchain_source_file_chunks
exact Nat.mul_lt_mul_of_le_of_lt (Nat.le_refl _) h (Nat.pow_pos (Nat.lt_trans Nat.zero_lt_one h)) protected theorem pow_lt_pow_of_lt {a n m : Nat} (h : 1 < a) (w : n < m) : a ^ n < a ^ m := by have := Nat.exists_eq_add_of_lt w cases this with | intro k p rw [Nat.add_right_comm] at p subst p rw [Nat.pow_add, ...
2,862
lean_file_chunk
7a612df4004c6bc861680ea2d62599fc869901eeb2101e5089d1e42e07169606
lean_source_file
lean_toolchain_source_file_chunks
/-! ### Decidability of predicates -/ instance decidableBallLT : ∀ (n : Nat) (P : ∀ k, k < n → Prop) [∀ n h, Decidable (P n h)], Decidable (∀ n h, P n h) | 0, _, _ => isTrue fun _ => (by cases ·) | n + 1, P, H => match decidableBallLT n (P · <| lt_succ_of_lt ·) with | isFalse h => isFalse (h fun _ _ => · _ _) ...
5,161
lean_file_chunk
8337e84ccc018941980bc1d9cc681e7904807d8b82aa7d892e57f59b02e1bee2
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, Jeremy Avigad, Mario Carneiro -/ module prelude public import Init.Data.Nat.Basic import Init.ByCases import Init.PropLemmas public section namespace Nat ...
2,369
lean_file_chunk
b8c89618d0d1a222cc6001557e0c031baca730691517071c948f1b2c3ac2270b
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: Gabriel Ebner, Robin Arnez -/ module prelude public import Init.Grind.Tactics import Init.Data.Nat.Div.Basic import Init.NotationExtra import Init.WFTactics public section na...
6,642
lean_file_chunk
a7d4676679a10ebcc5789fbeffd76d249ddf76649ebb8d23fb117712a32afec6
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2022 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.Data.Nat.Linear import Init.ByCases import Init.Data.List.BasicAux import Init.Data.Prod import Init.Meta public section n...
3,306
lean_file_chunk
6aaa5cf0e9df9ef6ae5d2d935ace205a8b4ab2aed9a7fc14ca56d9515c491610
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. Author: Leonardo de Moura -/ module prelude public import Init.Notation import Init.Omega public section set_option linter.missingDocs true namespace Nat universe u v /-- Executes a...
6,530
lean_file_chunk
1d0bbc67be02485245caa9a34ccacae1f3d4a49c2327b67746f3d45fa81a4a5d
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, Jeremy Avigad, Mario Carneiro -/ module prelude public import Init.Data.Nat.Div.Basic public import Init.SimpLemmas import Init.Data.List.Notation import Ini...
21,536
lean_file_chunk
7209c5367dc7616cb900500376a333b3501a5a0e3f97cda7c47071526af9c9b7
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2022 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.Data.RArray import Init.LawfulBEqTactics import Init.ByCases import Init.Data.Prod public section @[expose] section na...
10,579
lean_file_chunk
82ec18793f6113b825e50b98b0fb4daf6ff53889c4fc6767af616037aa69a410
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Markus Himmel -/ module prelude public import Init.Data.Nat.Gcd import Init.Data.Nat.Dvd import Init.Data.Nat.Lemmas import In...
987
lean_file_chunk
e1d013213761997a0281d695ee5d7b5941f581b2c70d3bd19a923ceee7ec15b7
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.Nat.Basic import Init.Data.Nat.MinMax public import Init.Data.Order.Classes import Init.Data.Order.Factories import Init.Notatio...
23,990
lean_file_chunk
18df77e67cf1a23fd84b1b595fedaf9be41dbae9a47eca7e0f05e7f000d8cc48
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura -/ module prelude public import Init.SimpLemmas public import Init.Data.NeZero public import Init.Grind.Tactics public section set_option ...
21,623
lean_file_chunk
6a66cf53d6ac024a5e18df9466f118839d1928cd2106393921693d92a250b695
lean_source_file
lean_toolchain_source_file_chunks
theorem succ_inj : succ a = succ b ↔ a = b := (Nat.succ.injEq a b).to_iff theorem succ_le_succ_iff : succ a ≤ succ b ↔ a ≤ b := ⟨le_of_succ_le_succ, succ_le_succ⟩ theorem succ_lt_succ_iff : succ a < succ b ↔ a < b := ⟨lt_of_succ_lt_succ, succ_lt_succ⟩ theorem succ_ne_succ_iff : succ a ≠ succ b ↔ a ≠ b := by simp [Na...
262
lean_file_chunk
513cc234a05208128010933392798857887d3d7a5e62abf861389ad086e7a1b0
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2022 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.Data.Nat.Power2.Basic public import Init.Data.Nat.Power2.Lemmas
2,616
lean_file_chunk
30c39771a72a5b5607aba495994e1d3ba2b0e258f61bc800d9ae70d8e7ca1f9f
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, Jeremy Avigad, Mario Carneiro -/ module prelude public import Init.Data.Order.ClassesExtra import all Init.Data.Ord.Basic public section /-! # Basic lemmas...
18,349
lean_file_chunk
bf7981c05bfdbf58f41c35120f34c898a951da58f6da650bcf9af96125e33069
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Floris van Doorn, Leonardo de Moura, Kim Morrison -/ module prelude public import Init.Data.List.FinRange import Init.Data.Fin.Lemmas import Init.Data.List.Lemmas import Init.O...
2,936
lean_file_chunk
58a73c9157b313e1199850606cbf6fe217a825b9058bf4e0f65c7b8aa9829782
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.Grind.Tactics import Init.Data.Nat.Dvd import Init.Omega import Init.RCases public section /-! # Further results about `mod`. This ...
14,804
lean_file_chunk
0665cd2816e7f5ba0986fba2f7a1870e01ba7b4af2d2952a8c13ec50ebf9fede
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: Marcus Rossel, Paul Reichert -/ module prelude public import Init.Data.Repr public import Init.Data.Char.Basic public import Init.Data.ToString.Basic public import Init.Data.String.Bas...
7,600
lean_file_chunk
433b3f4d0d0a9ea837c8ed229ad72bb13a0e4ab8b23eabbe03867a26f74007a9
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2014 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura, Mario Carneiro -/ module prelude public import Init.Data.Nat.Gcd import Init.Data.Nat.Dvd public section /-! # Definitions and properties of `coprim...
5,880
lean_file_chunk
2330e5ab75a56dc12f36979f7a995c8002bf28b93a45ca0524d3d87c0c3d1502
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.Float import Init.Ext public import Init.GetElem public import Init.Data.ToString.Extra public section universe u s...
23,994
lean_file_chunk
8c526dc38f52568832205f1c9cae3ea0fc1949b07fc9355c242e14b1bea2b207
lean_source_file
lean_toolchain_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, Johannes Hölzl, Robin Arnez -/ module prelude public import Init.Data.Rat.Basic public import Init.Data.Int.Gcd import Init.ByCases import Init.Data.Bool import Init.D...
23,976
lean_file_chunk
370440ff0fa3a86e34c6706c3bf10d55a7e478943ec0a0efded318c2cf68dafe
lean_source_file
lean_toolchain_source_file_chunks
protected theorem inv_mul_cancel (a : Rat) (h : a ≠ 0) : a⁻¹ * a = 1 := Eq.trans (Rat.mul_comm _ _) (Rat.mul_inv_cancel _ h) protected theorem inv_eq_of_mul_eq_one {a b : Rat} (h : a * b = 1) : a⁻¹ = b := by have : a ≠ 0 := by intro h; simp_all +decide simpa [← Rat.mul_assoc, Rat.inv_mul_cancel _ this, eq_comm] ...
6,288
lean_file_chunk
b81fbba0d8e16bb8e26dac8fc12a288093a33fed069fec988ea3dba97afb9536
lean_source_file
lean_toolchain_source_file_chunks
theorem lt_floor_add_one (a : Rat) : a < ((a.floor + 1 : Int): Rat) := by rw [floor_def, Rat.lt_iff] have : a.num / ↑a.den + 1 = (a.num + ↑a.den) / ↑a.den := by rw [Int.add_ediv_of_dvd_right] <;> simp [a.den_nz] simp [this] simpa using Int.lt_ediv_mul (a.num + a.den) (b := a.den) (by have := a.den_nz; omega...
13,250
lean_file_chunk
d323339ab289fdd71076b9dcd6aee1d1b949ae848fed31cf6b21ca5d2ad9cd9c
lean_source_file
lean_toolchain_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 prelude public import Init.Data.Nat.Coprime public import Init.Data.OfScientific public import Init.Data.Int.DivMod.Basic public import Init.Data.String.Defs ...
5,280
lean_file_chunk
3d6cc64d5d0a0f75f31e85c12c47dd3f604cdb2bebab687cf3df87f1e8080333
lean_source_file
lean_toolchain_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 prelude public import Init.Data.Option.Basic public section universe u v namespace Option theorem eq_of_eq_some {α : Type u} : ∀ {x y : Option α...
23,943
lean_file_chunk
518a0ae2e2538b60796a50a14db5fb92fdd66ff447854ee8be9ea3062584e39f
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2017 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.Option.BasicAux public import Init.Data.Option.Instances import all Init.Data.Option.Instances public import Init.Ext public impo...
23,919
lean_file_chunk
c65ee429324832d8bee8bb2abbb62414835f269c3c13c912916be0f688f07813
lean_source_file
lean_toolchain_source_file_chunks
⟨fun a b c ↦ by cases a <;> cases b <;> cases c <;> simp [merge, Std.Associative.assoc]⟩ instance idempotentOp_merge (f : α → α → α) [Std.IdempotentOp f] : Std.IdempotentOp (merge f) := ⟨fun a ↦ by cases a <;> simp [merge, Std.IdempotentOp.idempotent]⟩ instance lawfulIdentity_merge (f : α → α → α) : Std.LawfulI...
20,140
lean_file_chunk
9bd67cce6a6c4eaf8f57b08d5d30edea6d584a0a02666bfaa75879ceb87e2168
lean_source_file
lean_toolchain_source_file_chunks
o.pfilter p = none ↔ o = none ∨ ∃ (a : α) (ha : o = some a), p a ha = false := by cases o <;> simp theorem pfilter_eq_some_iff {α : Type _} {o : Option α} {p : (a : α) → o = some a → Bool} {a : α} : o.pfilter p = some a ↔ ∃ ha, p a ha = true := by simp only [eq_some_iff_get_eq, get_pfilter, isSome_pfilter_iff]...
449
lean_file_chunk
ff0b9db4369e74555d9d7c35a4abd342f22eb2252b3816fc121cf87553ed6f98
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 -/ module prelude public import Init.Util public section universe u namespace Option /-- Extracts the value from an `Option`, panicking on `none`. -/ @[in...
3,374
lean_file_chunk
2c98f25dcb7392c18ed67db41ce54bdf46f32fa99c0d69e6dd3dac0ee6c04207
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 -/ module prelude import all Init.Data.List.Control import all Init.Data.Option.Instances public import Init.Data.List.Control public import Init.Data.Option.Lemmas import Init...
7,400
lean_file_chunk
43a4cdf7e7d051816c4f8d0a2915e9251bcf864a46880dccfe72706a79475a0f
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 -/ module prelude import all Init.Data.Option.Instances public import Init.Control.Lawful public import Init.Data.Option.Lemmas public section namespace Option @[simp, grin...
21,091
lean_file_chunk
495300ba1a319f7e24e43d0c361f5c1e7d24ea0925863ea700d4e0a0d617a484
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Mario Carneiro -/ module prelude public import Init.Control.Basic public import Init.Grind.Tactics public section @[expose] section namespace Option inst...
528
lean_file_chunk
673995118d0e3fac8c63b156315dda6aeae9178733b41834568ba41ba9c08dfc
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.Function import Init.NotationExtra public section namespace Option theorem map_injective {f : α → β} (hf : Function.Injective...
612
lean_file_chunk
fe64c853296324c102b4c13f84e16a86ad35b1a7ca97f9229206f2111bc62d80
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, Mario Carneiro -/ module prelude public import Init.Coe public section /-! In this file, we define the coercion `α → Option α`. The use of this coercion i...
3,408
lean_file_chunk
59ecc0ede7a50cd55dc413bf1ae47495c276be5b8fed6b74831b5cce0ba99f66
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.Option.Instances public import Init.Control.Lawful public import Init.Data.Option.Lemmas import Init.Data.Array.Bootstrap import In...
18,998
lean_file_chunk
ea338e2f0893c476592b143cf2c2aba1230840ead2c9a422af01c52949b49662
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 -/ module prelude public import Init.Data.Array.Attach public import Init.Data.Option.Lemmas import Init.Data.Bool import Init.Data.Option.Array import Init.Data.Option.List im...
11,835
lean_file_chunk
8fa905651ab1b66bd412754794b262ef2952bb3db382e02a4b7bc22ae5094d47
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.ByteArray.Basic import Init.ByCases import Init.Data.Array.Bootstrap import Init.Data.Array.Extract import Init.Data.Array.Lemmas...
15,226
lean_file_chunk
277b709a6a1648d735826ab09cb28abccc1ef091a6948ba6c37f76141f49dda0
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. Author: Leonardo de Moura -/ module prelude import all Init.Data.UInt.BasicAux public import Init.Data.Array.DecidableEq public import Init.Data.List.Attach import Init.Data.Array.Boots...
1,660
lean_file_chunk
c29f4df9323dd9b5d3b4611fef98aef05b0c4da0fe26fb9b98efa6624c407bf1
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.List.Basic public section set_option doc.verso true namespace ByteArray @[simp] theorem data_push {a : ByteArray} {b : UInt8} ...
1,263
lean_file_chunk
34a2af9cccd97746636ff60313e490eee554836570de31001369d00fd636c9be
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. Author: Leonardo de Moura -/ module prelude public import Init.Data.ByteArray.Basic import Init.Data.String.Defs import Init.Data.UInt.Basic set_option doc.verso true /-- Interprets a...
333
lean_file_chunk
058682c42b9172233403d9e123e738a06a57963e33b59efc704dc8748c1fe447
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.Int.DivMod.Basic public import Init.Data.Int.DivMod.Bootstrap public import Init.Data.Int.DivMod.Lemmas public import Init.Data.I...
251
lean_file_chunk
2e5516f60460df4ee5a0be102a2b5fc9992a09fa392488cfad9aa44396fba5e7
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.Int.Bitwise.Basic public import Init.Data.Int.Bitwise.Lemmas
4,831
lean_file_chunk
7ac93cdf7157c9c99eb9f2ae49f886e1b92f95113c959f542e62b5266d5f4509
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Deniz Aydin, Floris van Doorn, Mario Carneiro -/ module prelude public import Init.Data.Int.Basic import Init.ByCases import Init.Data.Nat.Lemmas import Init.Omega impor...
23,979
lean_file_chunk
fc8aed851d0359406463505a74a2698a9f9e0807f9bbeb9085a79b79a83633e3
lean_source_file
lean_toolchain_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, Markus Himmel -/ module prelude public import Init.Data.Nat.Lcm public import Init.Data.Int.DivMod.Basic import Init.Data.Int.DivMod.Lemmas import Init.Data.Int.Pow im...
5,738
lean_file_chunk
72c2b839a528e4d7c74aacff942d5cdb94684dce952555c76a42c0dca77e160c
lean_source_file
lean_toolchain_source_file_chunks
theorem lcm_ne_zero (hm : m ≠ 0) (hn : n ≠ 0) : lcm m n ≠ 0 := by apply Nat.lcm_ne_zero <;> simpa theorem lcm_pos : m ≠ 0 → n ≠ 0 → 0 < lcm m n := by simpa [← Nat.pos_iff_ne_zero] using lcm_ne_zero theorem eq_zero_of_lcm_eq_zero (h : lcm m n = 0) : m = 0 ∨ n = 0 := by have := lcm_ne_zero (m := m) (n := n); omeg...
23,957
lean_file_chunk
1a94b297c6508ad51c8789a7ed604ac4d10e492163d29197c4e371bf4de523c4
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Deniz Aydin, Floris van Doorn, Mario Carneiro -/ module prelude public import Init.Data.Int.Basic import Init.PropLemmas public section namespace Int open Nat /-! ##...
1,414
lean_file_chunk
f566454df8026b9c80f2eb0e1292797323ee286b05c76ad851c7d42e188a2809
lean_source_file
lean_toolchain_source_file_chunks
protected theorem eq_of_mul_eq_mul_left {a b c : Int} (ha : a ≠ 0) (h : a * b = a * c) : b = c := have : a * b - a * c = 0 := Int.sub_eq_zero_of_eq h have : a * (b - c) = 0 := by rw [Int.mul_sub, this] have : b - c = 0 := (Int.mul_eq_zero.1 this).resolve_left ha Int.eq_of_sub_eq_zero this theorem mul_eq_mul_le...
9,149
lean_file_chunk
61c4fef7bb15715f3333d6cd39544d753e40b2f9754ed5a860db28ccaf025a89
lean_source_file
lean_toolchain_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: Kim Morrison -/ module prelude public import Init.Data.Int.Gcd import Init.Data.Int.DivMod.Lemmas import Init.Omega import Init.RCases public section /-! ## Cooper resolution: small ...
557
lean_file_chunk
b86ff13b01627e791288baaac67bab233eeddf2382da8c7b14b022b1f610f82b
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 -/ module prelude public import Init.Data.Repr public import Init.Data.String.Defs namespace Int /-- Returns the decimal string representation of an integer....
23,996
lean_file_chunk
74def23731989baeb9bdefb481a9f7ab86ec94773cbfe2e0d8d8bdbf04413009
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2025 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 import all Init.Data.Int.Gcd import all Init.Data.AC import Init.LawfulBEqTactics public import Init.Data.Bool public import Ini...
23,952
lean_file_chunk
6c559fff27c5d7e45333f1eb9174895fa820f4a7c8e3a049a6b5ef9cf91753ea
lean_source_file
lean_toolchain_source_file_chunks
rw [Int.add_le_add_iff_right] at h replace h := Int.lt_of_lt_of_le h' h contradiction theorem le_eq_true (ctx : Context) (lhs rhs : Expr) : (lhs.sub rhs).norm.isValidLe → (lhs.denote ctx ≤ rhs.denote ctx) = True := by simp [Poly.isValidLe] <;> split <;> simp next p k h => intro h' replace h := cong...
23,961
lean_file_chunk
820c980e6b785fb681665c66e7089e00731c7b5581af75adb2931d319396051f
lean_source_file
lean_toolchain_source_file_chunks
next n ih => intro h₁ h₂; exact ih (orOver_resolve h₁ h₂) private theorem orOver_of_p {i n p} (h₁ : i < n) (h₂ : p i) : OrOver n p := by induction n next => simp at h₁ next n ih => simp [OrOver] cases Nat.eq_or_lt_of_le <| Nat.le_of_lt_add_one h₁ next h => subst i; exact Or.inl h₂ next h => exact...
11,111
lean_file_chunk
f6aa7bd7f0c205aa3d4e4092cf06a7fa3a31e92d3125dee660b29b3ee9ba63cd
lean_source_file
lean_toolchain_source_file_chunks
Int.blt' 0 d |>.and' (p₂.beq' (p.addConst_k b₂) |>.and' (p₃.beq' (p.addConst_k (b₁ - d*((b₁ - b₂)/d))))) theorem Poly.mul_minus_one_getConst_eq (p : Poly) : (p.mul (-1)).getConst = -p.getConst := by simp [Poly.mul] induction p <;> simp [Poly.mul', Poly.getConst, *] theorem dvd_neg_le_tight (ctx : Context) (d : In...
4,827
lean_file_chunk
4664186085241cdee1263f868f563ebe71ab2bafdb3581bf1fa9d0c2b08ebe91
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2025 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.GrindInstances.ToInt public import Init.Data.Nat.Div.Basic import Init.ByCases import Init.Data.Int.DivMod.L...
23,995
lean_file_chunk
bba96f9de3fc613a84f76f25ee29ea4bc39217513f7b88ac181cf83e8dab1741
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Deniz Aydin, Floris van Doorn, Mario Carneiro -/ module prelude import Init.Data.Order.Lemmas public import Init.Data.Order.Classes public import Init.NotationExtra impo...
23,924
lean_file_chunk
ef4a006fbefa44a2adb0651b42aa20e40f6b51fe1cc90cd397752101cdd98fb1
lean_source_file
lean_toolchain_source_file_chunks
| 0 => rfl | succ _ => rfl | -[_+1] => rfl theorem natAbs_eq : ∀ (a : Int), a = natAbs a ∨ a = -↑(natAbs a) | ofNat _ => Or.inl rfl | -[_+1] => Or.inr rfl theorem natAbs_negOfNat (n : Nat) : natAbs (negOfNat n) = n := by cases n <;> rfl theorem natAbs_mul (a b : Int) : natAbs (a * b) = natAbs a * nat...
10,992
lean_file_chunk
e272d0609ba243f167b1e4ab0e1e950c0cc1517b4ed2720c5154f4eb09411749
lean_source_file
lean_toolchain_source_file_chunks
protected theorem mul_lt_mul_of_neg_left {a b c : Int} (h : b < a) (hc : c < 0) : c * a < c * b := have : -c > 0 := Int.neg_pos_of_neg hc have : -c * b < -c * a := Int.mul_lt_mul_of_pos_left h this have : -(c * b) < -(c * a) := by rwa [← Int.neg_mul_eq_neg_mul, ← Int.neg_mul_eq_neg_mul] at this Int.lt_of_ne...
12,707
lean_file_chunk
1519c7d33395c42cbba7718dbbe9f10d50858b41c1135ef10e7e02d2c0d2a82c
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2016 Jeremy Avigad. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Jeremy Avigad, Leonardo de Moura The integers, with addition, multiplication, and subtraction. -/ module prelude public import Init.Data.Cast public import Init.Data.Nat.Basic public...
2,752
lean_file_chunk
25adfe3a019227dac8cfd0520eb12ead913c388dff460f9771be256bdd5862b0
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: Leonardo de Moura, Jeremy Avigad, Mario Carneiro, Paul Reichert -/ module prelude public import Init.Data.Ord.Basic public import Init.Data.Order.ClassesExtra import all Init.Data.Ord....
8,688
lean_file_chunk
38a566ecaebaa422db172cf409b2a45fdfddef34259dc6329a80b7a5b60ece1b
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 -/ module prelude public import Init.Data.Int.Lemmas import Init.ByCases import Init.Data.Int.Pow import Init.Omega public section /-! # Further lemmas about `Int` relying o...
549
lean_file_chunk
e5b99e389d4607dec132fabadf89d59a15472aa4fc6e9d34cd1ec0c11ef71341
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: Julia Markus Himmel -/ module prelude public import Init.Data.ToString.Extra import all Init.Data.Int.Repr import Init.Data.Int.Order import Init.Data.Int.LemmasAux namespace Int pub...
8,852
lean_file_chunk
9707f07c1fa0e956c19ac6276016b5cec2b83d11ce6a0b87372aa347a4497925
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Yury G. Kudryashov -/ module prelude public import Init.Data.Sum.Basic import all Init.Data.Sum.Basic public import Init.Ext public section /-! # Disjoint union of t...
7,443
lean_file_chunk
3843563f8e68d0bddf70e08ca77711b4859eecb305e2f9c64cf4956bf6a5381b
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2017 Mario Carneiro. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Mario Carneiro, Yury G. Kudryashov -/ module prelude public import Init.PropLemmas public section /-! # Disjoint union of types This file defines basic operations on the sum type `...
17,422
lean_file_chunk
7349080de04aa042e6534cc99fd693fed74f95031f8472942a626deea9c63a5b
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.Data.Function public import Init.Ext public import Init.Not...
16,124
lean_file_chunk
a2f56c3188218f603a0549c97f87b4363cf2188b337106fb598ab6ed7dc66cd7
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 Init.Grind.Util -- shake: keep (`@[grind]` dependency) public import I...
199
lean_file_chunk
09c16a0c6d9a5e290a3ccc0a09e5b54f02c94b6fe43626a2723ff7da91c64699
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2026 Lean FRO. 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.Int.Sum
927
lean_file_chunk
68e869d086068a5468a2cad2e7b6048dd4f11b6121d3389fd97a4bc2ea98fedd
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.List.Control public import Init.Data.List.Impl public section namespace List /-- Applies a monadic function that returns a lis...
23,969
lean_file_chunk
81b6977b8eed79c244ac5e2e57ba3dbdc0ae456cb9b5a37211778dd0825a9a2c
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 -/ module prelude public import Init.Data.List.BasicAux import all Init.Data.Lis...
23,940
lean_file_chunk
1944ea657b1c13431aced356237ba5de91b1add8986ac7dd136ea3c09babceeb
lean_source_file
lean_toolchain_source_file_chunks
@[simp] theorem getElem?_set_self {l : List α} {i : Nat} {a : α} (h : i < l.length) : (l.set i a)[i]? = some a := by simp_all /-- This differs from `getElem?_set_self` by monadically mapping `Function.const _ a` over the `Option` returned by `l[i]?`. -/ theorem getElem?_set_self' {l : List α} {i : Nat} {a : α} :...
23,988
lean_file_chunk
300a0a376bf6caf075709784dccf80a86d0acc281d75dbef55dcbb46a44eb047
lean_source_file
lean_toolchain_source_file_chunks
@[simp, grind =] theorem mem_filter : x ∈ filter p as ↔ x ∈ as ∧ p x := by induction as with | nil => simp | cons a as ih => by_cases h : p a · simp_all [or_and_left] · simp_all [or_and_right] @[simp] theorem filter_eq_nil_iff {l} : filter p l = [] ↔ ∀ a, a ∈ l → ¬p a := by simp only [eq_nil_iff_fo...
23,993
lean_file_chunk
16c6020061319105a0289492a120e38a877f5c9a1d180cb039e981cf622e6ab3
lean_source_file
lean_toolchain_source_file_chunks
theorem eq_nil_or_concat : ∀ l : List α, l = [] ∨ ∃ l' b, l = concat l' b | [] => .inl rfl | a::l => match l, eq_nil_or_concat l with | _, .inl rfl => .inr ⟨[], a, rfl⟩ | _, .inr ⟨l', b, rfl⟩ => .inr ⟨a::l', b, rfl⟩ /-! ### flatten -/ @[simp, grind _=_] theorem length_flatten {L : List (List α)} : L.flatt...
23,978
lean_file_chunk
f4f518f15cd91cd72b0b0dcb083e6a8e2e11d6e2851a0d0655cfd9bfcd8fe600
lean_source_file
lean_toolchain_source_file_chunks
@[simp] theorem reverse_append {as bs : List α} : (as ++ bs).reverse = bs.reverse ++ as.reverse := by induction as <;> simp_all grind_pattern reverse_append => (as ++ bs).reverse where as =/= [] bs =/= [] grind_pattern reverse_append => bs.reverse ++ as.reverse where as =/= [] bs =/= [] @[simp] theorem reve...
23,974
lean_file_chunk
a69903939a625dac80dd380b912e4d63b2ce4f1f2bcdc31e27f97ad15c1e9178
lean_source_file
lean_toolchain_source_file_chunks
by_cases p a <;> simp_all grind_pattern mem_partition => a ∈ (partition p l).1 grind_pattern mem_partition => a ∈ (partition p l).2 /-! ### dropLast `dropLast` is the specification for `Array.pop`, so theorems about `List.dropLast` are often used for theorems about `Array.pop`. -/ @[simp, grind =] theorem length_dr...
1,159
lean_file_chunk
c7a8250f11ec0155323a0ccfbbbaebdad580291d1dd968213831327658c16f49
lean_source_file
lean_toolchain_source_file_chunks
theorem get_of_mem {a} {l : List α} (h : a ∈ l) : ∃ n, get l n = a := by obtain ⟨n, h, e⟩ := getElem_of_mem h exact ⟨⟨n, h⟩, e⟩ theorem get_mem : ∀ (l : List α) n, get l n ∈ l | _ :: _, ⟨0, _⟩ => .head .. | _ :: l, ⟨_+1, _⟩ => .tail _ (get_mem l ..) theorem mem_iff_get {a} {l : List α} : a ∈ l ↔ ∃ n, get l n ...
14,657
lean_file_chunk
1f7605297c00795ff4ba245a87587d137fadc39596ef5628213f605418357432
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.Data.List.Attach import Init.ByCases import Init.Data.List....
16,313
lean_file_chunk
234e31512d2746b41c4dae1f9cfd0a60b666634d04664953d356973ba34cf937
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.Data.Subtype.Order import Init.Data.Order.Lemmas public imp...
23,986
lean_file_chunk
076d3cfbafcaa6635f9f05575640619179a2264fa542ca29aa2e25250ccb9ec9
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.Order.MinMaxOn public import Init.Data.List.Lemmas public import Init.Data.List.TakeDrop import Init.Data.Order.Lemmas import In...
3,916
lean_file_chunk
db9903cabd8c883bb63cbc086ab7dfb31074a29528e2a595ffee8ee15ff07bf7
lean_source_file
lean_toolchain_source_file_chunks
ext; simp only [maxOn_eq_minOn] simp only [List.maxOn?_eq_minOn?, this] letI : LE β := (inferInstance : LE β).opposite exact List.minOn?_cons @[simp] protected theorem maxOn?_singleton [LE β] [DecidableLE β] {x : α} {f : α → β} : [x].maxOn? f = some x := List.minOn?_singleton (f := f) @[simp] protected th...
10,906
lean_file_chunk
14bdcee6de5f932b105c70e816d76b504e5c93afe70a7c690500dcf1ba26ccea
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. Author: Leonardo de Moura -/ module prelude public import Init.GetElem public import Init.WFTactics import Init.ByCases import Init.Classical import Init.Data.Array.Basic import Init.Da...
20,247
lean_file_chunk
389dcf8c471c5a2f52c14b5ec15081758d1b1b0c62a1a0a42a5058e5295ebb01
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 Init.Data.Order.Lemmas public import Init.Data.BEq public import Init.Data.Order.Classes public import Init.Ext public import Init.NotationExtra i...
675
lean_file_chunk
b19e5221b99ad4677c76b2fe9af08a6501b5ad9d3cf670ffac9242fe7dd87d50
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 -/ module prelude public import Init.Data.List.Nat.Basic public import Init.Data.List.Nat.Pairwise public import Init.Data.List.Nat.Range public import Init.Data.List.Nat.Subli...
23,985
lean_file_chunk
27e82d9129b64dc353dbe7d5f514fad30b09697c9d511c25c6d8185a1e3d6fe4
lean_source_file
lean_toolchain_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 prelude import all Init.Data.List.Control public import Init.Data.List.Monadic import all Init.Data.Array.Basic import all Init.Data.Array.Set import Init.ByC...
3,386
lean_file_chunk
282fd5548007952422d689318b75e2827a866c79c3a9fee2efc586ef0367cfdd
lean_source_file
lean_toolchain_source_file_chunks
simp only [append_assoc, cons_append] rw [insertIdx_loop_toArray _ _ _ _ (by omega)] simp only [swap_toArray, w, append_assoc, cons_append, mk.injEq] rw [take_set_of_le (by omega), drop_eq_getElem_cons (i := j) (by simpa), getElem_set_self, drop_set_of_lt (by omega), drop_set_of_lt (by omega), getElem...
248
lean_file_chunk
c5ab88c024a4bb212969e0a351b1ece5056576457ec144f92780d84d37515498
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.Scan.Basic public import Init.Data.List.Scan.Lemmas
15,038
lean_file_chunk
9a1f3636264c26e728ec8905dbf45b6b27a70b947d85eef34a33bdefd3168209
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. Author: Leonardo de Moura -/ module prelude public import Init.Control.Lawful public section set_option linter.listVariables true -- Enforce naming conventions for `List`/`Array`/`Vec...
3,623
lean_file_chunk
211ec62a058a4fe8a80542c14a409dffe65f98ce7d8c517f6d533576a25cb9e4
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 import all Init.Data.List.OfFn public import Init.Data.List.Control public import Init.Data.List.OfFn import Init.Data.List.Monadic public se...
23,641
lean_file_chunk
e2349fc80d7fc1ee28f21a52aebb09ab7941d5fa7f57d37db6753ed5c192bef1
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.Data.List.Attach import all Init.Data.List.Control import I...
23,718
lean_file_chunk
8a6bae655b916dbe8b9250ff90013dbd51c4014958bc9213a187e0f29597b0b5
lean_source_file
lean_toolchain_source_file_chunks
/- Copyright (c) 2015 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Jeremy Avigad, Mario Carneiro -/ module prelude import all Init.Data.List.Attach public import Init.Data.List.Attach import Init.Data.List.Erase import Init....
23,960
lean_file_chunk
aced6aeb646f614dddfba4fecf8ba62c022eb7aaabd0a4de76dd7b28f1127a94
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 -/ module prelude public import Init.BinderPredicates public import Init.Ext pub...
23,960
lean_file_chunk
f0c7dd14c3a466f294f2cdee183ef29d72ff06a5f8a00aeaa210592e206914f5
lean_source_file
lean_toolchain_source_file_chunks
theorem infix_append_right : l₂ <:+: l₁ ++ l₂ := ⟨l₁, [], by simp⟩ theorem IsPrefix.isInfix : l₁ <+: l₂ → l₁ <:+: l₂ := fun ⟨t, h⟩ => ⟨[], t, h⟩ grind_pattern IsPrefix.isInfix => l₁ <+: l₂, IsInfix theorem IsSuffix.isInfix : l₁ <:+ l₂ → l₁ <:+: l₂ := fun ⟨t, h⟩ => ⟨t, [], by rw [h, append_nil]⟩ grind_pattern IsSuff...
5,302
lean_file_chunk
eb1c766e858ddc52879750624d46177cfebbda66d6133608752fdbf536c19cef
lean_source_file
lean_toolchain_source_file_chunks
right; exact ih.mpr ⟨s', t, List.cons.inj h |>.2⟩ /- Used internally by the `cbv` tactic. -/ instance [DecidableEq α] (l₁ l₂ : List α) : Decidable (l₁ <:+: l₂) := decidable_of_iff (l₁.isInfixOf_internal l₂) isInfixOf_internal_iff_isInfix theorem prefix_iff_eq_append : l₁ <+: l₂ ↔ l₁ ++ drop (length l₁) l₂ = l₂ :=...
23,951
lean_file_chunk
734118e5f90e4019fff82deea9bf56a8334d18ea281fbb3881f20e4f672bc2dd
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 -/ module prelude public import Init.Data.List.Notation public import Init.Data.Zero public import Init.Grind.Tactics public import Init.SimpLemmas import Init...
23,956
lean_file_chunk
e0ff6258b5983e42c8016b3babb04c0253b22038cede7720dd04241c86106a19
lean_source_file
lean_toolchain_source_file_chunks
* `List.replicate 5 "five" = ["five", "five", "five", "five", "five"]` * `List.replicate 0 "zero" = []` * `List.replicate 2 ' ' = [' ', ' ']` -/ def replicate : (n : Nat) → (a : α) → List α | 0, _ => [] | n+1, a => a :: replicate n a @[simp, grind =] theorem replicate_zero {a : α} : replicate 0 a = [] := rfl @[g...
23,988
lean_file_chunk
8cf6a69eea68edd2f83d3cecbec2d2640cf67a70b14d60e094609735387757df
lean_source_file
lean_toolchain_source_file_chunks
["circle", "square", "triangle"].modifyTailIdx 1 (fun xs => xs ++ xs) ``` ```output ["circle", "square", "triangle", "square", "triangle"] ``` ```lean example ["circle", "square", "triangle"].modifyTailIdx 2 (fun xs => xs ++ xs) ``` ```output ["circle", "square", "triangle", "triangle"] ``` ```lean example ["circle", "...
12,201
lean_file_chunk
02e3926c9a2fdc7a0eae865f8266aca3749f767db8e784f89f0e00a35be4f27d
lean_source_file
lean_toolchain_source_file_chunks
`List.intersperse` is a similar function that alternates a separator element with the elements of a list. Examples: * `List.intercalate sep [] = []` * `List.intercalate sep [a] = a` * `List.intercalate sep [a, b] = a ++ sep ++ b` * `List.intercalate sep [a, b, c] = a ++ sep ++ b ++ sep ++ c` -/ noncomputable def inter...
281
lean_file_chunk
9148bd25a603c4741cc2f002b6ed6ccece42e5af98f2cf10d2f85e764a090cb5
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 -/ module prelude public import Init.Data.List.Sort.Basic public import Init.Data.List.Sort.Impl public import Init.Data.List.Sort.Lemmas
2,275
lean_file_chunk
f3353114a542893e821fae955ea7e5e5b790b3f2ad9d5bbca770f6082c36e46b
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 -/ module prelude public meta import Init.Grind.Tactics public import Init.Notation public section /-! # Notation for `List` literals. -/ set_option linter....
1,201
lean_file_chunk
e9cefe733253467f5d054a06332c999233d8763b2eb3426f5f77ee1cea3a1a8d
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: Henrik Böving -/ module prelude public import Init.Prelude import Init.Data.List.Basic public section set_option linter.listVariables true -- Enforce naming conventions for `List`/`Array`...