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,927 | lean_file_chunk | b9563055c35ecbc5c15e26cbb35d4809e0a475d81472e2a39a55bbc672d47fe1 | lean_source_file | lean_toolchain_source_file_chunks | theorem two_pow_numBits_ne_zero : (2 ^ System.Platform.numBits : Int) ≠ 0 := by
rcases System.Platform.numBits_eq with h | h <;>
· rw [h]
decide
end System.Platform
open System.Platform in
@[simp] theorem USize.ofInt_add (x y : Int) : USize.ofInt (x + y) = USize.ofInt x + USize.ofInt y := by
dsimp only [USi... |
23,969 | lean_file_chunk | d43aa323c7043d3e20085ba95de2c09cbfe317d08a7626c1b237851a387d31d1 | lean_source_file | lean_toolchain_source_file_chunks | @[simp] protected theorem UInt32.sub_zero (a : UInt32) : a - 0 = a := UInt32.toBitVec_inj.1 (BitVec.sub_zero _)
@[simp] protected theorem UInt64.sub_zero (a : UInt64) : a - 0 = a := UInt64.toBitVec_inj.1 (BitVec.sub_zero _)
@[simp] protected theorem USize.sub_zero (a : USize) : a - 0 = a := USize.toBitVec_inj.1 (BitVec... |
23,734 | lean_file_chunk | 95b01fd2d4438fb018aae9b037c86829787deec1b052f01d32a864233f9d1527 | lean_source_file | lean_toolchain_source_file_chunks | protected theorem UInt16.two_mul {a : UInt16} : 2 * a = a + a := UInt16.toBitVec_inj.1 BitVec.two_mul
protected theorem UInt32.two_mul {a : UInt32} : 2 * a = a + a := UInt32.toBitVec_inj.1 BitVec.two_mul
protected theorem UInt64.two_mul {a : UInt64} : 2 * a = a + a := UInt64.toBitVec_inj.1 BitVec.two_mul
protected theo... |
14,380 | lean_file_chunk | 79c41538c954dddbb5002f188b616c098bceb4974a6d0f1d8be947513c111402 | 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.
Authors: Leonardo de Moura
-/
module
prelude
public import Init.Data.BitVec.BasicAux
public import Init.Data.Fin.Basic
import Init.Data.Nat.Div.Basic
public section
@[expose] section
... |
2,430 | lean_file_chunk | 048e822b31c6a666df3bc012e3e50cc497de4a9cd5ad906c0d9b269a177e30e9 | lean_source_file | lean_toolchain_source_file_chunks | /-
Copyright (c) 2022 Henrik Böving. 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.Fin.Log2
import Init.Data.UInt.BasicAux
public section
/--
Base-two logarithm of 8-bit unsigned integers. ... |
23,946 | lean_file_chunk | 833d8cd376426b0b4d09cc9a7b390e6126c50d61de9c6e275b1b3d767d825059 | 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.
Authors: Leonardo de Moura
-/
module
prelude
public import Init.Data.BitVec.Basic
@[expose] public section
open Std
set_option linter.missingDocs true
open Nat
/-- Converts a `Fin ... |
13,248 | lean_file_chunk | 73fa0e94cd100fbe4f199f4535d93b23b5e13840a9fcafa7e5a6334fa00b0907 | lean_source_file | lean_toolchain_source_file_chunks | Bitwise or for 64-bit unsigned integers. Usually accessed via the `|||` operator.
Each bit of the resulting integer is set if at least one of the corresponding bits of both input
integers are set.
This function is overridden at runtime with an efficient implementation.
-/
@[extern "lean_uint64_lor"]
protected def UIn... |
3,954 | lean_file_chunk | 5223cded9cfef11e1d8407b0a5b25d12c7997a4383af718f87069bb05606950d | 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
import all Init.Data.Char.Basic
public import Init.Data.Char.Basic
public import Init.Ext
import Init.Data.UInt.Lemmas
public ... |
744 | lean_file_chunk | 8b31223472c13d27d70f22a20d00aa14f32e52890dddee45f6464916730b58d5 | 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.Char.Basic
import Init.Data.Char.Lemmas
public import Init.Data.Order.Classes
import Init.Data.Order.Factories
import Init.PropL... |
5,976 | lean_file_chunk | ca50c88cf311b06bf5e74d702144f7fa06b45d0d9088e08aa73b48e8f7bce98a | 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.UInt.BasicAux
import Init.Data.Nat.Div.Basic
@[expose] public section
/-- Determines if the given integer is a vali... |
8,613 | lean_file_chunk | 5b161d736bf5d9b3a8fbfa01d367885c561160b150ffd6a7493e9680aa348e22 | 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.Fin.OverflowAware
public import Init.Data.Function
import Init.Data.Char.Lemmas
import Init.Data.Char.Order
import Init.Grind
pub... |
2,430 | lean_file_chunk | 0864d7d151b482796b740ee2b8b83024c6c2ee04f7a3b56e4208fdaec2c4af31 | 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: Markus Himmel
-/
module
prelude
public import Init.Data.Fin.Basic
import Init.Data.Nat.Bitwise.Lemmas
import Init.Data.Nat.Div.Basic
public section
namespace Fin
@[simp] theorem and... |
3,643 | lean_file_chunk | 52e5070673326a21f3fa5d690faaa774d3b6b42b73ad09e604e472bdb3c1421a | 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: Joe Hendrix
-/
module
prelude
public import Init.Data.Fin.Basic
import Init.PropLemmas
import Init.WFTactics
import Init.Hints
public section
namespace Fin
/--
Applies an index-depende... |
23,953 | lean_file_chunk | 0577c2d7fcb78efe1cdb81880358672e26f9afb5c4b19d86653706e0958a2a85 | 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, Leonardo de Moura
-/
module
prelude
public import Init.Ext
public import Init.Data.Nat.Div.Basic
public import Init.Data.Order.Classes
public import Init.NotationExtra
... |
23,977 | lean_file_chunk | df7ddb8dd1d436c73a7c967d5d4cc0c02ce55f0f79bb6bbfeae98120fd464131 | lean_source_file | lean_toolchain_source_file_chunks | theorem exists_castSucc_eq {n : Nat} {i : Fin (n + 1)} : (∃ j, castSucc j = i) ↔ i ≠ last n :=
⟨fun ⟨j, hj⟩ => hj ▸ Fin.ne_of_lt j.castSucc_lt_last,
fun hi => ⟨i.castLT <| Fin.val_lt_last hi, rfl⟩⟩
theorem succ_castSucc {n : Nat} (i : Fin n) : i.castSucc.succ = i.succ.castSucc := rfl
@[simp] theorem val_addNat (... |
116 | lean_file_chunk | bf29299972c08167ea83499fdd794dbd4bd511ce4b802ec8630949c68bcea825 | lean_source_file | lean_toolchain_source_file_chunks | protected theorem zero_mul [NeZero n] (k : Fin n) : (0 : Fin n) * k = 0 := by
simp [Fin.ext_iff, mul_def]
end Fin |
769 | lean_file_chunk | ea50e022aa0bc5411c02e1b6440ac69460b542875a5b2b0ff4e4bfe7119233e7 | lean_source_file | lean_toolchain_source_file_chunks | /-
Copyright (c) 2022 Henrik Böving. 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.Nat.Log2
public section
set_option linter.missingDocs true
/--
Logarithm base 2 for bounded numbers.
The... |
12,129 | lean_file_chunk | 60472247e98dc9eb2a0c1f3e2e27d22bac8cf4d335f42a4335e35fe726abebac | 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, Robert Y. Lewis, Keeley Hoek, Mario Carneiro
-/
module
prelude
public import Init.Data.Nat.Bitwise.Basic
public import Init.Data.Nat.Basic
import Init.Data.Na... |
1,289 | lean_file_chunk | 2f8a22f4785ca6d23a192282816698b88d670bc438e6d046a539e1f1cc9b078e | 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.Fin.Basic
import Init.Data.Fin.Lemmas
set_option doc.verso true
public section
namespace Fin
/--
Overflow-aware addition of a... |
11,744 | lean_file_chunk | 839642d53f7e885d3896a8a5f87395339c82630b35d514eaf0f6ee84371d1fa6 | lean_source_file | lean_toolchain_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
prelude
public import Init.Control.Lawful.Basic
public import Init.Ext
import Init.Data.Fin.Lemmas
import Init.Data.Nat.Lemmas
import Init.Omega
import... |
203 | lean_file_chunk | bd8b920a7c98986a280de091d399861fc9cb4ddae1f65e940ce2edb21bf3109c | 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.QSort.Basic |
13,420 | lean_file_chunk | aa7ab7f967d8b7545d0241e65b8ed6504f0c33864021a85446143c3ff1a68ddf | 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
public import Init.Control.Lawful
public import Init.Data.Function
import Init.Data.Array.Lemmas
import Init.Data.List.N... |
12,029 | lean_file_chunk | fcdcb063e8946f3b7f516e72c4e5ded5981310d01dbb09c077c6ed7d5700d8a0 | 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 Init.Grind.Util -- shake: keep (`@[grind]` dependency)
public import Init.BinderPredicates
public import Init.Ex... |
3,034 | lean_file_chunk | 40ae263f68da472c2d5bf714850640bdc9ca818e1311e19677f95cc46cc68370 | 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.List.Int.Sum
public import Init.Data.Array.MinMax
import Init.Data.Int.Lemmas
public section
set... |
23,959 | lean_file_chunk | 3580b7188e3643cc2b1d7970513d7eec81b51a5598555526f4c9bd08f0b9621f | 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, Kim Morrison
-/
module
prelude
public import Init.Data.List.ToArray
import all Init.Data.List.Control
import all Init.Data.Array.Basic
import all Init.Data.Array.Boots... |
23,962 | lean_file_chunk | 91bb0c4f5b878049f1580b1d298e571d9e2209373568499f6dd82f0d154ebc5b | lean_source_file | lean_toolchain_source_file_chunks | @[simp] theorem all_eq_false {p : α → Bool} {as : Array α} :
as.all p = false ↔ ∃ (i : Nat) (_ : i < as.size), ¬p as[i] := by
rw [Bool.eq_false_iff, Ne, all_eq_true]
simp
@[simp, grind =] theorem all_toList {p : α → Bool} {as : Array α} : as.toList.all p = as.all p := by
rw [Bool.eq_iff_iff, all_eq_true, Lis... |
23,979 | lean_file_chunk | 7f632c2142e1f4ee41bcb72ebab37d473c10a16266844f075ec06c1a16c27dba | lean_source_file | lean_toolchain_source_file_chunks | xs.mapM f = List.toArray <$> (xs.toList.mapM f) := by
rw [mapM_eq_foldlM, ← foldlM_toList, ← List.foldrM_reverse]
conv => rhs; rw [← List.reverse_reverse xs.toList]
induction xs.toList.reverse with
| nil => simp
| cons a l ih => simp [ih]
@[simp] theorem toList_mapM [Monad m] [LawfulMonad m] {f : α → m β} {x... |
23,918 | lean_file_chunk | 7a933cf45c689691596a7d1f6513d92a0dbd9c185607d7308d2f0e980246b734 | lean_source_file | lean_toolchain_source_file_chunks | simp only [List.append_toArray, List.push_toArray, mk.injEq, List.append_eq_append_iff,
toArray_eq_append_iff]
constructor
· rintro (⟨as, rfl, rfl⟩ | ⟨bs, rfl, h⟩)
· right; exact ⟨⟨as⟩, by simp⟩
· rw [List.singleton_eq_append_iff] at h
obtain (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩) := h
· right; exact ⟨#[... |
23,955 | lean_file_chunk | 5a859add426977ab0ca3d6fe243fb70dce05cd5650971600cc0f31eaa4333ec4 | lean_source_file | lean_toolchain_source_file_chunks | @[simp] theorem flatten_replicate_replicate : (replicate n (replicate m a)).flatten = replicate (n * m) a := by
rw [← toList_inj]
simp
theorem flatMap_replicate {f : α → Array β} : (replicate n a).flatMap f = (replicate n (f a)).flatten := by
rw [← toList_inj]
simp [List.flatMap_replicate]
@[simp] theorem isE... |
23,977 | lean_file_chunk | 955e43cb33e06cde8ec2d58e8bb7a5d0f9a0d648eb58cd3a4192f9bc86beeb93 | lean_source_file | lean_toolchain_source_file_chunks | (xs.extract start stop).foldl (init := init) f := by
simp only [foldl_eq_foldlM]
rw [foldlM_start_stop]
public theorem foldr_eq_foldr_extract {xs : Array α} {f : α → β → β} {init : β} :
xs.foldr (init := init) (start := start) (stop := stop) f =
(xs.extract stop start).foldr (init := init) f := by
simp... |
23,975 | lean_file_chunk | bd49c44a74d5b935ee80f125ecab986a0a37030c6bfa353f3a7088789dfdb261 | lean_source_file | lean_toolchain_source_file_chunks | simp [← flatMap_id, back?_flatMap]
theorem back?_replicate {a : α} {n : Nat} :
(replicate n a).back? = if n = 0 then none else some a := by
rw [replicate_eq_toArray_replicate]
simp only [List.back?_toArray, List.getLast?_replicate]
@[simp] theorem back_replicate {xs : Array α} (w : 0 < n) : (replicate n xs).b... |
13,481 | lean_file_chunk | 027aa6cf373a5faf153f07823398dc19755b42080e8449890d234fdd460f5a17 | lean_source_file | lean_toolchain_source_file_chunks | (range' start size step).toList = List.range' start size step := by
apply List.ext_getElem <;> simp [range']
@[simp, grind =]
theorem getElem_range' {start size step : Nat} {i : Nat}
(h : i < (Array.range' start size step).size) :
(Array.range' start size step)[i] = start + step * i := by
simp [← getElem_t... |
6,914 | lean_file_chunk | 1d3161fde517cbdf4b11864df26a4760e589f9b07ee581a4335141c1b66b73d7 | 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
import all Init.Data.Array.Basic
public import Init.Data.Array.Basic
public import Init.Data.Nat.Lemmas
import Init.ByCases
import Init.Clas... |
13,459 | lean_file_chunk | bc6fa54e20f9904dc1829c5dd4c241115a64b9f554040d20e44dd2b69454e00b | 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.Data.Array.Basic
public import Init.Data.Slice.Operations
public section
set_option linter.indexVariables true -- Enfor... |
14,093 | lean_file_chunk | 02dc2ca0c4fccd3f593e4ae1edf9df2b360a88f7179b9833800d384af5b58804 | 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.Array.Lemmas
import Init.Data.List.MinMax
public import Init.Data.Order.Classes
import Init.Data.Array.Bootstrap
import Init.Dat... |
3,750 | lean_file_chunk | e43a96241d6e7ce36bab9c4416186571a1c4eb257d720a107722ef75c5ee3319 | 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
import all Init.Data.Array.Basic
public import Init.Data.Array.Set
public import Init.Util
import Init.Data.Nat.Linear
public section
set_... |
4,977 | lean_file_chunk | 2cfcd8915a74875ff2a5a84f4e48aa9a6efcf9191d3d29c6b34ebafaffdcbcd0 | 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.Array.Basic
import Init.Data.List.Nat.InsertIdx
import Init.Data.List.ToArray
import Init.Data.Nat.Lemmas
import Init.Omega
publ... |
241 | lean_file_chunk | fcedeb4a0635c183414323fc338d549276816515b49f572bea0ca324b48fa204 | 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.
Author: Kim Morrison
-/
module
prelude
public import Init.Data.Array.Lex.Basic
public import Init.Data.Array.Lex.Lemmas |
14,474 | lean_file_chunk | fb459512393487b48f4ddcd974ebe89ad7835b7f97aa8f5829502fe769ef7c1d | 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.BinderPredicates
public import Init.Ext
public import Init.NotationExtra
import Init.ByCases
import Init.Data.Array.Bootstrap
import I... |
3,349 | lean_file_chunk | c77e46c05626004a8ada48106e54b5302eb553dd438ee5bfa7b69ac6b584d809 | 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.Array.MinMax
import Init.Data.List.Nat.Sum
import Init.Data.Array.Lemmas
public section
set_opti... |
5,419 | lean_file_chunk | ee44907204fe99ed25c04d7952ce593f450f351a928559a80ab9c01943b10ff5 | 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.Data.Array.Basic
import Init.Data.Bool
import Init.Omega
import Init.WFTactics
public section
universe u v
set_option l... |
1,718 | lean_file_chunk | 06d4c3d65559b051ef8ffe88a57499d65ef3daaa325f8c0eca026c0f8564b681 | 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.Array.Basic
import Init.Data.Array.Lemmas
import Init.Data.Array.OfFn
import Init.Data.Fin.Lemmas
import Init.Omega
p... |
19,470 | lean_file_chunk | c488b3dbaf0f4ae9e1c1d0ba5b221bd6cdd6bafea03832b3aaaa419f0a0c7763 | 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.List.Control
import all Init.Data.Array.Basic
public import Init.Data.Array.Attach
import Init.Data.Bool
public section
/-!
# Lemm... |
4,904 | lean_file_chunk | c3f23a9ec552dc928357191730c702c2f08c6e966562e69ed51ae8ecf1d4be93 | 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.Array.Basic
public import Init.Data.Array.Basic
import Init.Data.Array.Lemmas
import Init.Data.List.Nat.Perm
import Init.Data.List.Nat.Ta... |
1,406 | lean_file_chunk | 84e74fb8fbe8db8bcd983e13ea2d06a363712b54e562c86809d5275aa07fd44b | 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.
Authors: Leonardo de Moura
-/
module
prelude
public import Init.Data.Array.Basic
public section
set_option linter.listVariables true -- Enforce naming conventions for `List`/`Array`/`... |
23,972 | lean_file_chunk | 0386828602e39cc1e9332d2e8ab7b1085102fdf244c79e82cb3d9f70c0ff9fb8 | 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.
Authors: Leonardo de Moura
-/
module
prelude
public import Init.Control.Do
public import Init.GetElem
public import Init.Data.List.ToArrayImpl
import all Init.Data.List.ToArrayImpl
publ... |
23,968 | lean_file_chunk | 57b08c8bc167f9b59b83ea8a3c34412af34a384dcc7f69a2c1c6d53f6a2962df | lean_source_file | lean_toolchain_source_file_chunks | The accumulated value is combined with the each element of the list in reverse order, using `f`.
The optional parameters `start` and `stop` control the region of the array to be folded. Folding
proceeds from `start` (exclusive) to `stop` (inclusive), so no folding occurs unless `start > stop`.
By default, the entire a... |
23,975 | lean_file_chunk | e422ce36e344fb169556fea8327df0f3deeace389fba1da9398ada233360e5d2 | lean_source_file | lean_toolchain_source_file_chunks | Checks whether `a` is an element of `as`, using `==` to compare elements.
`Array.contains` is a synonym that takes the array before the element.
For verification purposes, `Array.elem` is simplified to `Array.contains`.
Example:
* `Array.elem 3 #[1, 4, 2, 3, 3, 7] = true`
* `Array.elem 5 #[1, 4, 2, 3, 3, 7] = false`... |
915 | lean_file_chunk | f90c9cf3aee4bb4ab6feaf9348525f98c5ae1a0524d7357821a36b7c162d72a0 | lean_source_file | lean_toolchain_source_file_chunks | /-! ### getEvenElems -/
/--
Returns a new array that contains the elements at even indices in `as`, starting with the element at
index `0`.
Examples:
* `#[0, 1, 2, 3, 4].getEvenElems = #[0, 2, 4]`
* `#[1, 2, 3, 4].getEvenElems = #[1, 3]`
* `#["red", "green", "blue"].getEvenElems = #["red", "blue"]`
* `(#[] : Array St... |
245 | lean_file_chunk | a6e8337268e4cc2f834f6d53330ff48fe57cde5ec178e21178044d026dfa5993 | 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.Array.Sort.Basic
public import Init.Data.Array.Sort.Lemmas |
4,584 | lean_file_chunk | 3e0a4e5e4e57e08ae80a602a7bb15a8f6eb31062c04ea89d99287e075d63cd15 | 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.Array.Basic
public import Init.Data.List.Control
import Init.Data.List.Lemmas
import Init.Data.List.TakeDrop
public section
/-... |
1,877 | lean_file_chunk | 27a4d5a10ebf4eb757f54f4be621a8b013bbf18e20c64c52a66284c37e40ec5f | 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.Tactics
public section
set_option linter.listVariables true -- Enforce naming conventions for `List`/`A... |
1,310 | lean_file_chunk | a2cbaabcbe6469716a82741159a75c18b40b770c6a9526e142bea805b110ebf8 | 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: Markus Himmel
-/
module
prelude
import all Init.Data.Array.Basic
public import Init.Data.Array.Basic
public import Init.NotationExtra
import Init.Data.Array.Lemmas
import Init.Data.Lis... |
12,270 | lean_file_chunk | 7d0f4bde66067dd45dda02801a0ec3f571b8af8312c7d0e345fea355188a49c8 | 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.Array.OfFn
public import Init.BinderPredicates
public import Init.Data.Nat.Lemmas
public import Ini... |
2,214 | lean_file_chunk | 93ecbb5da99e062da7e89c448355faeee0c938895600e7a2c618a3281aec2c87 | 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.
Authors: Leonardo de Moura
-/
module
prelude
public import Init.GetElem
import Init.Data.Array.Basic
public section
set_option linter.listVariables true -- Enforce naming conventions... |
4,802 | lean_file_chunk | e892df54221ddc2d406c7976482db7781fa4ba02d05bdc55b46bedfff8024896 | 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
public import Init.Data.List.OfFn
import Init.Data.Array.Bootstrap
import Init.Data.Array.Monadic
import Init.Data.Fin.L... |
2,332 | lean_file_chunk | c155eb2f0fae22e706f604ee1df48b6d7673da86a2ec1b38cc53fb90d80ea610 | 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, Joachim Breitner
-/
module
prelude
public import Init.Data.Array.Basic
public import Init.WFTactics
import Init.Data.List.BasicAux
import Init.Data.Nat.Linea... |
23,989 | lean_file_chunk | 46275f39152a1378e1b3b8e1b3fce2312e52f2f72968fa96180ac9f5e9c93738 | lean_source_file | lean_toolchain_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: Joachim Breitner, Mario Carneiro
-/
module
prelude
import all Init.Data.List.Attach
public import Init.Data.Array.Lemmas
import Init.Data.Array.Bootstrap
import Init.Data.Array.Coun... |
8,722 | lean_file_chunk | e31b8cff995236bca1c43507d17f85e4e44d7a5325bc1735361fc22a5fbef593 | lean_source_file | lean_toolchain_source_file_chunks | @[simp] theorem unattach_attach {xs : Array α} : xs.attach.unattach = xs := by
cases xs
simp only [List.attach_toArray, List.unattach_toArray, List.unattach_attachWith]
@[simp] theorem unattach_attachWith {p : α → Prop} {xs : Array α}
{H : ∀ a ∈ xs, p a} :
(xs.attachWith p H).unattach = xs := by
cases xs... |
19,275 | lean_file_chunk | 774d335a558596908adcb450fb8230ad6716ff7d17b454076b2cf57997c99f38 | 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, Kim Morrison
-/
module
prelude
import all Init.Data.Array.Basic
public import Init.Data.List.MapIdx
import all Init.Data.List.MapIdx
import Init.Data.Array.OfFn
publi... |
18,582 | lean_file_chunk | 191f11e637a94ee2633d9a2e69f9781f28d5affbdd517ebb55e39e272c2c3f1c | 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
public import Init.Data.Array.Lemmas
import Init.Data.Array.Bootstrap
import Init.Data.Bool
import Init.Data.List.Erase
... |
23,968 | lean_file_chunk | 04139d4a90f26b16d6047ab912e85d735d3b9c0b0bfd289434ab0072f82cdaa4 | 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.List.Nat.Sum
import all Init.Data.Array.Basic
public import Init.Data.Array.Attach
public import Init.Data.Option.BasicAux
import Init.B... |
7,846 | lean_file_chunk | f4cc22a825fb8955f3b5380772dad1664523d73442037e232c84d18eb3220bfc | lean_source_file | lean_toolchain_source_file_chunks | xs.findIdx? f = xs.unattach.findIdx? g := by
cases xs
simp [hf]
@[simp, grind =] theorem findIdx?_take {xs : Array α} {i : Nat} {p : α → Bool} :
(xs.take i).findIdx? p = (xs.findIdx? p).bind (Option.guard (fun j => j < i)) := by
cases xs
simp
/-! ### findFinIdx? -/
@[grind =]
theorem findFinIdx?_empty {p... |
1,975 | lean_file_chunk | 953f9482bf336d1de4b4973df2279684d35c807e38631596cc4e28038c0419d2 | 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, Robin Arnez
-/
module
prelude
public import Init.Data.Dyadic.Basic
public import Init.Grind.Ordered.Ring
import Init.Data.Rat.Lemmas
/-! # Internal `grind` algebra insta... |
2,873 | lean_file_chunk | a5acc8340e989d3a7e7781061171c6d93a5a5816811d8b398983eb121aca06ee | 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.Dyadic.Basic
import Init.Data.Dyadic.Instances
import Init.Grind.Ordered.Rat
import Init.Grind.Ordered.Field
import Init.ByCases
... |
23,942 | lean_file_chunk | cf4aa330ed31425c97aaef8fcc3f08730c78e3a40a5952664e88a753f4eafb71 | 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, Robin Arnez
-/
module
prelude
import Init.Data.Int.Bitwise.Lemmas
public import Init.Data.Int.Bitwise.Basic
public import Init.Data.Order.Classes
public import Init.Data.... |
5,122 | lean_file_chunk | 88878f671728e8e5946831f67578b72bc6f276033521e2ade529afac2e413a05 | lean_source_file | lean_toolchain_source_file_chunks | theorem add_mul (x y z : Dyadic) : (x + y) * z = x * z + y * z := by
simp [← toRat_inj, Rat.add_mul]
theorem mul_add (x y z : Dyadic) : x * (y + z) = x * y + x * z := by
simp [← toRat_inj, Rat.mul_add]
theorem neg_add_cancel (x : Dyadic) : -x + x = 0 := by
simp [← toRat_inj, Rat.neg_add_cancel]
theorem neg_mul... |
2,704 | lean_file_chunk | cb12ed5ccf4a55e5e4455306624608d58a852d89527bd44086a5085b5faba60d | 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.Dyadic.Basic
import Init.Data.Rat.Lemmas
/-!
# Inversion for dyadic numbers
-/
@[expose] public section
namespace Dyadic
/--
... |
2,789 | lean_file_chunk | 9b30e8cf97ccd08b648908b4efdbcdfd0a2743e4a295e6ce0606f611fbd86043 | 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: Joe Hendrix, Harun Khan, Alex Keizer, Abdalrhman M Mohamed, Siddharth Bhat
-/
module
prelude
import Init.Ext
public import Init.Data.BitVec.Basic
public import Init.PropLemmas
import ... |
23,925 | lean_file_chunk | 040de3039d0e9e347be3a06cee111be48de456de09e2c8333f2abb23a0216bc7 | 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: Joe Hendrix, Harun Khan, Alex Keizer, Abdalrhman M Mohamed, Siddharth Bhat, Luisa Cicolini
-/
module
prelude
import all Init.Data.BitVec.Basic
import all Init.Data.BitVec.BasicAux
publ... |
23,967 | lean_file_chunk | 805e1228d608965a2fb90c733efdef19418b102f6bf3391d6ed229e17cbd2595 | lean_source_file | lean_toolchain_source_file_chunks | rw [toInt_ofInt, Int.bmod_eq_of_le] <;> (rw [hw]; simp [Int.natCast_pow]; omega)
@[simp, grind =] theorem ofInt_natCast (w n : Nat) :
BitVec.ofInt w (n : Int) = BitVec.ofNat w n := rfl
@[simp] theorem ofInt_ofNat (w n : Nat) :
BitVec.ofInt w (no_index (OfNat.ofNat n)) = BitVec.ofNat w (OfNat.ofNat n) := rfl
grin... |
23,935 | lean_file_chunk | eeca35d761b1562ac0dd6e091284944999ea4e3a913db644c18c4cf0cd6ceadd | lean_source_file | lean_toolchain_source_file_chunks | simp only [BitVec.extractLsb]
ext k hk
simp
omega
theorem setWidth_extractLsb'_of_le {c : BitVec w} (h : len₁ ≤ len₂) :
(c.extractLsb' start len₂).setWidth len₁ = c.extractLsb' start len₁ := by
ext i hi
simp [show i < len₂ by omega]
theorem extractLsb'_cast {x : BitVec w} :
(x.cast hcast).extractLsb... |
23,979 | lean_file_chunk | bbdf9dff5c453927f1afd5f74d24083d881262fd2f778fe56f5c12468cad6be6 | lean_source_file | lean_toolchain_source_file_chunks | rw [shiftLeftZeroExtend_eq, toFin_shiftLeft, toNat_setWidth, Nat.mod_eq_of_lt (by omega), Nat.shiftLeft_eq]
@[simp] theorem getElem_shiftLeftZeroExtend {x : BitVec m} {n : Nat} (h : i < m + n) :
(shiftLeftZeroExtend x n)[i] = if h' : i < n then false else x[i - n] := by
rw [shiftLeftZeroExtend_eq]
simp only [g... |
23,981 | lean_file_chunk | 3f5acbae51c3f622d8354def7a670fd92e7662444d871a8bc9bcca1668466bfa | lean_source_file | lean_toolchain_source_file_chunks | Bool.true_and]
by_cases hni : n + i < w
<;> (simp [hni]; omega)
/-- Sign extending to a width smaller than the starting width is a truncation. -/
theorem signExtend_eq_setWidth_of_le (x : BitVec w) {v : Nat} (hv : v ≤ w) :
x.signExtend v = x.setWidth v := by
ext i h
simp [getElem_signExtend, show i < w by om... |
23,990 | lean_file_chunk | 209df0875cb02e06f4210e2c45e39a6603257991d39e9f5f8ab74668e77eca17 | lean_source_file | lean_toolchain_source_file_chunks | b &&& (BitVec.allOnes w).setWidth (w' + w) = 0#w' ++ b.setWidth w := by
ext i hi
simp only [getElem_and, getElem_setWidth, getLsbD_allOnes]
rw [BitVec.getElem_append]
split <;> simp_all
/-! ### rev -/
@[grind =]
theorem getLsbD_rev (x : BitVec w) (i : Fin w) :
x.getLsbD i.rev = x.getMsbD i := by
simp on... |
23,947 | lean_file_chunk | c893e48ba3449a13af8acac7896276aa66eae05a24e706b68d515750fb9f2521 | lean_source_file | lean_toolchain_source_file_chunks | apply eq_of_toInt_eq
simp [toInt_neg, Int.sub_eq_add_neg]
@[simp]
theorem sub_neg {x y : BitVec w} : x - - y = x + y := by
apply eq_of_toInt_eq
simp [toInt_neg]
theorem neg_sub {x y : BitVec w} : - (x - y) = - x + y := by
rw [sub_eq_add_neg, neg_add, sub_neg]
/- ### add/sub injectivity -/
@[simp]
protected t... |
23,996 | lean_file_chunk | 2b2b45b255378ca49ed1fcb93e67020b667f6d92b5dfc3ad01a2b5278a449cbc | lean_source_file | lean_toolchain_source_file_chunks | · rw [Nat.div_lt_iff_lt_mul (k := y.toNat) (x := x.toNat) (y := 2 ^ w) (by omega), show x.toNat = x.toNat * 1 by omega]
apply Nat.mul_lt_mul_of_le_of_lt (by omega) (by omega) (by omega)
/-- Non-overflowing signed division bounds when numerator is nonneg, denominator is nonneg. -/
theorem toInt_ediv_toInt_lt_of_non... |
23,967 | lean_file_chunk | 177f3df0b5a13f0522019ffb8744dea0bff5ce7fad00c9d72e488c5756895eb5 | lean_source_file | lean_toolchain_source_file_chunks | (twoPow w i).msb = (decide (i < w) && decide (i = w - 1)) := by
simp only [BitVec.msb, getMsbD_eq_getLsbD, Nat.sub_zero, getLsbD_twoPow,
Bool.and_eq_right_iff_imp, Bool.and_eq_true, decide_eq_true_eq, and_imp]
intros
omega
@[grind =]
theorem toInt_twoPow {w i : Nat} :
(BitVec.twoPow w i).toInt = if w ≤ i... |
23,922 | lean_file_chunk | 7eae5f24596aeffe35c6b0bbf99cc8c0e7fd623857c6975faffd26537d2d548e | lean_source_file | lean_toolchain_source_file_chunks | - If `x : BitVec w` is `intMin`, then its absolute value is also `intMin w`, and
thus `toInt` will equal `intMin.toInt`.
- Otherwise, if `x` is negative, then `x.abs.toInt = (-x).toInt`.
- If `x` is positive, then it is equal to `x.abs.toInt = x.toInt`.
-/
theorem toInt_abs_eq_ite {x : BitVec w} :
x.abs.toInt =
... |
9,097 | lean_file_chunk | f212af8ae3b1c252716dd8b033a57d5212cd9d7ceaae8eb2e9e944a47e436443 | lean_source_file | lean_toolchain_source_file_chunks | ((x.reverse.clzAuxRec (w - 1)).toNat ≤ (BitVec.ofNat w w).toNat) by simp, ← le_def]
apply clzAuxRec_le (x := x.reverse) (n := w - 1)
let j := (x.reverse.clzAuxRec (w - 1)).toNat - 1 - i
rw [show w - 1 - i = w - (x.reverse.clzAuxRec (w - 1)).toNat + j by
subst j
rw [Nat.sub_sub (n := (x.reverse... |
1,361 | lean_file_chunk | d10a77c49dc737bd44486122c633f6941f95233916f313eeb12548d8a6156600 | 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: Joe Hendrix, Wojciech Nawrocki, Leonardo de Moura, Mario Carneiro, Alex Keizer, Harun Khan, Abdalrhman M Mohamed
-/
module
prelude
public import Init.Grind.Tactics
public section
set... |
23,934 | lean_file_chunk | d902446fda37f029e3fad8a2459dabf9b38793cfc8482609b850e54b6093f5c4 | 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: Joe Hendrix, Wojciech Nawrocki, Leonardo de Moura, Mario Carneiro, Alex Keizer, Harun Khan, Abdalrhman M Mohamed, Siddharth Bhat
-/
module
prelude
public import Init.Data.Int.Bitwise.B... |
4,527 | lean_file_chunk | 167b6ae0c9d7a69d9b27c47326014526e7488a56abdda48cfb209ea79718c366 | lean_source_file | lean_toolchain_source_file_chunks | @[simp, grind =] theorem add_eq (x y : BitVec w) : BitVec.add x y = x + y := rfl
@[simp, grind =] theorem sub_eq (x y : BitVec w) : BitVec.sub x y = x - y := rfl
@[simp, grind =] theorem mul_eq (x y : BitVec w) : BitVec.mul x y = x * y ... |
6,300 | lean_file_chunk | 78b50f64d8edc1dd5abb9e7e6a1b817a1a812c769d71c6d694efd6b6de2b1dd3 | 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: Joe Hendrix, Harun Khan, Alex Keizer, Abdalrhman M Mohamed, Siddharth Bhat
-/
module
prelude
public import Init.Data.BitVec.Basic
import all Init.Data.BitVec.Basic
import Init.Ext
impo... |
4,746 | lean_file_chunk | 5ff308b6e8d7a69f5e08b68d2b0a4524d107e558d93bb9a2f539e713831e52cd | 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: Joe Hendrix, Harun Khan
-/
module
prelude
import all Init.Data.BitVec.Basic
public import Init.Data.BitVec.Basic
public import Init.Ext
import Init.Data.BitVec.Lemmas
import Init.Data.... |
23,987 | lean_file_chunk | 68c46475484dd13da50e5c2f37b38e4d82c2352811c199565908eb3669ad7582 | 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: Harun Khan, Abdalrhman M Mohamed, Joe Hendrix, Siddharth Bhat
-/
module
prelude
import all Init.Data.Nat.Bitwise.Basic
import all Init.Data.Int.DivMod
import all Init.Data.BitVec.Basic... |
23,973 | lean_file_chunk | 4d51089faed9c468c0978e272c85c0be5b98b999f48af3571d0ce7784d58b701 | lean_source_file | lean_toolchain_source_file_chunks | getElem_twoPow]
by_cases hik : i = k
· subst hik
simp
· by_cases hik' : k < (i + 1)
· have hik'' : k < i := by omega
simp [hik', hik'']
omega
· have hik'' : ¬ (k < i) := by omega
simp [hik', hik'']
omega
· ext k
simp only [and_twoPow,
]
by_ca... |
23,967 | lean_file_chunk | cfbed37d74333df3c51dea1a5fecb1a6188b180c73c7d696cbd23d9dc002fc60 | lean_source_file | lean_toolchain_source_file_chunks | simp [and_twoPow]
· simp [setWidth_setWidth_succ_eq_setWidth_setWidth_of_getLsbD_false, h]
/--
Show that `x >>> y` can be written in terms of `ushiftRightRec`.
This can be unfolded in terms of `ushiftRightRec_zero`, `ushiftRightRec_succ` for bit blasting.
-/
theorem shiftRight_eq_ushiftRightRec (x : BitVec w₁) (y ... |
23,961 | lean_file_chunk | 27622a6004c3528e0f468ba8c406ab6f9e7549011d810509cf79ab1336f32acb | lean_source_file | lean_toolchain_source_file_chunks | rw [toInt_eq_toNat_of_msb (msb_umod_eq_false_of_left h _), toNat_umod]
rw [toInt_eq_toNat_of_msb h, toInt_eq_neg_toNat_neg_of_msb_true h']
rw [Int.tmod_neg, ← Int.ofNat_tmod]
· cases h' : y.msb
· dsimp only
rw [toInt_eq_neg_toNat_neg_of_msb_true h, toInt_eq_toNat_of_msb h', Int.neg_tmod]
r... |
20,069 | lean_file_chunk | ee1ffe5a53a206c1dff110fd221b1fc9dc836c02f53d1a5c31684657130483fd | lean_source_file | lean_toolchain_source_file_chunks | · simp only [show y.clz.toNat = w + 1 by omega, Nat.add_sub_cancel_left,
Nat.pow_one] at hlty
simp only [show y.toNat = 1 by omega, Nat.mul_one, Nat.not_lt] at h'
omega
· by_cases w + 1 < y.clz.toNat
· omega
· simp only [Nat.not_l... |
4,492 | lean_file_chunk | 49e5fe4e34920a3cef2a22fdd59d7dafb45ec688240da2ca21ea6da74aa1f540 | 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.Slice.Operations
import all Init.Data.Slice.Operations
import Init.Data.Iterators.Lemmas.Consumers
public import Init.Data.List.... |
294 | lean_file_chunk | 0c0b170c53e0070f278b5bad51abd33ac469c93e8a8c7c2bf298cf83700636c5 | 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.Slice.List.Basic
public import Init.Data.Slice.List.Iterator
public import Init.Data.Slice.List.Lemmas |
2,341 | lean_file_chunk | 72587cc1c6df62869fca6a3f63a07a342b4c9f984a7d2a8c0f553c3ddaa12630 | 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.Slice.Operations
import all Init.Data.Slice.Operations
public import Init.Data.Iterators.Consumers.Collect
import Init.Data.Iter... |
1,168 | lean_file_chunk | 52557a3e4646f9b96c62fabc7fffc00ae0e7ed4a61e3913d376fe770e648fafc | 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.Core
public section
namespace Std.Slice
/--
Wrapper structure for slice types that makes generic slice functions available via dot... |
4,366 | lean_file_chunk | 00a6b098e29739952481f4461fe442bac2f740f276396e4a04be9dde669ce67e | 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.Slice.Basic
public import Init.Data.Iterators.ToIterator
public import Init.Data.Iterators.Consumers.Loop
import Init.Data.Itera... |
4,941 | lean_file_chunk | e3596c9c1a325049c1d1def5ce3012723b6a5bc0cec25ed63f6bb0eee808957f | 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.PRange
set_option doc.verso true
set_option linter.missingDocs true
public section
/-!
# Slice notation
Th... |
297 | lean_file_chunk | dfa421feb872b4b94714f502ac993e384500c9ff1ca5574f423aa23b40016dcb | 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.Slice.Array.Basic
public import Init.Data.Slice.Array.Iterator
public import Init.Data.Slice.Array.Lemmas |
243 | lean_file_chunk | 1a84e4dc8a834d4eee2461c0b5d92f8082ff7719b8f4fc64efb06f53b0fff722 | 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.Nat.Div.Basic
public import Init.Data.Nat.Div.Lemmas |
251 | lean_file_chunk | ddc1c6b49316e61d6688b1828d680464979a6e6e41eebecebcb707a203c65834 | 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.Nat.Bitwise.Basic
public import Init.Data.Nat.Bitwise.Lemmas |
19,705 | lean_file_chunk | 8827c4f5305a092c3362c66a46b8192f0367013851e012ab03516fc0c76d4575 | 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: Jeremy Avigad, Leonardo de Moura, Mario Carneiro, Markus Himmel
-/
module
prelude
public import Init.NotationExtra
public import Init.Data.Nat.Div.Basic
import Init.Data.Nat.Dv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.