state stringlengths 0 159k | srcUpToTactic stringlengths 387 167k | nextTactic stringlengths 3 9k | declUpToTactic stringlengths 22 11.5k | declId stringlengths 38 95 | decl stringlengths 16 1.89k | file_tag stringlengths 17 73 |
|---|---|---|---|---|---|---|
n : ℕ
⊢ (bif bodd n then 0 else 1) + (bif bodd n then succ (div2 n) else div2 n) * 2 = succ n | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | refine' Eq.trans _ (congr_arg succ (bodd_add_div2 n)) | theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
| 0 => rfl
| succ n => by
simp only [bodd_succ, Bool.cond_not, div2_succ, Nat.mul_comm]
| Mathlib.Init.Data.Nat.Bitwise.128_0.OFUBkIQvV236FCW | theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
| 0 => rfl
| succ n => by
simp only [bodd_succ, Bool.cond_not, div2_succ, Nat.mul_comm]
refine' Eq.trans _ (congr_arg succ (bodd_add_div2 n))
cases bodd n <;> simp [cond, not]
· rw [Nat.add_comm, Nat.add_succ]
· rw [succ_mul, Nat.ad... | Mathlib_Init_Data_Nat_Bitwise |
n : ℕ
⊢ (bif bodd n then 0 else 1) + (bif bodd n then succ (div2 n) else div2 n) * 2 =
succ ((bif bodd n then 1 else 0) + 2 * div2 n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | cases bodd n | theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
| 0 => rfl
| succ n => by
simp only [bodd_succ, Bool.cond_not, div2_succ, Nat.mul_comm]
refine' Eq.trans _ (congr_arg succ (bodd_add_div2 n))
| Mathlib.Init.Data.Nat.Bitwise.128_0.OFUBkIQvV236FCW | theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
| 0 => rfl
| succ n => by
simp only [bodd_succ, Bool.cond_not, div2_succ, Nat.mul_comm]
refine' Eq.trans _ (congr_arg succ (bodd_add_div2 n))
cases bodd n <;> simp [cond, not]
· rw [Nat.add_comm, Nat.add_succ]
· rw [succ_mul, Nat.ad... | Mathlib_Init_Data_Nat_Bitwise |
case false
n : ℕ
⊢ (bif false then 0 else 1) + (bif false then succ (div2 n) else div2 n) * 2 =
succ ((bif false then 1 else 0) + 2 * div2 n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp [cond, not] | theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
| 0 => rfl
| succ n => by
simp only [bodd_succ, Bool.cond_not, div2_succ, Nat.mul_comm]
refine' Eq.trans _ (congr_arg succ (bodd_add_div2 n))
cases bodd n <;> | Mathlib.Init.Data.Nat.Bitwise.128_0.OFUBkIQvV236FCW | theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
| 0 => rfl
| succ n => by
simp only [bodd_succ, Bool.cond_not, div2_succ, Nat.mul_comm]
refine' Eq.trans _ (congr_arg succ (bodd_add_div2 n))
cases bodd n <;> simp [cond, not]
· rw [Nat.add_comm, Nat.add_succ]
· rw [succ_mul, Nat.ad... | Mathlib_Init_Data_Nat_Bitwise |
case true
n : ℕ
⊢ (bif true then 0 else 1) + (bif true then succ (div2 n) else div2 n) * 2 =
succ ((bif true then 1 else 0) + 2 * div2 n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp [cond, not] | theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
| 0 => rfl
| succ n => by
simp only [bodd_succ, Bool.cond_not, div2_succ, Nat.mul_comm]
refine' Eq.trans _ (congr_arg succ (bodd_add_div2 n))
cases bodd n <;> | Mathlib.Init.Data.Nat.Bitwise.128_0.OFUBkIQvV236FCW | theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
| 0 => rfl
| succ n => by
simp only [bodd_succ, Bool.cond_not, div2_succ, Nat.mul_comm]
refine' Eq.trans _ (congr_arg succ (bodd_add_div2 n))
cases bodd n <;> simp [cond, not]
· rw [Nat.add_comm, Nat.add_succ]
· rw [succ_mul, Nat.ad... | Mathlib_Init_Data_Nat_Bitwise |
case false
n : ℕ
⊢ 1 + div2 n * 2 = succ (div2 n * 2) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [Nat.add_comm, Nat.add_succ] | theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
| 0 => rfl
| succ n => by
simp only [bodd_succ, Bool.cond_not, div2_succ, Nat.mul_comm]
refine' Eq.trans _ (congr_arg succ (bodd_add_div2 n))
cases bodd n <;> simp [cond, not]
· | Mathlib.Init.Data.Nat.Bitwise.128_0.OFUBkIQvV236FCW | theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
| 0 => rfl
| succ n => by
simp only [bodd_succ, Bool.cond_not, div2_succ, Nat.mul_comm]
refine' Eq.trans _ (congr_arg succ (bodd_add_div2 n))
cases bodd n <;> simp [cond, not]
· rw [Nat.add_comm, Nat.add_succ]
· rw [succ_mul, Nat.ad... | Mathlib_Init_Data_Nat_Bitwise |
case true
n : ℕ
⊢ succ (div2 n) * 2 = succ (1 + div2 n * 2) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [succ_mul, Nat.add_comm 1, Nat.add_succ] | theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
| 0 => rfl
| succ n => by
simp only [bodd_succ, Bool.cond_not, div2_succ, Nat.mul_comm]
refine' Eq.trans _ (congr_arg succ (bodd_add_div2 n))
cases bodd n <;> simp [cond, not]
· rw [Nat.add_comm, Nat.add_succ]
· | Mathlib.Init.Data.Nat.Bitwise.128_0.OFUBkIQvV236FCW | theorem bodd_add_div2 : ∀ n, cond (bodd n) 1 0 + 2 * div2 n = n
| 0 => rfl
| succ n => by
simp only [bodd_succ, Bool.cond_not, div2_succ, Nat.mul_comm]
refine' Eq.trans _ (congr_arg succ (bodd_add_div2 n))
cases bodd n <;> simp [cond, not]
· rw [Nat.add_comm, Nat.add_succ]
· rw [succ_mul, Nat.ad... | Mathlib_Init_Data_Nat_Bitwise |
n : ℕ
⊢ div2 n = n / 2 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | refine'
Nat.eq_of_mul_eq_mul_left (by decide)
(Nat.add_left_cancel (Eq.trans _ (Nat.mod_add_div n 2).symm)) | theorem div2_val (n) : div2 n = n / 2 := by
| Mathlib.Init.Data.Nat.Bitwise.138_0.OFUBkIQvV236FCW | theorem div2_val (n) : div2 n = n / 2 | Mathlib_Init_Data_Nat_Bitwise |
n : ℕ
⊢ 0 < 2 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | decide | theorem div2_val (n) : div2 n = n / 2 := by
refine'
Nat.eq_of_mul_eq_mul_left (by | Mathlib.Init.Data.Nat.Bitwise.138_0.OFUBkIQvV236FCW | theorem div2_val (n) : div2 n = n / 2 | Mathlib_Init_Data_Nat_Bitwise |
n : ℕ
⊢ n % 2 + 2 * div2 n = n | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [mod_two_of_bodd, bodd_add_div2] | theorem div2_val (n) : div2 n = n / 2 := by
refine'
Nat.eq_of_mul_eq_mul_left (by decide)
(Nat.add_left_cancel (Eq.trans _ (Nat.mod_add_div n 2).symm))
| Mathlib.Init.Data.Nat.Bitwise.138_0.OFUBkIQvV236FCW | theorem div2_val (n) : div2 n = n / 2 | Mathlib_Init_Data_Nat_Bitwise |
n : ℕ
⊢ n + n = 0 + n + n | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [Nat.zero_add] | theorem bit0_val (n : Nat) : bit0 n = 2 * n :=
calc
n + n = 0 + n + n := by | Mathlib.Init.Data.Nat.Bitwise.151_0.OFUBkIQvV236FCW | theorem bit0_val (n : Nat) : bit0 n = 2 * n | Mathlib_Init_Data_Nat_Bitwise |
b : Bool
n : ℕ
⊢ bit b n = 2 * n + bif b then 1 else 0 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | cases b | theorem bit_val (b n) : bit b n = 2 * n + cond b 1 0 := by
| Mathlib.Init.Data.Nat.Bitwise.162_0.OFUBkIQvV236FCW | theorem bit_val (b n) : bit b n = 2 * n + cond b 1 0 | Mathlib_Init_Data_Nat_Bitwise |
case false
n : ℕ
⊢ bit false n = 2 * n + bif false then 1 else 0
case true n : ℕ ⊢ bit true n = 2 * n + bif true then 1 else 0 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | apply bit0_val | theorem bit_val (b n) : bit b n = 2 * n + cond b 1 0 := by
cases b
| Mathlib.Init.Data.Nat.Bitwise.162_0.OFUBkIQvV236FCW | theorem bit_val (b n) : bit b n = 2 * n + cond b 1 0 | Mathlib_Init_Data_Nat_Bitwise |
case true
n : ℕ
⊢ bit true n = 2 * n + bif true then 1 else 0 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | apply bit1_val | theorem bit_val (b n) : bit b n = 2 * n + cond b 1 0 := by
cases b
apply bit0_val
| Mathlib.Init.Data.Nat.Bitwise.162_0.OFUBkIQvV236FCW | theorem bit_val (b n) : bit b n = 2 * n + cond b 1 0 | Mathlib_Init_Data_Nat_Bitwise |
m n : ℕ
⊢ shiftLeft' false m (n + 1) = m <<< (n + 1) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | have : 2 * (m * 2^n) = 2^(n+1)*m := by
rw [Nat.mul_comm, Nat.mul_assoc, ← pow_succ]; simp | @[simp]
theorem shiftLeft'_false : ∀ n, shiftLeft' false m n = m <<< n
| 0 => rfl
| n + 1 => by
| Mathlib.Init.Data.Nat.Bitwise.190_0.OFUBkIQvV236FCW | @[simp]
theorem shiftLeft'_false : ∀ n, shiftLeft' false m n = m <<< n
| 0 => rfl
| n + 1 => by
have : 2 * (m * 2^n) = 2^(n+1)*m | Mathlib_Init_Data_Nat_Bitwise |
m n : ℕ
⊢ 2 * (m * 2 ^ n) = 2 ^ (n + 1) * m | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [Nat.mul_comm, Nat.mul_assoc, ← pow_succ] | @[simp]
theorem shiftLeft'_false : ∀ n, shiftLeft' false m n = m <<< n
| 0 => rfl
| n + 1 => by
have : 2 * (m * 2^n) = 2^(n+1)*m := by
| Mathlib.Init.Data.Nat.Bitwise.190_0.OFUBkIQvV236FCW | @[simp]
theorem shiftLeft'_false : ∀ n, shiftLeft' false m n = m <<< n
| 0 => rfl
| n + 1 => by
have : 2 * (m * 2^n) = 2^(n+1)*m | Mathlib_Init_Data_Nat_Bitwise |
m n : ℕ
⊢ m * 2 ^ succ n = 2 ^ (n + 1) * m | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp | @[simp]
theorem shiftLeft'_false : ∀ n, shiftLeft' false m n = m <<< n
| 0 => rfl
| n + 1 => by
have : 2 * (m * 2^n) = 2^(n+1)*m := by
rw [Nat.mul_comm, Nat.mul_assoc, ← pow_succ]; | Mathlib.Init.Data.Nat.Bitwise.190_0.OFUBkIQvV236FCW | @[simp]
theorem shiftLeft'_false : ∀ n, shiftLeft' false m n = m <<< n
| 0 => rfl
| n + 1 => by
have : 2 * (m * 2^n) = 2^(n+1)*m | Mathlib_Init_Data_Nat_Bitwise |
m n : ℕ
this : 2 * (m * 2 ^ n) = 2 ^ (n + 1) * m
⊢ shiftLeft' false m (n + 1) = m <<< (n + 1) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp [shiftLeft_eq, shiftLeft', bit_val, shiftLeft'_false, this] | @[simp]
theorem shiftLeft'_false : ∀ n, shiftLeft' false m n = m <<< n
| 0 => rfl
| n + 1 => by
have : 2 * (m * 2^n) = 2^(n+1)*m := by
rw [Nat.mul_comm, Nat.mul_assoc, ← pow_succ]; simp
| Mathlib.Init.Data.Nat.Bitwise.190_0.OFUBkIQvV236FCW | @[simp]
theorem shiftLeft'_false : ∀ n, shiftLeft' false m n = m <<< n
| 0 => rfl
| n + 1 => by
have : 2 * (m * 2^n) = 2^(n+1)*m | Mathlib_Init_Data_Nat_Bitwise |
n : ℕ
h : n ≠ 0
⊢ div2 n < n | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [div2_val] | lemma binaryRec_decreasing (h : n ≠ 0) : div2 n < n := by
| Mathlib.Init.Data.Nat.Bitwise.207_0.OFUBkIQvV236FCW | lemma binaryRec_decreasing (h : n ≠ 0) : div2 n < n | Mathlib_Init_Data_Nat_Bitwise |
n : ℕ
h : n ≠ 0
⊢ n / 2 < n | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | apply (div_lt_iff_lt_mul <| succ_pos 1).2 | lemma binaryRec_decreasing (h : n ≠ 0) : div2 n < n := by
rw [div2_val]
| Mathlib.Init.Data.Nat.Bitwise.207_0.OFUBkIQvV236FCW | lemma binaryRec_decreasing (h : n ≠ 0) : div2 n < n | Mathlib_Init_Data_Nat_Bitwise |
n : ℕ
h : n ≠ 0
⊢ n < n * succ 1 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | have := Nat.mul_lt_mul_of_pos_left (lt_succ_self 1)
(lt_of_le_of_ne n.zero_le h.symm) | lemma binaryRec_decreasing (h : n ≠ 0) : div2 n < n := by
rw [div2_val]
apply (div_lt_iff_lt_mul <| succ_pos 1).2
| Mathlib.Init.Data.Nat.Bitwise.207_0.OFUBkIQvV236FCW | lemma binaryRec_decreasing (h : n ≠ 0) : div2 n < n | Mathlib_Init_Data_Nat_Bitwise |
n : ℕ
h : n ≠ 0
this : n * 1 < n * succ 1
⊢ n < n * succ 1 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rwa [Nat.mul_one] at this | lemma binaryRec_decreasing (h : n ≠ 0) : div2 n < n := by
rw [div2_val]
apply (div_lt_iff_lt_mul <| succ_pos 1).2
have := Nat.mul_lt_mul_of_pos_left (lt_succ_self 1)
(lt_of_le_of_ne n.zero_le h.symm)
| Mathlib.Init.Data.Nat.Bitwise.207_0.OFUBkIQvV236FCW | lemma binaryRec_decreasing (h : n ≠ 0) : div2 n < n | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
n : ℕ
n0 : n = 0
⊢ C n | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp only [n0] | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib.Init.Data.Nat.Bitwise.214_0.OFUBkIQvV236FCW | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
n : ℕ
n0 : n = 0
⊢ C 0 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | exact z | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib.Init.Data.Nat.Bitwise.214_0.OFUBkIQvV236FCW | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
n : ℕ
n0 : ¬n = 0
⊢ C n | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | let n' := div2 n | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib.Init.Data.Nat.Bitwise.214_0.OFUBkIQvV236FCW | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
n : ℕ
n0 : ¬n = 0
n' : ℕ := div2 n
⊢ C n | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | have _x : bit (bodd n) n' = n := by
apply bit_decomp n | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib.Init.Data.Nat.Bitwise.214_0.OFUBkIQvV236FCW | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
n : ℕ
n0 : ¬n = 0
n' : ℕ := div2 n
⊢ bit (bodd n) n' = n | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | apply bit_decomp n | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib.Init.Data.Nat.Bitwise.214_0.OFUBkIQvV236FCW | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
n : ℕ
n0 : ¬n = 0
n' : ℕ := div2 n
_x : bit (bodd n) n' = n
⊢ C n | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [← _x] | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib.Init.Data.Nat.Bitwise.214_0.OFUBkIQvV236FCW | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
n : ℕ
n0 : ¬n = 0
n' : ℕ := div2 n
_x : bit (bodd n) n' = n
⊢ C (bit (bodd n) n') | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | exact f (bodd n) n' (binaryRec z f n') | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib.Init.Data.Nat.Bitwise.214_0.OFUBkIQvV236FCW | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib_Init_Data_Nat_Bitwise |
n : ℕ
n0 : ¬n = 0
n' : ℕ := div2 n
_x : bit (bodd n) n' = n
⊢ (invImage (fun a => sizeOf a) instWellFoundedRelation).1 n' n | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | exact binaryRec_decreasing n0 | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib.Init.Data.Nat.Bitwise.214_0.OFUBkIQvV236FCW | /-- A recursion principle for `bit` representations of natural numbers.
For a predicate `C : Nat → Sort*`, if instances can be
constructed for natural numbers of the form `bit b n`,
they can be constructed for all natural numbers. -/
def binaryRec {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) : ∀ n,... | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
⊢ binaryRec z f 0 = z | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [binaryRec] | @[simp]
theorem binaryRec_zero {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) :
binaryRec z f 0 = z := by
| Mathlib.Init.Data.Nat.Bitwise.257_0.OFUBkIQvV236FCW | @[simp]
theorem binaryRec_zero {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) :
binaryRec z f 0 = z | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
⊢ (if n0 : 0 = 0 then Eq.mpr (_ : C 0 = C 0) z
else
let n' := div2 0;
let_fun _x := (_ : bit (bodd 0) (div2 0) = 0);
Eq.mpr (_ : C 0 = C (bit (bodd 0) n')) (f (bodd 0) n' (binaryRec z f n'))) =
z | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rfl | @[simp]
theorem binaryRec_zero {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) :
binaryRec z f 0 = z := by
rw [binaryRec]
| Mathlib.Init.Data.Nat.Bitwise.257_0.OFUBkIQvV236FCW | @[simp]
theorem binaryRec_zero {C : Nat → Sort u} (z : C 0) (f : ∀ b n, C n → C (bit b n)) :
binaryRec z f 0 = z | Mathlib_Init_Data_Nat_Bitwise |
b : Bool
n : ℕ
⊢ bodd (bit b n) = b | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [bit_val] | theorem bodd_bit (b n) : bodd (bit b n) = b := by
| Mathlib.Init.Data.Nat.Bitwise.266_0.OFUBkIQvV236FCW | theorem bodd_bit (b n) : bodd (bit b n) = b | Mathlib_Init_Data_Nat_Bitwise |
b : Bool
n : ℕ
⊢ bodd (2 * n + bif b then 1 else 0) = b | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp only [Nat.mul_comm, Nat.add_comm, bodd_add, bodd_mul, bodd_succ, bodd_zero, Bool.not_false,
Bool.not_true, Bool.and_false, Bool.xor_false] | theorem bodd_bit (b n) : bodd (bit b n) = b := by
rw [bit_val]
| Mathlib.Init.Data.Nat.Bitwise.266_0.OFUBkIQvV236FCW | theorem bodd_bit (b n) : bodd (bit b n) = b | Mathlib_Init_Data_Nat_Bitwise |
b : Bool
n : ℕ
⊢ bodd (bif b then 1 else 0) = b | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | cases b | theorem bodd_bit (b n) : bodd (bit b n) = b := by
rw [bit_val]
simp only [Nat.mul_comm, Nat.add_comm, bodd_add, bodd_mul, bodd_succ, bodd_zero, Bool.not_false,
Bool.not_true, Bool.and_false, Bool.xor_false]
| Mathlib.Init.Data.Nat.Bitwise.266_0.OFUBkIQvV236FCW | theorem bodd_bit (b n) : bodd (bit b n) = b | Mathlib_Init_Data_Nat_Bitwise |
case false
n : ℕ
⊢ bodd (bif false then 1 else 0) = false | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | cases bodd n | theorem bodd_bit (b n) : bodd (bit b n) = b := by
rw [bit_val]
simp only [Nat.mul_comm, Nat.add_comm, bodd_add, bodd_mul, bodd_succ, bodd_zero, Bool.not_false,
Bool.not_true, Bool.and_false, Bool.xor_false]
cases b <;> | Mathlib.Init.Data.Nat.Bitwise.266_0.OFUBkIQvV236FCW | theorem bodd_bit (b n) : bodd (bit b n) = b | Mathlib_Init_Data_Nat_Bitwise |
case true
n : ℕ
⊢ bodd (bif true then 1 else 0) = true | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | cases bodd n | theorem bodd_bit (b n) : bodd (bit b n) = b := by
rw [bit_val]
simp only [Nat.mul_comm, Nat.add_comm, bodd_add, bodd_mul, bodd_succ, bodd_zero, Bool.not_false,
Bool.not_true, Bool.and_false, Bool.xor_false]
cases b <;> | Mathlib.Init.Data.Nat.Bitwise.266_0.OFUBkIQvV236FCW | theorem bodd_bit (b n) : bodd (bit b n) = b | Mathlib_Init_Data_Nat_Bitwise |
case false.false
n : ℕ
⊢ bodd (bif false then 1 else 0) = false | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rfl | theorem bodd_bit (b n) : bodd (bit b n) = b := by
rw [bit_val]
simp only [Nat.mul_comm, Nat.add_comm, bodd_add, bodd_mul, bodd_succ, bodd_zero, Bool.not_false,
Bool.not_true, Bool.and_false, Bool.xor_false]
cases b <;> cases bodd n <;> | Mathlib.Init.Data.Nat.Bitwise.266_0.OFUBkIQvV236FCW | theorem bodd_bit (b n) : bodd (bit b n) = b | Mathlib_Init_Data_Nat_Bitwise |
case false.true
n : ℕ
⊢ bodd (bif false then 1 else 0) = false | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rfl | theorem bodd_bit (b n) : bodd (bit b n) = b := by
rw [bit_val]
simp only [Nat.mul_comm, Nat.add_comm, bodd_add, bodd_mul, bodd_succ, bodd_zero, Bool.not_false,
Bool.not_true, Bool.and_false, Bool.xor_false]
cases b <;> cases bodd n <;> | Mathlib.Init.Data.Nat.Bitwise.266_0.OFUBkIQvV236FCW | theorem bodd_bit (b n) : bodd (bit b n) = b | Mathlib_Init_Data_Nat_Bitwise |
case true.false
n : ℕ
⊢ bodd (bif true then 1 else 0) = true | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rfl | theorem bodd_bit (b n) : bodd (bit b n) = b := by
rw [bit_val]
simp only [Nat.mul_comm, Nat.add_comm, bodd_add, bodd_mul, bodd_succ, bodd_zero, Bool.not_false,
Bool.not_true, Bool.and_false, Bool.xor_false]
cases b <;> cases bodd n <;> | Mathlib.Init.Data.Nat.Bitwise.266_0.OFUBkIQvV236FCW | theorem bodd_bit (b n) : bodd (bit b n) = b | Mathlib_Init_Data_Nat_Bitwise |
case true.true
n : ℕ
⊢ bodd (bif true then 1 else 0) = true | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rfl | theorem bodd_bit (b n) : bodd (bit b n) = b := by
rw [bit_val]
simp only [Nat.mul_comm, Nat.add_comm, bodd_add, bodd_mul, bodd_succ, bodd_zero, Bool.not_false,
Bool.not_true, Bool.and_false, Bool.xor_false]
cases b <;> cases bodd n <;> | Mathlib.Init.Data.Nat.Bitwise.266_0.OFUBkIQvV236FCW | theorem bodd_bit (b n) : bodd (bit b n) = b | Mathlib_Init_Data_Nat_Bitwise |
b : Bool
n : ℕ
⊢ div2 (bit b n) = n | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [bit_val, div2_val, Nat.add_comm, add_mul_div_left, div_eq_of_lt, Nat.zero_add] | theorem div2_bit (b n) : div2 (bit b n) = n := by
| Mathlib.Init.Data.Nat.Bitwise.273_0.OFUBkIQvV236FCW | theorem div2_bit (b n) : div2 (bit b n) = n | Mathlib_Init_Data_Nat_Bitwise |
b : Bool
n : ℕ
⊢ (bif b then 1 else 0) < 2 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | cases b | theorem div2_bit (b n) : div2 (bit b n) = n := by
rw [bit_val, div2_val, Nat.add_comm, add_mul_div_left, div_eq_of_lt, Nat.zero_add]
<;> | Mathlib.Init.Data.Nat.Bitwise.273_0.OFUBkIQvV236FCW | theorem div2_bit (b n) : div2 (bit b n) = n | Mathlib_Init_Data_Nat_Bitwise |
case H
b : Bool
n : ℕ
⊢ 0 < 2 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | cases b | theorem div2_bit (b n) : div2 (bit b n) = n := by
rw [bit_val, div2_val, Nat.add_comm, add_mul_div_left, div_eq_of_lt, Nat.zero_add]
<;> | Mathlib.Init.Data.Nat.Bitwise.273_0.OFUBkIQvV236FCW | theorem div2_bit (b n) : div2 (bit b n) = n | Mathlib_Init_Data_Nat_Bitwise |
case false
n : ℕ
⊢ (bif false then 1 else 0) < 2 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | exact by decide | theorem div2_bit (b n) : div2 (bit b n) = n := by
rw [bit_val, div2_val, Nat.add_comm, add_mul_div_left, div_eq_of_lt, Nat.zero_add]
<;> cases b
<;> | Mathlib.Init.Data.Nat.Bitwise.273_0.OFUBkIQvV236FCW | theorem div2_bit (b n) : div2 (bit b n) = n | Mathlib_Init_Data_Nat_Bitwise |
n : ℕ
⊢ (bif false then 1 else 0) < 2 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | decide | theorem div2_bit (b n) : div2 (bit b n) = n := by
rw [bit_val, div2_val, Nat.add_comm, add_mul_div_left, div_eq_of_lt, Nat.zero_add]
<;> cases b
<;> exact by | Mathlib.Init.Data.Nat.Bitwise.273_0.OFUBkIQvV236FCW | theorem div2_bit (b n) : div2 (bit b n) = n | Mathlib_Init_Data_Nat_Bitwise |
case true
n : ℕ
⊢ (bif true then 1 else 0) < 2 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | exact by decide | theorem div2_bit (b n) : div2 (bit b n) = n := by
rw [bit_val, div2_val, Nat.add_comm, add_mul_div_left, div_eq_of_lt, Nat.zero_add]
<;> cases b
<;> | Mathlib.Init.Data.Nat.Bitwise.273_0.OFUBkIQvV236FCW | theorem div2_bit (b n) : div2 (bit b n) = n | Mathlib_Init_Data_Nat_Bitwise |
n : ℕ
⊢ (bif true then 1 else 0) < 2 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | decide | theorem div2_bit (b n) : div2 (bit b n) = n := by
rw [bit_val, div2_val, Nat.add_comm, add_mul_div_left, div_eq_of_lt, Nat.zero_add]
<;> cases b
<;> exact by | Mathlib.Init.Data.Nat.Bitwise.273_0.OFUBkIQvV236FCW | theorem div2_bit (b n) : div2 (bit b n) = n | Mathlib_Init_Data_Nat_Bitwise |
case H.false
n : ℕ
⊢ 0 < 2 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | exact by decide | theorem div2_bit (b n) : div2 (bit b n) = n := by
rw [bit_val, div2_val, Nat.add_comm, add_mul_div_left, div_eq_of_lt, Nat.zero_add]
<;> cases b
<;> | Mathlib.Init.Data.Nat.Bitwise.273_0.OFUBkIQvV236FCW | theorem div2_bit (b n) : div2 (bit b n) = n | Mathlib_Init_Data_Nat_Bitwise |
n : ℕ
⊢ 0 < 2 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | decide | theorem div2_bit (b n) : div2 (bit b n) = n := by
rw [bit_val, div2_val, Nat.add_comm, add_mul_div_left, div_eq_of_lt, Nat.zero_add]
<;> cases b
<;> exact by | Mathlib.Init.Data.Nat.Bitwise.273_0.OFUBkIQvV236FCW | theorem div2_bit (b n) : div2 (bit b n) = n | Mathlib_Init_Data_Nat_Bitwise |
case H.true
n : ℕ
⊢ 0 < 2 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | exact by decide | theorem div2_bit (b n) : div2 (bit b n) = n := by
rw [bit_val, div2_val, Nat.add_comm, add_mul_div_left, div_eq_of_lt, Nat.zero_add]
<;> cases b
<;> | Mathlib.Init.Data.Nat.Bitwise.273_0.OFUBkIQvV236FCW | theorem div2_bit (b n) : div2 (bit b n) = n | Mathlib_Init_Data_Nat_Bitwise |
n : ℕ
⊢ 0 < 2 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | decide | theorem div2_bit (b n) : div2 (bit b n) = n := by
rw [bit_val, div2_val, Nat.add_comm, add_mul_div_left, div_eq_of_lt, Nat.zero_add]
<;> cases b
<;> exact by | Mathlib.Init.Data.Nat.Bitwise.273_0.OFUBkIQvV236FCW | theorem div2_bit (b n) : div2 (bit b n) = n | Mathlib_Init_Data_Nat_Bitwise |
m n : ℕ
⊢ ∀ (k : ℕ), m <<< (n + k) = m <<< n <<< k | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | intro k | theorem shiftLeft_add (m n : Nat) : ∀ k, m <<< (n + k) = (m <<< n) <<< k := by
| Mathlib.Init.Data.Nat.Bitwise.284_0.OFUBkIQvV236FCW | theorem shiftLeft_add (m n : Nat) : ∀ k, m <<< (n + k) = (m <<< n) <<< k | Mathlib_Init_Data_Nat_Bitwise |
m n k : ℕ
⊢ m <<< (n + k) = m <<< n <<< k | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp only [← shiftLeft'_false, shiftLeft'_add] | theorem shiftLeft_add (m n : Nat) : ∀ k, m <<< (n + k) = (m <<< n) <<< k := by
intro k; | Mathlib.Init.Data.Nat.Bitwise.284_0.OFUBkIQvV236FCW | theorem shiftLeft_add (m n : Nat) : ∀ k, m <<< (n + k) = (m <<< n) <<< k | Mathlib_Init_Data_Nat_Bitwise |
b : Bool
m n k : ℕ
h : k + 1 ≤ n + 1
⊢ shiftLeft' b m (n + 1 - (k + 1)) = shiftLeft' b m (n + 1) >>> (k + 1) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [succ_sub_succ_eq_sub, shiftLeft', Nat.add_comm, shiftRight_add] | theorem shiftLeft'_sub (b m) : ∀ {n k}, k ≤ n → shiftLeft' b m (n - k) = (shiftLeft' b m n) >>> k
| n, 0, _ => rfl
| n + 1, k + 1, h => by
| Mathlib.Init.Data.Nat.Bitwise.287_0.OFUBkIQvV236FCW | theorem shiftLeft'_sub (b m) : ∀ {n k}, k ≤ n → shiftLeft' b m (n - k) = (shiftLeft' b m n) >>> k
| n, 0, _ => rfl
| n + 1, k + 1, h => by
rw [succ_sub_succ_eq_sub, shiftLeft', Nat.add_comm, shiftRight_add]
simp only [shiftLeft'_sub, Nat.le_of_succ_le_succ h, shiftRight_succ, shiftRight_zero]
simp [← di... | Mathlib_Init_Data_Nat_Bitwise |
b : Bool
m n k : ℕ
h : k + 1 ≤ n + 1
⊢ shiftLeft' b m (n - k) = bit b (shiftLeft' b m n) >>> 1 >>> k | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp only [shiftLeft'_sub, Nat.le_of_succ_le_succ h, shiftRight_succ, shiftRight_zero] | theorem shiftLeft'_sub (b m) : ∀ {n k}, k ≤ n → shiftLeft' b m (n - k) = (shiftLeft' b m n) >>> k
| n, 0, _ => rfl
| n + 1, k + 1, h => by
rw [succ_sub_succ_eq_sub, shiftLeft', Nat.add_comm, shiftRight_add]
| Mathlib.Init.Data.Nat.Bitwise.287_0.OFUBkIQvV236FCW | theorem shiftLeft'_sub (b m) : ∀ {n k}, k ≤ n → shiftLeft' b m (n - k) = (shiftLeft' b m n) >>> k
| n, 0, _ => rfl
| n + 1, k + 1, h => by
rw [succ_sub_succ_eq_sub, shiftLeft', Nat.add_comm, shiftRight_add]
simp only [shiftLeft'_sub, Nat.le_of_succ_le_succ h, shiftRight_succ, shiftRight_zero]
simp [← di... | Mathlib_Init_Data_Nat_Bitwise |
b : Bool
m n k : ℕ
h : k + 1 ≤ n + 1
⊢ shiftLeft' b m n >>> k = (bit b (shiftLeft' b m n) / 2) >>> k | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp [← div2_val, div2_bit] | theorem shiftLeft'_sub (b m) : ∀ {n k}, k ≤ n → shiftLeft' b m (n - k) = (shiftLeft' b m n) >>> k
| n, 0, _ => rfl
| n + 1, k + 1, h => by
rw [succ_sub_succ_eq_sub, shiftLeft', Nat.add_comm, shiftRight_add]
simp only [shiftLeft'_sub, Nat.le_of_succ_le_succ h, shiftRight_succ, shiftRight_zero]
| Mathlib.Init.Data.Nat.Bitwise.287_0.OFUBkIQvV236FCW | theorem shiftLeft'_sub (b m) : ∀ {n k}, k ≤ n → shiftLeft' b m (n - k) = (shiftLeft' b m n) >>> k
| n, 0, _ => rfl
| n + 1, k + 1, h => by
rw [succ_sub_succ_eq_sub, shiftLeft', Nat.add_comm, shiftRight_add]
simp only [shiftLeft'_sub, Nat.le_of_succ_le_succ h, shiftRight_succ, shiftRight_zero]
simp [← di... | Mathlib_Init_Data_Nat_Bitwise |
x✝² x✝¹ x✝ : ℕ
hk : x✝ ≤ x✝¹
⊢ x✝² <<< (x✝¹ - x✝) = x✝² <<< x✝¹ >>> x✝ | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp only [← shiftLeft'_false, shiftLeft'_sub false _ hk] | theorem shiftLeft_sub : ∀ (m : Nat) {n k}, k ≤ n → m <<< (n - k) = (m <<< n) >>> k :=
fun _ _ _ hk => by | Mathlib.Init.Data.Nat.Bitwise.295_0.OFUBkIQvV236FCW | theorem shiftLeft_sub : ∀ (m : Nat) {n k}, k ≤ n → m <<< (n - k) = (m <<< n) >>> k | Mathlib_Init_Data_Nat_Bitwise |
b : Bool
n : ℕ
⊢ testBit (bit b n) 0 = b | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [testBit, bit] | @[simp]
theorem testBit_zero (b n) : testBit (bit b n) 0 = b := by
| Mathlib.Init.Data.Nat.Bitwise.298_0.OFUBkIQvV236FCW | @[simp]
theorem testBit_zero (b n) : testBit (bit b n) 0 = b | Mathlib_Init_Data_Nat_Bitwise |
b : Bool
n : ℕ
⊢ (cond b bit1 bit0 n >>> 0 &&& 1 != 0) = b | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | cases b | @[simp]
theorem testBit_zero (b n) : testBit (bit b n) 0 = b := by
rw [testBit, bit]
| Mathlib.Init.Data.Nat.Bitwise.298_0.OFUBkIQvV236FCW | @[simp]
theorem testBit_zero (b n) : testBit (bit b n) 0 = b | Mathlib_Init_Data_Nat_Bitwise |
case false
n : ℕ
⊢ (cond false bit1 bit0 n >>> 0 &&& 1 != 0) = false | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp [bit0, ← Nat.mul_two] | @[simp]
theorem testBit_zero (b n) : testBit (bit b n) 0 = b := by
rw [testBit, bit]
cases b
· | Mathlib.Init.Data.Nat.Bitwise.298_0.OFUBkIQvV236FCW | @[simp]
theorem testBit_zero (b n) : testBit (bit b n) 0 = b | Mathlib_Init_Data_Nat_Bitwise |
case true
n : ℕ
⊢ (cond true bit1 bit0 n >>> 0 &&& 1 != 0) = true | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp only [cond_true, bit1, bit0, shiftRight_zero, and_one_is_mod, bne_iff_ne] | @[simp]
theorem testBit_zero (b n) : testBit (bit b n) 0 = b := by
rw [testBit, bit]
cases b
· simp [bit0, ← Nat.mul_two]
· | Mathlib.Init.Data.Nat.Bitwise.298_0.OFUBkIQvV236FCW | @[simp]
theorem testBit_zero (b n) : testBit (bit b n) 0 = b | Mathlib_Init_Data_Nat_Bitwise |
case true
n : ℕ
⊢ (n + n + 1) % 2 ≠ 0 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp only [← Nat.mul_two] | @[simp]
theorem testBit_zero (b n) : testBit (bit b n) 0 = b := by
rw [testBit, bit]
cases b
· simp [bit0, ← Nat.mul_two]
· simp only [cond_true, bit1, bit0, shiftRight_zero, and_one_is_mod, bne_iff_ne]
| Mathlib.Init.Data.Nat.Bitwise.298_0.OFUBkIQvV236FCW | @[simp]
theorem testBit_zero (b n) : testBit (bit b n) 0 = b | Mathlib_Init_Data_Nat_Bitwise |
case true
n : ℕ
⊢ (n * 2 + 1) % 2 ≠ 0 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [Nat.add_mod] | @[simp]
theorem testBit_zero (b n) : testBit (bit b n) 0 = b := by
rw [testBit, bit]
cases b
· simp [bit0, ← Nat.mul_two]
· simp only [cond_true, bit1, bit0, shiftRight_zero, and_one_is_mod, bne_iff_ne]
simp only [← Nat.mul_two]
| Mathlib.Init.Data.Nat.Bitwise.298_0.OFUBkIQvV236FCW | @[simp]
theorem testBit_zero (b n) : testBit (bit b n) 0 = b | Mathlib_Init_Data_Nat_Bitwise |
case true
n : ℕ
⊢ (n * 2 % 2 + 1 % 2) % 2 ≠ 0 | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp | @[simp]
theorem testBit_zero (b n) : testBit (bit b n) 0 = b := by
rw [testBit, bit]
cases b
· simp [bit0, ← Nat.mul_two]
· simp only [cond_true, bit1, bit0, shiftRight_zero, and_one_is_mod, bne_iff_ne]
simp only [← Nat.mul_two]
rw [Nat.add_mod]
| Mathlib.Init.Data.Nat.Bitwise.298_0.OFUBkIQvV236FCW | @[simp]
theorem testBit_zero (b n) : testBit (bit b n) 0 = b | Mathlib_Init_Data_Nat_Bitwise |
n : ℕ
⊢ bodd (n + 2) = (n + 2 &&& 1 != 0) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simpa using bodd_eq_and_one_ne_zero n | theorem bodd_eq_and_one_ne_zero : ∀ n, bodd n = (n &&& 1 != 0)
| 0 => rfl
| 1 => rfl
| n + 2 => by | Mathlib.Init.Data.Nat.Bitwise.310_0.OFUBkIQvV236FCW | theorem bodd_eq_and_one_ne_zero : ∀ n, bodd n = (n &&& 1 != 0)
| 0 => rfl
| 1 => rfl
| n + 2 => by simpa using bodd_eq_and_one_ne_zero n | Mathlib_Init_Data_Nat_Bitwise |
m : ℕ
b : Bool
n : ℕ
⊢ testBit (bit b n) (succ m) = testBit n m | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | have : bodd (((bit b n) >>> 1) >>> m) = bodd (n >>> m) := by
simp only [shiftRight_eq_div_pow]
simp [← div2_val, div2_bit] | theorem testBit_succ (m b n) : testBit (bit b n) (succ m) = testBit n m := by
| Mathlib.Init.Data.Nat.Bitwise.315_0.OFUBkIQvV236FCW | theorem testBit_succ (m b n) : testBit (bit b n) (succ m) = testBit n m | Mathlib_Init_Data_Nat_Bitwise |
m : ℕ
b : Bool
n : ℕ
⊢ bodd (bit b n >>> 1 >>> m) = bodd (n >>> m) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp only [shiftRight_eq_div_pow] | theorem testBit_succ (m b n) : testBit (bit b n) (succ m) = testBit n m := by
have : bodd (((bit b n) >>> 1) >>> m) = bodd (n >>> m) := by
| Mathlib.Init.Data.Nat.Bitwise.315_0.OFUBkIQvV236FCW | theorem testBit_succ (m b n) : testBit (bit b n) (succ m) = testBit n m | Mathlib_Init_Data_Nat_Bitwise |
m : ℕ
b : Bool
n : ℕ
⊢ bodd (bit b n / 2 ^ 1 / 2 ^ m) = bodd (n / 2 ^ m) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp [← div2_val, div2_bit] | theorem testBit_succ (m b n) : testBit (bit b n) (succ m) = testBit n m := by
have : bodd (((bit b n) >>> 1) >>> m) = bodd (n >>> m) := by
simp only [shiftRight_eq_div_pow]
| Mathlib.Init.Data.Nat.Bitwise.315_0.OFUBkIQvV236FCW | theorem testBit_succ (m b n) : testBit (bit b n) (succ m) = testBit n m | Mathlib_Init_Data_Nat_Bitwise |
m : ℕ
b : Bool
n : ℕ
this : bodd (bit b n >>> 1 >>> m) = bodd (n >>> m)
⊢ testBit (bit b n) (succ m) = testBit n m | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [← shiftRight_add, Nat.add_comm] at this | theorem testBit_succ (m b n) : testBit (bit b n) (succ m) = testBit n m := by
have : bodd (((bit b n) >>> 1) >>> m) = bodd (n >>> m) := by
simp only [shiftRight_eq_div_pow]
simp [← div2_val, div2_bit]
| Mathlib.Init.Data.Nat.Bitwise.315_0.OFUBkIQvV236FCW | theorem testBit_succ (m b n) : testBit (bit b n) (succ m) = testBit n m | Mathlib_Init_Data_Nat_Bitwise |
m : ℕ
b : Bool
n : ℕ
this : bodd (bit b n >>> (m + 1)) = bodd (n >>> m)
⊢ testBit (bit b n) (succ m) = testBit n m | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp only [bodd_eq_and_one_ne_zero] at this | theorem testBit_succ (m b n) : testBit (bit b n) (succ m) = testBit n m := by
have : bodd (((bit b n) >>> 1) >>> m) = bodd (n >>> m) := by
simp only [shiftRight_eq_div_pow]
simp [← div2_val, div2_bit]
rw [← shiftRight_add, Nat.add_comm] at this
| Mathlib.Init.Data.Nat.Bitwise.315_0.OFUBkIQvV236FCW | theorem testBit_succ (m b n) : testBit (bit b n) (succ m) = testBit n m | Mathlib_Init_Data_Nat_Bitwise |
m : ℕ
b : Bool
n : ℕ
this : (bit b n >>> (m + 1) &&& 1 != 0) = (n >>> m &&& 1 != 0)
⊢ testBit (bit b n) (succ m) = testBit n m | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | exact this | theorem testBit_succ (m b n) : testBit (bit b n) (succ m) = testBit n m := by
have : bodd (((bit b n) >>> 1) >>> m) = bodd (n >>> m) := by
simp only [shiftRight_eq_div_pow]
simp [← div2_val, div2_bit]
rw [← shiftRight_add, Nat.add_comm] at this
simp only [bodd_eq_and_one_ne_zero] at this
| Mathlib.Init.Data.Nat.Bitwise.315_0.OFUBkIQvV236FCW | theorem testBit_succ (m b n) : testBit (bit b n) (succ m) = testBit n m | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h : f false 0 z = z
b : Bool
n : ℕ
⊢ binaryRec z f (bit b n) = f b n (binaryRec z f n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [binaryRec] | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
| Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h : f false 0 z = z
b : Bool
n : ℕ
⊢ (if n0 : bit b n = 0 then Eq.mpr (_ : C (bit b n) = C 0) z
else
let n' := div2 (bit b n);
let_fun _x := (_ : bit (bodd (bit b n)) (div2 (bit b n)) = bit b n);
Eq.mpr (_ : C (bit b n) = C (bit (... | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | by_cases h : bit b n = 0 | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
| Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
case pos
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h✝ : f false 0 z = z
b : Bool
n : ℕ
h : bit b n = 0
⊢ (if n0 : bit b n = 0 then Eq.mpr (_ : C (bit b n) = C 0) z
else
let n' := div2 (bit b n);
let_fun _x := (_ : bit (bodd (bit b n)) (div2 (bit b n)) = bit b n);
Eq.mpr (... | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | case pos h' =>
simp only [dif_pos h]
generalize binaryRec z f (bit b n) = e
revert e
have bf := bodd_bit b n
have n0 := div2_bit b n
rw [h] at bf n0
simp only [bodd_zero, div2_zero] at bf n0
subst bf n0
rw [binaryRec_zero]
intros
rw [h']
rfl | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
| Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : bit b n = 0
⊢ (if n0 : bit b n = 0 then Eq.mpr (_ : C (bit b n) = C 0) z
else
let n' := div2 (bit b n);
let_fun _x := (_ : bit (bodd (bit b n)) (div2 (bit b n)) = bit b n);
Eq.mpr (_ : C (bi... | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | case pos h' =>
simp only [dif_pos h]
generalize binaryRec z f (bit b n) = e
revert e
have bf := bodd_bit b n
have n0 := div2_bit b n
rw [h] at bf n0
simp only [bodd_zero, div2_zero] at bf n0
subst bf n0
rw [binaryRec_zero]
intros
rw [h']
rfl | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
| Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : bit b n = 0
⊢ (if n0 : bit b n = 0 then Eq.mpr (_ : C (bit b n) = C 0) z
else
let n' := div2 (bit b n);
let_fun _x := (_ : bit (bodd (bit b n)) (div2 (bit b n)) = bit b n);
Eq.mpr (_ : C (bi... | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp only [dif_pos h] | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : bit b n = 0
⊢ Eq.mpr (_ : C (bit b n) = C 0) z = f b n (binaryRec z f n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | generalize binaryRec z f (bit b n) = e | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : bit b n = 0
e : C (bit b n)
⊢ Eq.mpr (_ : C (bit b n) = C 0) z = f b n (binaryRec z f n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | revert e | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : bit b n = 0
⊢ C (bit b n) → Eq.mpr (_ : C (bit b n) = C 0) z = f b n (binaryRec z f n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | have bf := bodd_bit b n | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : bit b n = 0
bf : bodd (bit b n) = b
⊢ C (bit b n) → Eq.mpr (_ : C (bit b n) = C 0) z = f b n (binaryRec z f n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | have n0 := div2_bit b n | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : bit b n = 0
bf : bodd (bit b n) = b
n0 : div2 (bit b n) = n
⊢ C (bit b n) → Eq.mpr (_ : C (bit b n) = C 0) z = f b n (binaryRec z f n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [h] at bf n0 | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : bit b n = 0
bf : bodd 0 = b
n0 : div2 0 = n
⊢ C (bit b n) → Eq.mpr (_ : C (bit b n) = C 0) z = f b n (binaryRec z f n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp only [bodd_zero, div2_zero] at bf n0 | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : bit b n = 0
bf : false = b
n0 : 0 = n
⊢ C (bit b n) → Eq.mpr (_ : C (bit b n) = C 0) z = f b n (binaryRec z f n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | subst bf n0 | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
h : bit false 0 = 0
⊢ C (bit false 0) → Eq.mpr (_ : C (bit false 0) = C 0) z = f false 0 (binaryRec z f 0) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [binaryRec_zero] | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
h : bit false 0 = 0
⊢ C (bit false 0) → Eq.mpr (_ : C (bit false 0) = C 0) z = f false 0 z | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | intros | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
h : bit false 0 = 0
e✝ : C (bit false 0)
⊢ Eq.mpr (_ : C (bit false 0) = C 0) z = f false 0 z | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [h'] | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
h : bit false 0 = 0
e✝ : C (bit false 0)
⊢ Eq.mpr (_ : C (bit false 0) = C 0) z = z | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rfl | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
case neg
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h✝ : f false 0 z = z
b : Bool
n : ℕ
h : ¬bit b n = 0
⊢ (if n0 : bit b n = 0 then Eq.mpr (_ : C (bit b n) = C 0) z
else
let n' := div2 (bit b n);
let_fun _x := (_ : bit (bodd (bit b n)) (div2 (bit b n)) = bit b n);
Eq.mpr ... | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | case neg h' =>
simp only [dif_neg h]
generalize @id (C (bit b n) = C (bit (bodd (bit b n)) (div2 (bit b n))))
(Eq.symm (bit_decomp (bit b n)) ▸ Eq.refl (C (bit b n))) = e
revert e
rw [bodd_bit, div2_bit]
intros; rfl | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : ¬bit b n = 0
⊢ (if n0 : bit b n = 0 then Eq.mpr (_ : C (bit b n) = C 0) z
else
let n' := div2 (bit b n);
let_fun _x := (_ : bit (bodd (bit b n)) (div2 (bit b n)) = bit b n);
Eq.mpr (_ : C (b... | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | case neg h' =>
simp only [dif_neg h]
generalize @id (C (bit b n) = C (bit (bodd (bit b n)) (div2 (bit b n))))
(Eq.symm (bit_decomp (bit b n)) ▸ Eq.refl (C (bit b n))) = e
revert e
rw [bodd_bit, div2_bit]
intros; rfl | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : ¬bit b n = 0
⊢ (if n0 : bit b n = 0 then Eq.mpr (_ : C (bit b n) = C 0) z
else
let n' := div2 (bit b n);
let_fun _x := (_ : bit (bodd (bit b n)) (div2 (bit b n)) = bit b n);
Eq.mpr (_ : C (b... | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | simp only [dif_neg h] | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : ¬bit b n = 0
⊢ Eq.mpr (_ : C (bit b n) = C (bit (bodd (bit b n)) (div2 (bit b n))))
(f (bodd (bit b n)) (div2 (bit b n)) (binaryRec z f (div2 (bit b n)))) =
f b n (binaryRec z f n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | generalize @id (C (bit b n) = C (bit (bodd (bit b n)) (div2 (bit b n))))
(Eq.symm (bit_decomp (bit b n)) ▸ Eq.refl (C (bit b n))) = e | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : ¬bit b n = 0
e : C (bit b n) = C (bit (bodd (bit b n)) (div2 (bit b n)))
⊢ Eq.mpr e (f (bodd (bit b n)) (div2 (bit b n)) (binaryRec z f (div2 (bit b n)))) = f b n (binaryRec z f n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | revert e | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : ¬bit b n = 0
⊢ ∀ (e : C (bit b n) = C (bit (bodd (bit b n)) (div2 (bit b n)))),
Eq.mpr e (f (bodd (bit b n)) (div2 (bit b n)) (binaryRec z f (div2 (bit b n)))) = f b n (binaryRec z f n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rw [bodd_bit, div2_bit] | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : ¬bit b n = 0
⊢ ∀ (e : C (bit b n) = C (bit b n)), Eq.mpr e (f b n (binaryRec z f n)) = f b n (binaryRec z f n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | intros | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
C : ℕ → Sort u
z : C 0
f : (b : Bool) → (n : ℕ) → C n → C (bit b n)
h' : f false 0 z = z
b : Bool
n : ℕ
h : ¬bit b n = 0
e✝ : C (bit b n) = C (bit b n)
⊢ Eq.mpr e✝ (f b n (binaryRec z f n)) = f b n (binaryRec z f n) | /-
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
import Mathlib.Init.Data.Nat.Lemmas
import Init.WFTactics
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Data.Bool.Lemmas
import Mathlib.Init.ZeroOne
impor... | rfl | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) := by
rw [binaryRec]
by_cases h : bit b n = 0
-- Note: this renames the original `h : f false 0 z = z` to `h'` and leaves `h : bit b n = 0`
case po... | Mathlib.Init.Data.Nat.Bitwise.324_0.OFUBkIQvV236FCW | theorem binaryRec_eq {C : Nat → Sort u} {z : C 0} {f : ∀ b n, C n → C (bit b n)}
(h : f false 0 z = z) (b n) : binaryRec z f (bit b n) = f b n (binaryRec z f n) | Mathlib_Init_Data_Nat_Bitwise |
α✝ : Type u
β : Type v
α : Type u_1
inst✝ : Sup α
sup_comm : ∀ (a b : α), a ⊔ b = b ⊔ a
sup_assoc : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c)
sup_idem : ∀ (a : α), a ⊔ a = a
a b c : α
hab : a ≤ b
hbc : b ≤ c
⊢ a ≤ c | /-
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Order.Defs
import Mathlib.Order.Monotone.Basic
import Mathlib.Order.ULift
import Mathlib.Tactic.GCongr.Core
#align... | show a ⊔ c = c | /--
A type with a commutative, associative and idempotent binary `sup` operation has the structure of a
join-semilattice.
The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def SemilatticeSup.mk' {α : Type*} [Sup α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
(sup_assoc : ∀ a b c... | Mathlib.Order.Lattice.80_0.wE3igZl9MFbJBfv | /--
A type with a commutative, associative and idempotent binary `sup` operation has the structure of a
join-semilattice.
The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def SemilatticeSup.mk' {α : Type*} [Sup α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
(sup_assoc : ∀ a b c... | Mathlib_Order_Lattice |
α✝ : Type u
β : Type v
α : Type u_1
inst✝ : Sup α
sup_comm : ∀ (a b : α), a ⊔ b = b ⊔ a
sup_assoc : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c)
sup_idem : ∀ (a : α), a ⊔ a = a
a b c : α
hab : a ≤ b
hbc : b ≤ c
⊢ a ⊔ c = c | /-
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Order.Defs
import Mathlib.Order.Monotone.Basic
import Mathlib.Order.ULift
import Mathlib.Tactic.GCongr.Core
#align... | rw [← hbc, ← sup_assoc, hab] | /--
A type with a commutative, associative and idempotent binary `sup` operation has the structure of a
join-semilattice.
The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def SemilatticeSup.mk' {α : Type*} [Sup α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
(sup_assoc : ∀ a b c... | Mathlib.Order.Lattice.80_0.wE3igZl9MFbJBfv | /--
A type with a commutative, associative and idempotent binary `sup` operation has the structure of a
join-semilattice.
The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def SemilatticeSup.mk' {α : Type*} [Sup α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
(sup_assoc : ∀ a b c... | Mathlib_Order_Lattice |
α✝ : Type u
β : Type v
α : Type u_1
inst✝ : Sup α
sup_comm : ∀ (a b : α), a ⊔ b = b ⊔ a
sup_assoc : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c)
sup_idem : ∀ (a : α), a ⊔ a = a
a b : α
hab : a ≤ b
hba : b ≤ a
⊢ a = b | /-
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Order.Defs
import Mathlib.Order.Monotone.Basic
import Mathlib.Order.ULift
import Mathlib.Tactic.GCongr.Core
#align... | rwa [← hba, sup_comm] | /--
A type with a commutative, associative and idempotent binary `sup` operation has the structure of a
join-semilattice.
The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def SemilatticeSup.mk' {α : Type*} [Sup α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
(sup_assoc : ∀ a b c... | Mathlib.Order.Lattice.80_0.wE3igZl9MFbJBfv | /--
A type with a commutative, associative and idempotent binary `sup` operation has the structure of a
join-semilattice.
The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def SemilatticeSup.mk' {α : Type*} [Sup α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
(sup_assoc : ∀ a b c... | Mathlib_Order_Lattice |
α✝ : Type u
β : Type v
α : Type u_1
inst✝ : Sup α
sup_comm : ∀ (a b : α), a ⊔ b = b ⊔ a
sup_assoc : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c)
sup_idem : ∀ (a : α), a ⊔ a = a
a b : α
⊢ a ⊔ (a ⊔ b) = a ⊔ b | /-
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Order.Defs
import Mathlib.Order.Monotone.Basic
import Mathlib.Order.ULift
import Mathlib.Tactic.GCongr.Core
#align... | rw [← sup_assoc, sup_idem] | /--
A type with a commutative, associative and idempotent binary `sup` operation has the structure of a
join-semilattice.
The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def SemilatticeSup.mk' {α : Type*} [Sup α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
(sup_assoc : ∀ a b c... | Mathlib.Order.Lattice.80_0.wE3igZl9MFbJBfv | /--
A type with a commutative, associative and idempotent binary `sup` operation has the structure of a
join-semilattice.
The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def SemilatticeSup.mk' {α : Type*} [Sup α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
(sup_assoc : ∀ a b c... | Mathlib_Order_Lattice |
α✝ : Type u
β : Type v
α : Type u_1
inst✝ : Sup α
sup_comm : ∀ (a b : α), a ⊔ b = b ⊔ a
sup_assoc : ∀ (a b c : α), a ⊔ b ⊔ c = a ⊔ (b ⊔ c)
sup_idem : ∀ (a : α), a ⊔ a = a
a b : α
⊢ b ⊔ (a ⊔ b) = a ⊔ b | /-
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl
-/
import Mathlib.Data.Bool.Basic
import Mathlib.Init.Order.Defs
import Mathlib.Order.Monotone.Basic
import Mathlib.Order.ULift
import Mathlib.Tactic.GCongr.Core
#align... | rw [sup_comm, sup_assoc, sup_idem] | /--
A type with a commutative, associative and idempotent binary `sup` operation has the structure of a
join-semilattice.
The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def SemilatticeSup.mk' {α : Type*} [Sup α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
(sup_assoc : ∀ a b c... | Mathlib.Order.Lattice.80_0.wE3igZl9MFbJBfv | /--
A type with a commutative, associative and idempotent binary `sup` operation has the structure of a
join-semilattice.
The partial order is defined so that `a ≤ b` unfolds to `a ⊔ b = b`; cf. `sup_eq_right`.
-/
def SemilatticeSup.mk' {α : Type*} [Sup α] (sup_comm : ∀ a b : α, a ⊔ b = b ⊔ a)
(sup_assoc : ∀ a b c... | Mathlib_Order_Lattice |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.