logic.denumerable
⟷
Mathlib.Logic.Denumerable
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -390,7 +390,7 @@ private theorem right_inverse_aux : ∀ n, toFunAux (ofNat s n) = n
| 0 => by
rw [to_fun_aux_eq, card_eq_zero, eq_empty_iff_forall_not_mem]
rintro n hn
- rw [mem_filter, of_nat, mem_range] at hn
+ rw [mem_filter, of_nat, mem_range] at hn
exact bot_le.not_lt (show (⟨n, hn.2⟩ : s) < ⊥ from hn.1)
| n + 1 => by
have ih : toFunAux (ofNat s n) = n := right_inverse_aux n
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,10 +3,10 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
-import Mathbin.Data.Fintype.Lattice
-import Mathbin.Data.List.MinMax
-import Mathbin.Data.Nat.Order.Lemmas
-import Mathbin.Logic.Encodable.Basic
+import Data.Fintype.Lattice
+import Data.List.MinMax
+import Data.Nat.Order.Lemmas
+import Logic.Encodable.Basic
#align_import logic.denumerable from "leanprover-community/mathlib"@"327c3c0d9232d80e250dc8f65e7835b82b266ea5"
mathlib commit https://github.com/leanprover-community/mathlib/commit/32a7e535287f9c73f2e4d2aef306a39190f0b504
@@ -379,10 +379,10 @@ theorem coe_comp_ofNat_range : Set.range (coe ∘ ofNat s : ℕ → ℕ) = s :=
-/
private def to_fun_aux (x : s) : ℕ :=
- (List.range x).countp (· ∈ s)
+ (List.range x).countP (· ∈ s)
private theorem to_fun_aux_eq (x : s) : toFunAux x = ((Finset.range x).filterₓ (· ∈ s)).card := by
- rw [to_fun_aux, List.countp_eq_length_filter] <;> rfl
+ rw [to_fun_aux, List.countP_eq_length_filter] <;> rfl
open Finset
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,17 +2,14 @@
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-
-! This file was ported from Lean 3 source module logic.denumerable
-! leanprover-community/mathlib commit 327c3c0d9232d80e250dc8f65e7835b82b266ea5
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.Fintype.Lattice
import Mathbin.Data.List.MinMax
import Mathbin.Data.Nat.Order.Lemmas
import Mathbin.Logic.Encodable.Basic
+#align_import logic.denumerable from "leanprover-community/mathlib"@"327c3c0d9232d80e250dc8f65e7835b82b266ea5"
+
/-!
# Denumerable types
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -121,11 +121,13 @@ def ofEquiv (α) {β} [Denumerable α] (e : β ≃ α) : Denumerable β :=
#align denumerable.of_equiv Denumerable.ofEquiv
-/
+#print Denumerable.ofEquiv_ofNat /-
@[simp]
theorem ofEquiv_ofNat (α) {β} [Denumerable α] (e : β ≃ α) (n) :
@ofNat β (ofEquiv _ e) n = e.symm (ofNat α n) := by
apply of_nat_of_decode <;> show Option.map _ _ = _ <;> simp
#align denumerable.of_equiv_of_nat Denumerable.ofEquiv_ofNat
+-/
#print Denumerable.equiv₂ /-
/-- All denumerable types are equivalent. -/
@@ -181,11 +183,13 @@ instance sigma : Denumerable (Sigma γ) :=
#align denumerable.sigma Denumerable.sigma
-/
+#print Denumerable.sigma_ofNat_val /-
@[simp]
theorem sigma_ofNat_val (n : ℕ) :
ofNat (Sigma γ) n = ⟨ofNat α (unpair n).1, ofNat (γ _) (unpair n).2⟩ :=
Option.some.inj <| by rw [← decode_eq_of_nat, decode_sigma_val] <;> simp <;> rfl
#align denumerable.sigma_of_nat_val Denumerable.sigma_ofNat_val
+-/
end Sigma
@@ -196,10 +200,12 @@ instance prod : Denumerable (α × β) :=
#align denumerable.prod Denumerable.prod
-/
+#print Denumerable.prod_ofNat_val /-
@[simp]
theorem prod_ofNat_val (n : ℕ) : ofNat (α × β) n = (ofNat α (unpair n).1, ofNat β (unpair n).2) :=
by simp <;> rfl
#align denumerable.prod_of_nat_val Denumerable.prod_ofNat_val
+-/
#print Denumerable.prod_nat_ofNat /-
@[simp]
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -301,7 +301,6 @@ theorem le_succ_of_forall_lt_le {x y : s} (h : ∀ z < x, z ≤ y) : x ≤ succ
calc
↑y ≤ ↑y + Nat.find hx := le_add_of_nonneg_right (Nat.zero_le _)
_ < ↑y + Nat.find hx + 1 := Nat.lt_succ_self _
-
#align nat.subtype.le_succ_of_forall_lt_le Nat.Subtype.le_succ_of_forall_lt_le
-/
@@ -310,7 +309,6 @@ theorem lt_succ_self (x : s) : x < succ x :=
calc
(x : ℕ) ≤ x + _ := le_self_add
_ < succ x := Nat.lt_succ_self (x + _)
-
#align nat.subtype.lt_succ_self Nat.Subtype.lt_succ_self
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -266,7 +266,7 @@ theorem exists_succ (x : s) : ∃ n, ↑x + n + 1 ∈ s :=
⟨(((Multiset.range (succ x)).filterₓ (· ∈ s)).pmap
(fun (y : ℕ) (hy : y ∈ s) => Subtype.mk y hy)
(by simp [-Multiset.range_succ])).toFinset,
- by simpa [Subtype.ext_iff_val, Multiset.mem_filter, -Multiset.range_succ] ⟩
+ by simpa [Subtype.ext_iff_val, Multiset.mem_filter, -Multiset.range_succ]⟩
#align nat.subtype.exists_succ Nat.Subtype.exists_succ
-/
@@ -353,8 +353,8 @@ theorem ofNat_surjective_aux : ∀ {x : ℕ} (hx : x ∈ s), ∃ n, ofNat s n =
rw [of_nat] <;>
exact
le_succ_of_forall_lt_le fun z hz => by
- rw [ha] <;> cases m <;> exact List.le_maximum_of_mem (hmt.2 hz) hmax⟩decreasing_by
- tauto
+ rw [ha] <;> cases m <;> exact List.le_maximum_of_mem (hmt.2 hz) hmax⟩
+decreasing_by tauto
#align nat.subtype.of_nat_surjective_aux Nat.Subtype.ofNat_surjective_aux
-/
@@ -389,7 +389,7 @@ private theorem right_inverse_aux : ∀ n, toFunAux (ofNat s n) = n
| 0 => by
rw [to_fun_aux_eq, card_eq_zero, eq_empty_iff_forall_not_mem]
rintro n hn
- rw [mem_filter, of_nat, mem_range] at hn
+ rw [mem_filter, of_nat, mem_range] at hn
exact bot_le.not_lt (show (⟨n, hn.2⟩ : s) < ⊥ from hn.1)
| n + 1 => by
have ih : toFunAux (ofNat s n) = n := right_inverse_aux n
@@ -406,7 +406,7 @@ private theorem right_inverse_aux : ∀ n, toFunAux (ofNat s n) = n
fun h =>
h.elim (fun h => h.symm ▸ ⟨lt_succ_self _, (of_nat s n).Prop⟩) fun h =>
⟨h.1.trans (lt_succ_self _), h.2⟩⟩
- simp only [to_fun_aux_eq, of_nat, range_succ] at ih⊢
+ simp only [to_fun_aux_eq, of_nat, range_succ] at ih ⊢
conv =>
rhs
rw [← ih, ← card_insert_of_not_mem h₁, ← h₂]
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -255,7 +255,7 @@ variable {s : Set ℕ} [Infinite s]
section Classical
-open Classical
+open scoped Classical
#print Nat.Subtype.exists_succ /-
theorem exists_succ (x : s) : ∃ n, ↑x + n + 1 ∈ s :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -121,12 +121,6 @@ def ofEquiv (α) {β} [Denumerable α] (e : β ≃ α) : Denumerable β :=
#align denumerable.of_equiv Denumerable.ofEquiv
-/
-/- warning: denumerable.of_equiv_of_nat -> Denumerable.ofEquiv_ofNat is a dubious translation:
-lean 3 declaration is
- forall (α : Type.{u1}) {β : Type.{u2}} [_inst_3 : Denumerable.{u1} α] (e : Equiv.{succ u2, succ u1} β α) (n : Nat), Eq.{succ u2} β (Denumerable.ofNat.{u2} β (Denumerable.ofEquiv.{u1, u2} α β _inst_3 e) n) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) (Equiv.symm.{succ u2, succ u1} β α e) (Denumerable.ofNat.{u1} α _inst_3 n))
-but is expected to have type
- forall (α : Type.{u2}) {β : Type.{u1}} [_inst_3 : Denumerable.{u2} α] (e : Equiv.{succ u1, succ u2} β α) (n : Nat), Eq.{succ u1} β (Denumerable.ofNat.{u1} β (Denumerable.ofEquiv.{u2, u1} α β _inst_3 e) n) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) (Equiv.symm.{succ u1, succ u2} β α e) (Denumerable.ofNat.{u2} α _inst_3 n))
-Case conversion may be inaccurate. Consider using '#align denumerable.of_equiv_of_nat Denumerable.ofEquiv_ofNatₓ'. -/
@[simp]
theorem ofEquiv_ofNat (α) {β} [Denumerable α] (e : β ≃ α) (n) :
@ofNat β (ofEquiv _ e) n = e.symm (ofNat α n) := by
@@ -187,12 +181,6 @@ instance sigma : Denumerable (Sigma γ) :=
#align denumerable.sigma Denumerable.sigma
-/
-/- warning: denumerable.sigma_of_nat_val -> Denumerable.sigma_ofNat_val is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Denumerable.{u1} α] {γ : α -> Type.{u2}} [_inst_3 : forall (a : α), Denumerable.{u2} (γ a)] (n : Nat), Eq.{succ (max u1 u2)} (Sigma.{u1, u2} α γ) (Denumerable.ofNat.{max u1 u2} (Sigma.{u1, u2} α γ) (Denumerable.sigma.{u1, u2} α _inst_1 γ (fun (a : α) => _inst_3 a)) n) (Sigma.mk.{u1, u2} α γ (Denumerable.ofNat.{u1} α _inst_1 (Prod.fst.{0, 0} Nat Nat (Nat.unpair n))) (Denumerable.ofNat.{u2} (γ (Denumerable.ofNat.{u1} α _inst_1 (Prod.fst.{0, 0} Nat Nat (Nat.unpair n)))) (_inst_3 (Denumerable.ofNat.{u1} α _inst_1 (Prod.fst.{0, 0} Nat Nat (Nat.unpair n)))) (Prod.snd.{0, 0} Nat Nat (Nat.unpair n))))
-but is expected to have type
- forall {α : Type.{u2}} [_inst_1 : Denumerable.{u2} α] {γ : α -> Type.{u1}} [_inst_3 : forall (a : α), Denumerable.{u1} (γ a)] (n : Nat), Eq.{max (succ u2) (succ u1)} (Sigma.{u2, u1} α γ) (Denumerable.ofNat.{max u1 u2} (Sigma.{u2, u1} α γ) (Denumerable.sigma.{u2, u1} α _inst_1 γ (fun (a : α) => _inst_3 a)) n) (Sigma.mk.{u2, u1} α γ (Denumerable.ofNat.{u2} α _inst_1 (Prod.fst.{0, 0} Nat Nat (Nat.unpair n))) (Denumerable.ofNat.{u1} (γ (Denumerable.ofNat.{u2} α _inst_1 (Prod.fst.{0, 0} Nat Nat (Nat.unpair n)))) (_inst_3 (Denumerable.ofNat.{u2} α _inst_1 (Prod.fst.{0, 0} Nat Nat (Nat.unpair n)))) (Prod.snd.{0, 0} Nat Nat (Nat.unpair n))))
-Case conversion may be inaccurate. Consider using '#align denumerable.sigma_of_nat_val Denumerable.sigma_ofNat_valₓ'. -/
@[simp]
theorem sigma_ofNat_val (n : ℕ) :
ofNat (Sigma γ) n = ⟨ofNat α (unpair n).1, ofNat (γ _) (unpair n).2⟩ :=
@@ -208,12 +196,6 @@ instance prod : Denumerable (α × β) :=
#align denumerable.prod Denumerable.prod
-/
-/- warning: denumerable.prod_of_nat_val -> Denumerable.prod_ofNat_val is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : Denumerable.{u1} α] [_inst_2 : Denumerable.{u2} β] (n : Nat), Eq.{succ (max u1 u2)} (Prod.{u1, u2} α β) (Denumerable.ofNat.{max u1 u2} (Prod.{u1, u2} α β) (Denumerable.prod.{u1, u2} α β _inst_1 _inst_2) n) (Prod.mk.{u1, u2} α β (Denumerable.ofNat.{u1} α _inst_1 (Prod.fst.{0, 0} Nat Nat (Nat.unpair n))) (Denumerable.ofNat.{u2} β _inst_2 (Prod.snd.{0, 0} Nat Nat (Nat.unpair n))))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : Denumerable.{u2} α] [_inst_2 : Denumerable.{u1} β] (n : Nat), Eq.{max (succ u2) (succ u1)} (Prod.{u2, u1} α β) (Denumerable.ofNat.{max u1 u2} (Prod.{u2, u1} α β) (Denumerable.prod.{u2, u1} α β _inst_1 _inst_2) n) (Prod.mk.{u2, u1} α β (Denumerable.ofNat.{u2} α _inst_1 (Prod.fst.{0, 0} Nat Nat (Nat.unpair n))) (Denumerable.ofNat.{u1} β _inst_2 (Prod.snd.{0, 0} Nat Nat (Nat.unpair n))))
-Case conversion may be inaccurate. Consider using '#align denumerable.prod_of_nat_val Denumerable.prod_ofNat_valₓ'. -/
@[simp]
theorem prod_ofNat_val (n : ℕ) : ofNat (α × β) n = (ofNat α (unpair n).1, ofNat β (unpair n).2) :=
by simp <;> rfl
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -397,11 +397,9 @@ theorem coe_comp_ofNat_range : Set.range (coe ∘ ofNat s : ℕ → ℕ) = s :=
private def to_fun_aux (x : s) : ℕ :=
(List.range x).countp (· ∈ s)
-#align nat.subtype.to_fun_aux nat.subtype.to_fun_aux
private theorem to_fun_aux_eq (x : s) : toFunAux x = ((Finset.range x).filterₓ (· ∈ s)).card := by
rw [to_fun_aux, List.countp_eq_length_filter] <;> rfl
-#align nat.subtype.to_fun_aux_eq nat.subtype.to_fun_aux_eq
open Finset
@@ -430,7 +428,6 @@ private theorem right_inverse_aux : ∀ n, toFunAux (ofNat s n) = n
conv =>
rhs
rw [← ih, ← card_insert_of_not_mem h₁, ← h₂]
-#align nat.subtype.right_inverse_aux nat.subtype.right_inverse_aux
#print Nat.Subtype.denumerable /-
/-- Any infinite set of naturals is denumerable. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/95a87616d63b3cb49d3fe678d416fbe9c4217bf4
@@ -125,7 +125,7 @@ def ofEquiv (α) {β} [Denumerable α] (e : β ≃ α) : Denumerable β :=
lean 3 declaration is
forall (α : Type.{u1}) {β : Type.{u2}} [_inst_3 : Denumerable.{u1} α] (e : Equiv.{succ u2, succ u1} β α) (n : Nat), Eq.{succ u2} β (Denumerable.ofNat.{u2} β (Denumerable.ofEquiv.{u1, u2} α β _inst_3 e) n) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) (Equiv.symm.{succ u2, succ u1} β α e) (Denumerable.ofNat.{u1} α _inst_3 n))
but is expected to have type
- forall (α : Type.{u2}) {β : Type.{u1}} [_inst_3 : Denumerable.{u2} α] (e : Equiv.{succ u1, succ u2} β α) (n : Nat), Eq.{succ u1} β (Denumerable.ofNat.{u1} β (Denumerable.ofEquiv.{u2, u1} α β _inst_3 e) n) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) (Equiv.symm.{succ u1, succ u2} β α e) (Denumerable.ofNat.{u2} α _inst_3 n))
+ forall (α : Type.{u2}) {β : Type.{u1}} [_inst_3 : Denumerable.{u2} α] (e : Equiv.{succ u1, succ u2} β α) (n : Nat), Eq.{succ u1} β (Denumerable.ofNat.{u1} β (Denumerable.ofEquiv.{u2, u1} α β _inst_3 e) n) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) (Equiv.symm.{succ u1, succ u2} β α e) (Denumerable.ofNat.{u2} α _inst_3 n))
Case conversion may be inaccurate. Consider using '#align denumerable.of_equiv_of_nat Denumerable.ofEquiv_ofNatₓ'. -/
@[simp]
theorem ofEquiv_ofNat (α) {β} [Denumerable α] (e : β ≃ α) (n) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -125,7 +125,7 @@ def ofEquiv (α) {β} [Denumerable α] (e : β ≃ α) : Denumerable β :=
lean 3 declaration is
forall (α : Type.{u1}) {β : Type.{u2}} [_inst_3 : Denumerable.{u1} α] (e : Equiv.{succ u2, succ u1} β α) (n : Nat), Eq.{succ u2} β (Denumerable.ofNat.{u2} β (Denumerable.ofEquiv.{u1, u2} α β _inst_3 e) n) (coeFn.{max 1 (max (succ u1) (succ u2)) (succ u2) (succ u1), max (succ u1) (succ u2)} (Equiv.{succ u1, succ u2} α β) (fun (_x : Equiv.{succ u1, succ u2} α β) => α -> β) (Equiv.hasCoeToFun.{succ u1, succ u2} α β) (Equiv.symm.{succ u2, succ u1} β α e) (Denumerable.ofNat.{u1} α _inst_3 n))
but is expected to have type
- forall (α : Type.{u2}) {β : Type.{u1}} [_inst_3 : Denumerable.{u2} α] (e : Equiv.{succ u1, succ u2} β α) (n : Nat), Eq.{succ u1} β (Denumerable.ofNat.{u1} β (Denumerable.ofEquiv.{u2, u1} α β _inst_3 e) n) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.805 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) (Equiv.symm.{succ u1, succ u2} β α e) (Denumerable.ofNat.{u2} α _inst_3 n))
+ forall (α : Type.{u2}) {β : Type.{u1}} [_inst_3 : Denumerable.{u2} α] (e : Equiv.{succ u1, succ u2} β α) (n : Nat), Eq.{succ u1} β (Denumerable.ofNat.{u1} β (Denumerable.ofEquiv.{u2, u1} α β _inst_3 e) n) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Equiv.{succ u2, succ u1} α β) α (fun (_x : α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : α) => β) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u1} α β) (Equiv.symm.{succ u1, succ u2} β α e) (Denumerable.ofNat.{u2} α _inst_3 n))
Case conversion may be inaccurate. Consider using '#align denumerable.of_equiv_of_nat Denumerable.ofEquiv_ofNatₓ'. -/
@[simp]
theorem ofEquiv_ofNat (α) {β} [Denumerable α] (e : β ≃ α) (n) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
open Classical
(#11199)
We remove all but one open Classical
s, instead preferring to use open scoped Classical
. The only real side-effect this led to is moving a couple declarations to use Exists.choose
instead of Classical.choose
.
The first few commits are explicitly labelled regex replaces for ease of review.
@@ -216,7 +216,7 @@ variable {s : Set ℕ} [Infinite s]
section Classical
-open Classical
+open scoped Classical
theorem exists_succ (x : s) : ∃ n, (x : ℕ) + n + 1 ∈ s :=
_root_.by_contradiction fun h =>
@@ -3,7 +3,7 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
-import Mathlib.Data.Fintype.Lattice
+import Mathlib.Data.Fintype.Card
import Mathlib.Data.List.MinMax
import Mathlib.Data.Nat.Order.Lemmas
import Mathlib.Logic.Encodable.Basic
cases x with | ...
instead of cases x; case => ...
(#9321)
This converts usages of the pattern
cases h
case inl h' => ...
case inr h' => ...
which derive from mathported code, to the "structured cases
" syntax:
cases h with
| inl h' => ...
| inr h' => ...
The case where the subgoals are handled with ·
instead of case
is more contentious (and much more numerous) so I left those alone. This pattern also appears with cases'
, induction
, induction'
, and rcases
. Furthermore, there is a similar transformation for by_cases
:
by_cases h : cond
case pos => ...
case neg => ...
is replaced by:
if h : cond then
...
else
...
Co-authored-by: Mario Carneiro <di.gama@gmail.com>
@@ -127,11 +127,11 @@ theorem ofNat_nat (n) : ofNat ℕ n = n :=
/-- If `α` is denumerable, then so is `Option α`. -/
instance option : Denumerable (Option α) :=
⟨fun n => by
- cases n
- case zero =>
+ cases n with
+ | zero =>
refine' ⟨none, _, encode_none⟩
rw [decode_option_zero, Option.mem_def]
- case succ n =>
+ | succ n =>
refine' ⟨some (ofNat α n), _, _⟩
· rw [decode_option_succ, decode_eq_ofNat, Option.map_some', Option.mem_def]
rw [encode_some, encode_ofNat]⟩
This incorporates changes from https://github.com/leanprover-community/mathlib4/pull/6575
I have also renamed Multiset.countp
to Multiset.countP
for consistency.
Co-authored-by: James Gallichio <jamesgallicchio@gmail.com>
Co-authored-by: James <jamesgallicchio@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -316,10 +316,10 @@ theorem coe_comp_ofNat_range : Set.range ((↑) ∘ ofNat s : ℕ → ℕ) = s :
#align nat.subtype.coe_comp_of_nat_range Nat.Subtype.coe_comp_ofNat_range
private def toFunAux (x : s) : ℕ :=
- (List.range x).countp (· ∈ s)
+ (List.range x).countP (· ∈ s)
private theorem toFunAux_eq (x : s) : toFunAux x = ((Finset.range x).filter (· ∈ s)).card := by
- rw [toFunAux, List.countp_eq_length_filter]
+ rw [toFunAux, List.countP_eq_length_filter]
rfl
open Finset
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -24,10 +24,10 @@ typeclass.
-/
-variable {α β : Type _}
+variable {α β : Type*}
/-- A denumerable type is (constructively) bijective with `ℕ`. Typeclass equivalent of `α ≃ ℕ`. -/
-class Denumerable (α : Type _) extends Encodable α where
+class Denumerable (α : Type*) extends Encodable α where
/-- `decode` and `encode` are inverses. -/
decode_inv : ∀ n, ∃ a ∈ decode n, encode a = n
#align denumerable Denumerable
@@ -149,7 +149,7 @@ instance sum : Denumerable (Sum α β) :=
section Sigma
-variable {γ : α → Type _} [∀ a, Denumerable (γ a)]
+variable {γ : α → Type*} [∀ a, Denumerable (γ a)]
/-- A denumerable collection of denumerable types is denumerable. -/
instance sigma : Denumerable (Sigma γ) :=
@@ -364,7 +364,7 @@ namespace Denumerable
open Encodable
/-- An infinite encodable type is denumerable. -/
-def ofEncodableOfInfinite (α : Type _) [Encodable α] [Infinite α] : Denumerable α := by
+def ofEncodableOfInfinite (α : Type*) [Encodable α] [Infinite α] : Denumerable α := by
letI := @decidableRangeEncode α _
letI : Infinite (Set.range (@encode α _)) :=
Infinite.of_injective _ (Equiv.ofInjective _ encode_injective).injective
@@ -375,11 +375,11 @@ def ofEncodableOfInfinite (α : Type _) [Encodable α] [Infinite α] : Denumerab
end Denumerable
/-- See also `nonempty_encodable`, `nonempty_fintype`. -/
-theorem nonempty_denumerable (α : Type _) [Countable α] [Infinite α] : Nonempty (Denumerable α) :=
+theorem nonempty_denumerable (α : Type*) [Countable α] [Infinite α] : Nonempty (Denumerable α) :=
(nonempty_encodable α).map fun h => @Denumerable.ofEncodableOfInfinite _ h _
#align nonempty_denumerable nonempty_denumerable
-theorem nonempty_denumerable_iff {α : Type _} :
+theorem nonempty_denumerable_iff {α : Type*} :
Nonempty (Denumerable α) ↔ Countable α ∧ Infinite α :=
⟨fun ⟨_⟩ ↦ ⟨inferInstance, inferInstance⟩, fun ⟨_, _⟩ ↦ nonempty_denumerable _⟩
@@ -2,17 +2,14 @@
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-
-! This file was ported from Lean 3 source module logic.denumerable
-! leanprover-community/mathlib commit 509de852e1de55e1efa8eacfa11df0823f26f226
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.Fintype.Lattice
import Mathlib.Data.List.MinMax
import Mathlib.Data.Nat.Order.Lemmas
import Mathlib.Logic.Encodable.Basic
+#align_import logic.denumerable from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226"
+
/-!
# Denumerable types
From the sphere eversion project
@@ -382,6 +382,10 @@ theorem nonempty_denumerable (α : Type _) [Countable α] [Infinite α] : Nonemp
(nonempty_encodable α).map fun h => @Denumerable.ofEncodableOfInfinite _ h _
#align nonempty_denumerable nonempty_denumerable
+theorem nonempty_denumerable_iff {α : Type _} :
+ Nonempty (Denumerable α) ↔ Countable α ∧ Infinite α :=
+ ⟨fun ⟨_⟩ ↦ ⟨inferInstance, inferInstance⟩, fun ⟨_, _⟩ ↦ nonempty_denumerable _⟩
+
instance nonempty_equiv_of_countable [Countable α] [Infinite α] [Countable β] [Infinite β] :
Nonempty (α ≃ β) := by
cases nonempty_denumerable α
Co-authored-by: Komyyy <pol_tta@outlook.jp> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>
@@ -66,7 +66,7 @@ theorem ofNat_of_decode {n b} (h : decode (α := α) n = some b) : ofNat (α :=
@[simp]
theorem encode_ofNat (n) : encode (ofNat α n) = n := by
- obtain ⟨a, h, e⟩ := decode_inv n
+ obtain ⟨a, h, e⟩ := decode_inv (α := α) n
rwa [ofNat_of_decode h]
#align denumerable.encode_of_nat Denumerable.encode_ofNat
at
and goals (#5387)
Changes are of the form
some_tactic at h⊢
-> some_tactic at h ⊢
some_tactic at h
-> some_tactic at h
@@ -346,7 +346,7 @@ private theorem right_inverse_aux : ∀ n, toFunAux (ofNat s n) = n
fun h =>
h.elim (fun h => h.symm ▸ ⟨lt_succ_self _, (ofNat s n).prop⟩) fun h =>
⟨h.1.trans (lt_succ_self _), h.2⟩⟩
- simp only [toFunAux_eq, ofNat, range_succ] at ih⊢
+ simp only [toFunAux_eq, ofNat, range_succ] at ih ⊢
conv =>
rhs
rw [← ih, ← card_insert_of_not_mem h₁, ← h₂]
fix-comments.py
on all files.@@ -127,7 +127,7 @@ theorem ofNat_nat (n) : ofNat ℕ n = n :=
rfl
#align denumerable.of_nat_nat Denumerable.ofNat_nat
-/-- If `α` is denumerable, then so is `option α`. -/
+/-- If `α` is denumerable, then so is `Option α`. -/
instance option : Denumerable (Option α) :=
⟨fun n => by
cases n
by
s! (#3825)
This PR puts, with one exception, every single remaining by
that lies all by itself on its own line to the previous line, thus matching the current behaviour of start-port.sh
. The exception is when the by
begins the second or later argument to a tuple or anonymous constructor; see https://github.com/leanprover-community/mathlib4/pull/3825#discussion_r1186702599.
Essentially this is s/\n *by$/ by/g
, but with manual editing to satisfy the linter's max-100-char-line requirement. The Python style linter is also modified to catch these "isolated by
s".
@@ -336,10 +336,8 @@ private theorem right_inverse_aux : ∀ n, toFunAux (ofNat s n) = n
| n + 1 => by
have ih : toFunAux (ofNat s n) = n := right_inverse_aux n
have h₁ : (ofNat s n : ℕ) ∉ (range (ofNat s n)).filter (· ∈ s) := by simp
- have h₂ :
- (range (succ (ofNat s n))).filter (· ∈ s) =
- insert ↑(ofNat s n) ((range (ofNat s n)).filter (· ∈ s)) :=
- by
+ have h₂ : (range (succ (ofNat s n))).filter (· ∈ s) =
+ insert ↑(ofNat s n) ((range (ofNat s n)).filter (· ∈ s)) := by
simp only [Finset.ext_iff, mem_insert, mem_range, mem_filter]
exact fun m =>
⟨fun h => by
This PR fixes two things:
align
statements for definitions and theorems and instances that are separated by two newlines from the relevant declaration (s/\n\n#align/\n#align
). This is often seen in the mathport output after ending calc
blocks.#align
statements. (This was needed for a script I wrote for #3630.)@@ -259,7 +259,6 @@ theorem le_succ_of_forall_lt_le {x y : s} (h : ∀ z < x, z ≤ y) : x ≤ succ
calc
(y : ℕ) ≤ (y : ℕ) + Nat.find hx := le_add_of_nonneg_right (Nat.zero_le _)
_ < (y : ℕ) + Nat.find hx + 1 := Nat.lt_succ_self _
-
#align nat.subtype.le_succ_of_forall_lt_le Nat.Subtype.le_succ_of_forall_lt_le
theorem lt_succ_self (x : s) : x < succ x :=
@@ -256,7 +256,6 @@ theorem le_succ_of_forall_lt_le {x y : s} (h : ∀ z < x, z ≤ y) : x ≤ succ
show (x : ℕ) ≤ (y : ℕ) + Nat.find hx + 1 from
le_of_not_gt fun hxy =>
(h ⟨_, Nat.find_spec hx⟩ hxy).not_lt <|
- show _ < _ from -- lean4#2073
calc
(y : ℕ) ≤ (y : ℕ) + Nat.find hx := le_add_of_nonneg_right (Nat.zero_le _)
_ < (y : ℕ) + Nat.find hx + 1 := Nat.lt_succ_self _
@@ -264,7 +263,6 @@ theorem le_succ_of_forall_lt_le {x y : s} (h : ∀ z < x, z ≤ y) : x ≤ succ
#align nat.subtype.le_succ_of_forall_lt_le Nat.Subtype.le_succ_of_forall_lt_le
theorem lt_succ_self (x : s) : x < succ x :=
- show _ < _ from -- lean4#2073
calc
-- Porting note: replaced `x + _`, added type annotations
(x : ℕ) ≤ (x + Nat.find (exists_succ x): ℕ) := le_self_add
@@ -256,13 +256,15 @@ theorem le_succ_of_forall_lt_le {x y : s} (h : ∀ z < x, z ≤ y) : x ≤ succ
show (x : ℕ) ≤ (y : ℕ) + Nat.find hx + 1 from
le_of_not_gt fun hxy =>
(h ⟨_, Nat.find_spec hx⟩ hxy).not_lt <|
+ show _ < _ from -- lean4#2073
calc
(y : ℕ) ≤ (y : ℕ) + Nat.find hx := le_add_of_nonneg_right (Nat.zero_le _)
_ < (y : ℕ) + Nat.find hx + 1 := Nat.lt_succ_self _
#align nat.subtype.le_succ_of_forall_lt_le Nat.Subtype.le_succ_of_forall_lt_le
-theorem lt_succ_self (x : s) : x < succ x := by
+theorem lt_succ_self (x : s) : x < succ x :=
+ show _ < _ from -- lean4#2073
calc
-- Porting note: replaced `x + _`, added type annotations
(x : ℕ) ≤ (x + Nat.find (exists_succ x): ℕ) := le_self_add
The unported dependencies are