set_theory.cardinal.divisibility
⟷
Mathlib.SetTheory.Cardinal.Divisibility
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)
(last sync)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(first ported)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -88,7 +88,7 @@ theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a :=
cases' eq_or_ne (b * c) 0 with hz hz
· rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp
wlog h : c ≤ b
- · cases le_total c b <;> [skip; rw [or_comm']] <;> apply_assumption; assumption'
+ · cases le_total c b <;> [skip; rw [or_comm]] <;> apply_assumption; assumption'
all_goals rwa [mul_comm]
left
have habc := le_of_dvd hz hbc
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -48,13 +48,13 @@ theorem isUnit_iff : IsUnit a ↔ a = 1 :=
refine' ⟨fun h => _, by rintro rfl; exact isUnit_one⟩
rcases eq_or_ne a 0 with (rfl | ha)
· exact (not_isUnit_zero h).elim
- rw [isUnit_iff_forall_dvd] at h
+ rw [isUnit_iff_forall_dvd] at h
cases' h 1 with t ht
- rw [eq_comm, mul_eq_one_iff'] at ht
+ rw [eq_comm, mul_eq_one_iff'] at ht
· exact ht.1
all_goals rwa [one_le_iff_ne_zero]
· rintro rfl
- rw [MulZeroClass.mul_zero] at ht
+ rw [MulZeroClass.mul_zero] at ht
exact zero_ne_one ht
#align cardinal.is_unit_iff Cardinal.isUnit_iff
-/
@@ -92,7 +92,7 @@ theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a :=
all_goals rwa [mul_comm]
left
have habc := le_of_dvd hz hbc
- rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc
+ rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc
#align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_le
-/
@@ -113,9 +113,9 @@ theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m :=
refine' ⟨_, fun ⟨h, ht⟩ => ⟨h, by exact_mod_cast ht⟩⟩
rintro ⟨k, hk⟩
have : ↑m < ℵ₀ := nat_lt_aleph_0 m
- rw [hk, mul_lt_aleph_0_iff] at this
+ rw [hk, mul_lt_aleph_0_iff] at this
rcases this with (h | h | ⟨-, hk'⟩)
- iterate 2 simp only [h, MulZeroClass.mul_zero, MulZeroClass.zero_mul, Nat.cast_eq_zero] at hk ;
+ iterate 2 simp only [h, MulZeroClass.mul_zero, MulZeroClass.zero_mul, Nat.cast_eq_zero] at hk;
simp [hk]
lift k to ℕ using hk'
exact ⟨k, by exact_mod_cast hk⟩
@@ -141,7 +141,7 @@ theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime :=
rcases aleph_0_le_mul_iff.mp h' with ⟨hb, hc, hℵ₀⟩
have hn : (n : Cardinal) ≠ 0 := by
intro h
- rw [h, zero_dvd_iff, mul_eq_zero] at hbc
+ rw [h, zero_dvd_iff, mul_eq_zero] at hbc
cases hbc <;> contradiction
wlog hℵ₀b : ℵ₀ ≤ b
· refine' (this h c b _ _ hc hb hℵ₀.symm hn (hℵ₀.resolve_left hℵ₀b)).symm <;> rwa [mul_comm]
@@ -172,7 +172,7 @@ theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n
rintro ⟨p, k, hp, hk, hpk⟩
have key : _ ≤ p ^ k :=
power_le_power_left hp.ne_zero (show (1 : Cardinal) ≤ k by exact_mod_cast hk)
- rw [power_one, hpk] at key
+ rw [power_one, hpk] at key
lift p to ℕ using key.trans_lt (nat_lt_aleph_0 a)
exact ⟨p, k, nat_is_prime_iff.mp hp, hk, by exact_mod_cast hpk⟩
#align cardinal.is_prime_pow_iff Cardinal.isPrimePow_iff
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Rodriguez
-/
-import Mathbin.Algebra.IsPrimePow
-import Mathbin.SetTheory.Cardinal.Ordinal
+import Algebra.IsPrimePow
+import SetTheory.Cardinal.Ordinal
#align_import set_theory.cardinal.divisibility from "leanprover-community/mathlib"@"ee05e9ce1322178f0c12004eb93c00d2c8c00ed2"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2022 Eric Rodriguez. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Rodriguez
-
-! This file was ported from Lean 3 source module set_theory.cardinal.divisibility
-! leanprover-community/mathlib commit ee05e9ce1322178f0c12004eb93c00d2c8c00ed2
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Algebra.IsPrimePow
import Mathbin.SetTheory.Cardinal.Ordinal
+#align_import set_theory.cardinal.divisibility from "leanprover-community/mathlib"@"ee05e9ce1322178f0c12004eb93c00d2c8c00ed2"
+
/-!
# Cardinal Divisibility
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -81,6 +81,7 @@ theorem dvd_of_le_of_aleph0_le (ha : a ≠ 0) (h : a ≤ b) (hb : ℵ₀ ≤ b)
#align cardinal.dvd_of_le_of_aleph_0_le Cardinal.dvd_of_le_of_aleph0_le
-/
+#print Cardinal.prime_of_aleph0_le /-
@[simp]
theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a :=
by
@@ -96,6 +97,7 @@ theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a :=
have habc := le_of_dvd hz hbc
rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc
#align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_le
+-/
#print Cardinal.not_irreducible_of_aleph0_le /-
theorem not_irreducible_of_aleph0_le (ha : ℵ₀ ≤ a) : ¬Irreducible a :=
@@ -107,6 +109,7 @@ theorem not_irreducible_of_aleph0_le (ha : ℵ₀ ≤ a) : ¬Irreducible a :=
#align cardinal.not_irreducible_of_aleph_0_le Cardinal.not_irreducible_of_aleph0_le
-/
+#print Cardinal.nat_coe_dvd_iff /-
@[simp, norm_cast]
theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m :=
by
@@ -120,7 +123,9 @@ theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m :=
lift k to ℕ using hk'
exact ⟨k, by exact_mod_cast hk⟩
#align cardinal.nat_coe_dvd_iff Cardinal.nat_coe_dvd_iff
+-/
+#print Cardinal.nat_is_prime_iff /-
@[simp]
theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime :=
by
@@ -145,7 +150,9 @@ theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime :=
· refine' (this h c b _ _ hc hb hℵ₀.symm hn (hℵ₀.resolve_left hℵ₀b)).symm <;> rwa [mul_comm]
exact Or.inl (dvd_of_le_of_aleph_0_le hn ((nat_lt_aleph_0 n).le.trans hℵ₀b) hℵ₀b)
#align cardinal.nat_is_prime_iff Cardinal.nat_is_prime_iff
+-/
+#print Cardinal.is_prime_iff /-
theorem is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ, a = p ∧ p.Prime :=
by
cases' le_or_lt ℵ₀ a with h h
@@ -153,7 +160,9 @@ theorem is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ,
lift a to ℕ using id h
simp [not_le.mpr h]
#align cardinal.is_prime_iff Cardinal.is_prime_iff
+-/
+#print Cardinal.isPrimePow_iff /-
theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n :=
by
by_cases h : ℵ₀ ≤ a
@@ -170,6 +179,7 @@ theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n
lift p to ℕ using key.trans_lt (nat_lt_aleph_0 a)
exact ⟨p, k, nat_is_prime_iff.mp hp, hk, by exact_mod_cast hpk⟩
#align cardinal.is_prime_pow_iff Cardinal.isPrimePow_iff
+-/
end Cardinal
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -51,13 +51,13 @@ theorem isUnit_iff : IsUnit a ↔ a = 1 :=
refine' ⟨fun h => _, by rintro rfl; exact isUnit_one⟩
rcases eq_or_ne a 0 with (rfl | ha)
· exact (not_isUnit_zero h).elim
- rw [isUnit_iff_forall_dvd] at h
+ rw [isUnit_iff_forall_dvd] at h
cases' h 1 with t ht
- rw [eq_comm, mul_eq_one_iff'] at ht
+ rw [eq_comm, mul_eq_one_iff'] at ht
· exact ht.1
all_goals rwa [one_le_iff_ne_zero]
· rintro rfl
- rw [MulZeroClass.mul_zero] at ht
+ rw [MulZeroClass.mul_zero] at ht
exact zero_ne_one ht
#align cardinal.is_unit_iff Cardinal.isUnit_iff
-/
@@ -90,11 +90,11 @@ theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a :=
cases' eq_or_ne (b * c) 0 with hz hz
· rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp
wlog h : c ≤ b
- · cases le_total c b <;> [skip;rw [or_comm']] <;> apply_assumption; assumption'
+ · cases le_total c b <;> [skip; rw [or_comm']] <;> apply_assumption; assumption'
all_goals rwa [mul_comm]
left
have habc := le_of_dvd hz hbc
- rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc
+ rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc
#align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_le
#print Cardinal.not_irreducible_of_aleph0_le /-
@@ -113,9 +113,9 @@ theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m :=
refine' ⟨_, fun ⟨h, ht⟩ => ⟨h, by exact_mod_cast ht⟩⟩
rintro ⟨k, hk⟩
have : ↑m < ℵ₀ := nat_lt_aleph_0 m
- rw [hk, mul_lt_aleph_0_iff] at this
+ rw [hk, mul_lt_aleph_0_iff] at this
rcases this with (h | h | ⟨-, hk'⟩)
- iterate 2 simp only [h, MulZeroClass.mul_zero, MulZeroClass.zero_mul, Nat.cast_eq_zero] at hk;
+ iterate 2 simp only [h, MulZeroClass.mul_zero, MulZeroClass.zero_mul, Nat.cast_eq_zero] at hk ;
simp [hk]
lift k to ℕ using hk'
exact ⟨k, by exact_mod_cast hk⟩
@@ -139,7 +139,7 @@ theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime :=
rcases aleph_0_le_mul_iff.mp h' with ⟨hb, hc, hℵ₀⟩
have hn : (n : Cardinal) ≠ 0 := by
intro h
- rw [h, zero_dvd_iff, mul_eq_zero] at hbc
+ rw [h, zero_dvd_iff, mul_eq_zero] at hbc
cases hbc <;> contradiction
wlog hℵ₀b : ℵ₀ ≤ b
· refine' (this h c b _ _ hc hb hℵ₀.symm hn (hℵ₀.resolve_left hℵ₀b)).symm <;> rwa [mul_comm]
@@ -166,7 +166,7 @@ theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n
rintro ⟨p, k, hp, hk, hpk⟩
have key : _ ≤ p ^ k :=
power_le_power_left hp.ne_zero (show (1 : Cardinal) ≤ k by exact_mod_cast hk)
- rw [power_one, hpk] at key
+ rw [power_one, hpk] at key
lift p to ℕ using key.trans_lt (nat_lt_aleph_0 a)
exact ⟨p, k, nat_is_prime_iff.mp hp, hk, by exact_mod_cast hpk⟩
#align cardinal.is_prime_pow_iff Cardinal.isPrimePow_iff
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -38,7 +38,7 @@ Note furthermore that no infinite cardinal is irreducible
namespace Cardinal
-open Cardinal
+open scoped Cardinal
universe u
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -81,12 +81,6 @@ theorem dvd_of_le_of_aleph0_le (ha : a ≠ 0) (h : a ≤ b) (hb : ℵ₀ ≤ b)
#align cardinal.dvd_of_le_of_aleph_0_le Cardinal.dvd_of_le_of_aleph0_le
-/
-/- warning: cardinal.prime_of_aleph_0_le -> Cardinal.prime_of_aleph0_le is a dubious translation:
-lean 3 declaration is
- forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) -> (Prime.{succ u1} Cardinal.{u1} Cardinal.commMonoidWithZero.{u1} a)
-but is expected to have type
- forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) -> (Prime.{succ u1} Cardinal.{u1} Cardinal.instCommMonoidWithZeroCardinal.{u1} a)
-Case conversion may be inaccurate. Consider using '#align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_leₓ'. -/
@[simp]
theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a :=
by
@@ -113,12 +107,6 @@ theorem not_irreducible_of_aleph0_le (ha : ℵ₀ ≤ a) : ¬Irreducible a :=
#align cardinal.not_irreducible_of_aleph_0_le Cardinal.not_irreducible_of_aleph0_le
-/
-/- warning: cardinal.nat_coe_dvd_iff -> Cardinal.nat_coe_dvd_iff is a dubious translation:
-lean 3 declaration is
- forall {n : Nat} {m : Nat}, Iff (Dvd.Dvd.{succ u1} Cardinal.{u1} (semigroupDvd.{succ u1} Cardinal.{u1} (SemigroupWithZero.toSemigroup.{succ u1} Cardinal.{u1} (NonUnitalSemiring.toSemigroupWithZero.{succ u1} Cardinal.{u1} (NonUnitalCommSemiring.toNonUnitalSemiring.{succ u1} Cardinal.{u1} (CommSemiring.toNonUnitalCommSemiring.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}))))) ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n) ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) m)) (Dvd.Dvd.{0} Nat Nat.hasDvd n m)
-but is expected to have type
- forall {n : Nat} {m : Nat}, Iff (Dvd.dvd.{succ u1} Cardinal.{u1} (semigroupDvd.{succ u1} Cardinal.{u1} (SemigroupWithZero.toSemigroup.{succ u1} Cardinal.{u1} (NonUnitalSemiring.toSemigroupWithZero.{succ u1} Cardinal.{u1} (NonUnitalCommSemiring.toNonUnitalSemiring.{succ u1} Cardinal.{u1} (CommSemiring.toNonUnitalCommSemiring.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}))))) (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n) (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} m)) (Dvd.dvd.{0} Nat Nat.instDvdNat n m)
-Case conversion may be inaccurate. Consider using '#align cardinal.nat_coe_dvd_iff Cardinal.nat_coe_dvd_iffₓ'. -/
@[simp, norm_cast]
theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m :=
by
@@ -133,12 +121,6 @@ theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m :=
exact ⟨k, by exact_mod_cast hk⟩
#align cardinal.nat_coe_dvd_iff Cardinal.nat_coe_dvd_iff
-/- warning: cardinal.nat_is_prime_iff -> Cardinal.nat_is_prime_iff is a dubious translation:
-lean 3 declaration is
- forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} Cardinal.commMonoidWithZero.{u1} ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (Nat.Prime n)
-but is expected to have type
- forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} Cardinal.instCommMonoidWithZeroCardinal.{u1} (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (Nat.Prime n)
-Case conversion may be inaccurate. Consider using '#align cardinal.nat_is_prime_iff Cardinal.nat_is_prime_iffₓ'. -/
@[simp]
theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime :=
by
@@ -164,12 +146,6 @@ theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime :=
exact Or.inl (dvd_of_le_of_aleph_0_le hn ((nat_lt_aleph_0 n).le.trans hℵ₀b) hℵ₀b)
#align cardinal.nat_is_prime_iff Cardinal.nat_is_prime_iff
-/- warning: cardinal.is_prime_iff -> Cardinal.is_prime_iff is a dubious translation:
-lean 3 declaration is
- forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} Cardinal.commMonoidWithZero.{u1} a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) p)) (Nat.Prime p))))
-but is expected to have type
- forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} Cardinal.instCommMonoidWithZeroCardinal.{u1} a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} p)) (Nat.Prime p))))
-Case conversion may be inaccurate. Consider using '#align cardinal.is_prime_iff Cardinal.is_prime_iffₓ'. -/
theorem is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ, a = p ∧ p.Prime :=
by
cases' le_or_lt ℵ₀ a with h h
@@ -178,12 +154,6 @@ theorem is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ,
simp [not_le.mpr h]
#align cardinal.is_prime_iff Cardinal.is_prime_iff
-/- warning: cardinal.is_prime_pow_iff -> Cardinal.isPrimePow_iff is a dubious translation:
-lean 3 declaration is
- forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} Cardinal.commMonoidWithZero.{u1} a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
-but is expected to have type
- forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} Cardinal.instCommMonoidWithZeroCardinal.{u1} a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
-Case conversion may be inaccurate. Consider using '#align cardinal.is_prime_pow_iff Cardinal.isPrimePow_iffₓ'. -/
theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n :=
by
by_cases h : ℵ₀ ≤ a
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -48,10 +48,7 @@ variable {a b : Cardinal.{u}} {n m : ℕ}
@[simp]
theorem isUnit_iff : IsUnit a ↔ a = 1 :=
by
- refine'
- ⟨fun h => _, by
- rintro rfl
- exact isUnit_one⟩
+ refine' ⟨fun h => _, by rintro rfl; exact isUnit_one⟩
rcases eq_or_ne a 0 with (rfl | ha)
· exact (not_isUnit_zero h).elim
rw [isUnit_iff_forall_dvd] at h
@@ -99,8 +96,7 @@ theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a :=
cases' eq_or_ne (b * c) 0 with hz hz
· rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp
wlog h : c ≤ b
- · cases le_total c b <;> [skip;rw [or_comm']] <;> apply_assumption
- assumption'
+ · cases le_total c b <;> [skip;rw [or_comm']] <;> apply_assumption; assumption'
all_goals rwa [mul_comm]
left
have habc := le_of_dvd hz hbc
mathlib commit https://github.com/leanprover-community/mathlib/commit/8d33f09cd7089ecf074b4791907588245aec5d1b
@@ -99,7 +99,7 @@ theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a :=
cases' eq_or_ne (b * c) 0 with hz hz
· rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp
wlog h : c ≤ b
- · cases le_total c b <;> [skip, rw [or_comm']] <;> apply_assumption
+ · cases le_total c b <;> [skip;rw [or_comm']] <;> apply_assumption
assumption'
all_goals rwa [mul_comm]
left
mathlib commit https://github.com/leanprover-community/mathlib/commit/347636a7a80595d55bedf6e6fbd996a3c39da69a
@@ -88,7 +88,7 @@ theorem dvd_of_le_of_aleph0_le (ha : a ≠ 0) (h : a ≤ b) (hb : ℵ₀ ≤ b)
lean 3 declaration is
forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) -> (Prime.{succ u1} Cardinal.{u1} Cardinal.commMonoidWithZero.{u1} a)
but is expected to have type
- forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) -> (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.instLinearOrderedCommMonoidWithZeroCardinal.{u1}) a)
+ forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) -> (Prime.{succ u1} Cardinal.{u1} Cardinal.instCommMonoidWithZeroCardinal.{u1} a)
Case conversion may be inaccurate. Consider using '#align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_leₓ'. -/
@[simp]
theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a :=
@@ -141,7 +141,7 @@ theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m :=
lean 3 declaration is
forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} Cardinal.commMonoidWithZero.{u1} ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (Nat.Prime n)
but is expected to have type
- forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.instLinearOrderedCommMonoidWithZeroCardinal.{u1}) (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (Nat.Prime n)
+ forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} Cardinal.instCommMonoidWithZeroCardinal.{u1} (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (Nat.Prime n)
Case conversion may be inaccurate. Consider using '#align cardinal.nat_is_prime_iff Cardinal.nat_is_prime_iffₓ'. -/
@[simp]
theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime :=
@@ -172,7 +172,7 @@ theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime :=
lean 3 declaration is
forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} Cardinal.commMonoidWithZero.{u1} a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) p)) (Nat.Prime p))))
but is expected to have type
- forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.instLinearOrderedCommMonoidWithZeroCardinal.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} p)) (Nat.Prime p))))
+ forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} Cardinal.instCommMonoidWithZeroCardinal.{u1} a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} p)) (Nat.Prime p))))
Case conversion may be inaccurate. Consider using '#align cardinal.is_prime_iff Cardinal.is_prime_iffₓ'. -/
theorem is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ, a = p ∧ p.Prime :=
by
@@ -186,7 +186,7 @@ theorem is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ,
lean 3 declaration is
forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} Cardinal.commMonoidWithZero.{u1} a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
but is expected to have type
- forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.instLinearOrderedCommMonoidWithZeroCardinal.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
+ forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} Cardinal.instCommMonoidWithZeroCardinal.{u1} a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
Case conversion may be inaccurate. Consider using '#align cardinal.is_prime_pow_iff Cardinal.isPrimePow_iffₓ'. -/
theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/347636a7a80595d55bedf6e6fbd996a3c39da69a
@@ -86,7 +86,7 @@ theorem dvd_of_le_of_aleph0_le (ha : a ≠ 0) (h : a ≤ b) (hb : ℵ₀ ≤ b)
/- warning: cardinal.prime_of_aleph_0_le -> Cardinal.prime_of_aleph0_le is a dubious translation:
lean 3 declaration is
- forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) -> (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.linearOrderedCommMonoidWithZero.{u1}) a)
+ forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) -> (Prime.{succ u1} Cardinal.{u1} Cardinal.commMonoidWithZero.{u1} a)
but is expected to have type
forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) -> (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.instLinearOrderedCommMonoidWithZeroCardinal.{u1}) a)
Case conversion may be inaccurate. Consider using '#align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_leₓ'. -/
@@ -139,7 +139,7 @@ theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m :=
/- warning: cardinal.nat_is_prime_iff -> Cardinal.nat_is_prime_iff is a dubious translation:
lean 3 declaration is
- forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.linearOrderedCommMonoidWithZero.{u1}) ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (Nat.Prime n)
+ forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} Cardinal.commMonoidWithZero.{u1} ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (Nat.Prime n)
but is expected to have type
forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.instLinearOrderedCommMonoidWithZeroCardinal.{u1}) (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (Nat.Prime n)
Case conversion may be inaccurate. Consider using '#align cardinal.nat_is_prime_iff Cardinal.nat_is_prime_iffₓ'. -/
@@ -170,7 +170,7 @@ theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime :=
/- warning: cardinal.is_prime_iff -> Cardinal.is_prime_iff is a dubious translation:
lean 3 declaration is
- forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.linearOrderedCommMonoidWithZero.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) p)) (Nat.Prime p))))
+ forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} Cardinal.commMonoidWithZero.{u1} a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) p)) (Nat.Prime p))))
but is expected to have type
forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.instLinearOrderedCommMonoidWithZeroCardinal.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} p)) (Nat.Prime p))))
Case conversion may be inaccurate. Consider using '#align cardinal.is_prime_iff Cardinal.is_prime_iffₓ'. -/
@@ -184,7 +184,7 @@ theorem is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ,
/- warning: cardinal.is_prime_pow_iff -> Cardinal.isPrimePow_iff is a dubious translation:
lean 3 declaration is
- forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.linearOrderedCommMonoidWithZero.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
+ forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} Cardinal.commMonoidWithZero.{u1} a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
but is expected to have type
forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.instLinearOrderedCommMonoidWithZeroCardinal.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
Case conversion may be inaccurate. Consider using '#align cardinal.is_prime_pow_iff Cardinal.isPrimePow_iffₓ'. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/284fdd2962e67d2932fa3a79ce19fcf92d38e228
@@ -44,12 +44,7 @@ universe u
variable {a b : Cardinal.{u}} {n m : ℕ}
-/- warning: cardinal.is_unit_iff -> Cardinal.isUnit_iff is a dubious translation:
-lean 3 declaration is
- forall {a : Cardinal.{u1}}, Iff (IsUnit.{succ u1} Cardinal.{u1} (MonoidWithZero.toMonoid.{succ u1} Cardinal.{u1} (Semiring.toMonoidWithZero.{succ u1} Cardinal.{u1} (OrderedSemiring.toSemiring.{succ u1} Cardinal.{u1} (OrderedCommSemiring.toOrderedSemiring.{succ u1} Cardinal.{u1} (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{succ u1} Cardinal.{u1} Cardinal.canonicallyOrderedCommSemiring.{u1}))))) a) (Eq.{succ (succ u1)} Cardinal.{u1} a (OfNat.ofNat.{succ u1} Cardinal.{u1} 1 (OfNat.mk.{succ u1} Cardinal.{u1} 1 (One.one.{succ u1} Cardinal.{u1} Cardinal.hasOne.{u1}))))
-but is expected to have type
- forall {a : Cardinal.{u1}}, Iff (IsUnit.{succ u1} Cardinal.{u1} (MonoidWithZero.toMonoid.{succ u1} Cardinal.{u1} (Semiring.toMonoidWithZero.{succ u1} Cardinal.{u1} (OrderedSemiring.toSemiring.{succ u1} Cardinal.{u1} (OrderedCommSemiring.toOrderedSemiring.{succ u1} Cardinal.{u1} (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{succ u1} Cardinal.{u1} Cardinal.instCanonicallyOrderedCommSemiringCardinal.{u1}))))) a) (Eq.{succ (succ u1)} Cardinal.{u1} a (OfNat.ofNat.{succ u1} Cardinal.{u1} 1 (One.toOfNat1.{succ u1} Cardinal.{u1} Cardinal.instOneCardinal.{u1})))
-Case conversion may be inaccurate. Consider using '#align cardinal.is_unit_iff Cardinal.isUnit_iffₓ'. -/
+#print Cardinal.isUnit_iff /-
@[simp]
theorem isUnit_iff : IsUnit a ↔ a = 1 :=
by
@@ -68,6 +63,7 @@ theorem isUnit_iff : IsUnit a ↔ a = 1 :=
rw [MulZeroClass.mul_zero] at ht
exact zero_ne_one ht
#align cardinal.is_unit_iff Cardinal.isUnit_iff
+-/
instance : Unique Cardinal.{u}ˣ where
default := 1
@@ -92,7 +88,7 @@ theorem dvd_of_le_of_aleph0_le (ha : a ≠ 0) (h : a ≤ b) (hb : ℵ₀ ≤ b)
lean 3 declaration is
forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) -> (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.linearOrderedCommMonoidWithZero.{u1}) a)
but is expected to have type
- forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) -> (Prime.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) a)
+ forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) -> (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.instLinearOrderedCommMonoidWithZeroCardinal.{u1}) a)
Case conversion may be inaccurate. Consider using '#align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_leₓ'. -/
@[simp]
theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a :=
@@ -111,12 +107,7 @@ theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a :=
rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc
#align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_le
-/- warning: cardinal.not_irreducible_of_aleph_0_le -> Cardinal.not_irreducible_of_aleph0_le is a dubious translation:
-lean 3 declaration is
- forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) -> (Not (Irreducible.{succ u1} Cardinal.{u1} (MonoidWithZero.toMonoid.{succ u1} Cardinal.{u1} (Semiring.toMonoidWithZero.{succ u1} Cardinal.{u1} (OrderedSemiring.toSemiring.{succ u1} Cardinal.{u1} (OrderedCommSemiring.toOrderedSemiring.{succ u1} Cardinal.{u1} (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{succ u1} Cardinal.{u1} Cardinal.canonicallyOrderedCommSemiring.{u1}))))) a))
-but is expected to have type
- forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) -> (Not (Irreducible.{succ u1} Cardinal.{u1} (MonoidWithZero.toMonoid.{succ u1} Cardinal.{u1} (Semiring.toMonoidWithZero.{succ u1} Cardinal.{u1} (OrderedSemiring.toSemiring.{succ u1} Cardinal.{u1} (OrderedCommSemiring.toOrderedSemiring.{succ u1} Cardinal.{u1} (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{succ u1} Cardinal.{u1} Cardinal.instCanonicallyOrderedCommSemiringCardinal.{u1}))))) a))
-Case conversion may be inaccurate. Consider using '#align cardinal.not_irreducible_of_aleph_0_le Cardinal.not_irreducible_of_aleph0_leₓ'. -/
+#print Cardinal.not_irreducible_of_aleph0_le /-
theorem not_irreducible_of_aleph0_le (ha : ℵ₀ ≤ a) : ¬Irreducible a :=
by
rw [irreducible_iff, not_and_or]
@@ -124,6 +115,7 @@ theorem not_irreducible_of_aleph0_le (ha : ℵ₀ ≤ a) : ¬Irreducible a :=
simpa [mul_aleph_0_eq ha, is_unit_iff, (one_lt_aleph_0.trans_le ha).ne', one_lt_aleph_0.ne'] using
h a ℵ₀
#align cardinal.not_irreducible_of_aleph_0_le Cardinal.not_irreducible_of_aleph0_le
+-/
/- warning: cardinal.nat_coe_dvd_iff -> Cardinal.nat_coe_dvd_iff is a dubious translation:
lean 3 declaration is
@@ -149,7 +141,7 @@ theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m :=
lean 3 declaration is
forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.linearOrderedCommMonoidWithZero.{u1}) ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (Nat.Prime n)
but is expected to have type
- forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (Nat.Prime n)
+ forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.instLinearOrderedCommMonoidWithZeroCardinal.{u1}) (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (Nat.Prime n)
Case conversion may be inaccurate. Consider using '#align cardinal.nat_is_prime_iff Cardinal.nat_is_prime_iffₓ'. -/
@[simp]
theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime :=
@@ -180,7 +172,7 @@ theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime :=
lean 3 declaration is
forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.linearOrderedCommMonoidWithZero.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) p)) (Nat.Prime p))))
but is expected to have type
- forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} p)) (Nat.Prime p))))
+ forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.instLinearOrderedCommMonoidWithZeroCardinal.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} p)) (Nat.Prime p))))
Case conversion may be inaccurate. Consider using '#align cardinal.is_prime_iff Cardinal.is_prime_iffₓ'. -/
theorem is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ, a = p ∧ p.Prime :=
by
@@ -194,7 +186,7 @@ theorem is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ,
lean 3 declaration is
forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.linearOrderedCommMonoidWithZero.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
but is expected to have type
- forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
+ forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.instLinearOrderedCommMonoidWithZeroCardinal.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
Case conversion may be inaccurate. Consider using '#align cardinal.is_prime_pow_iff Cardinal.isPrimePow_iffₓ'. -/
theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/d95bef0d215ea58c0fd7bbc4b151bf3fe952c095
@@ -88,7 +88,12 @@ theorem dvd_of_le_of_aleph0_le (ha : a ≠ 0) (h : a ≤ b) (hb : ℵ₀ ≤ b)
#align cardinal.dvd_of_le_of_aleph_0_le Cardinal.dvd_of_le_of_aleph0_le
-/
-#print Cardinal.prime_of_aleph0_le /-
+/- warning: cardinal.prime_of_aleph_0_le -> Cardinal.prime_of_aleph0_le is a dubious translation:
+lean 3 declaration is
+ forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) -> (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.linearOrderedCommMonoidWithZero.{u1}) a)
+but is expected to have type
+ forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) -> (Prime.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) a)
+Case conversion may be inaccurate. Consider using '#align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_leₓ'. -/
@[simp]
theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a :=
by
@@ -105,7 +110,6 @@ theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a :=
have habc := le_of_dvd hz hbc
rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc
#align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_le
--/
/- warning: cardinal.not_irreducible_of_aleph_0_le -> Cardinal.not_irreducible_of_aleph0_le is a dubious translation:
lean 3 declaration is
@@ -143,7 +147,7 @@ theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m :=
/- warning: cardinal.nat_is_prime_iff -> Cardinal.nat_is_prime_iff is a dubious translation:
lean 3 declaration is
- forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (Nat.Prime n)
+ forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.linearOrderedCommMonoidWithZero.{u1}) ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (Nat.Prime n)
but is expected to have type
forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (Nat.Prime n)
Case conversion may be inaccurate. Consider using '#align cardinal.nat_is_prime_iff Cardinal.nat_is_prime_iffₓ'. -/
@@ -174,7 +178,7 @@ theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime :=
/- warning: cardinal.is_prime_iff -> Cardinal.is_prime_iff is a dubious translation:
lean 3 declaration is
- forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) p)) (Nat.Prime p))))
+ forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.linearOrderedCommMonoidWithZero.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) p)) (Nat.Prime p))))
but is expected to have type
forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} p)) (Nat.Prime p))))
Case conversion may be inaccurate. Consider using '#align cardinal.is_prime_iff Cardinal.is_prime_iffₓ'. -/
@@ -188,7 +192,7 @@ theorem is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ,
/- warning: cardinal.is_prime_pow_iff -> Cardinal.isPrimePow_iff is a dubious translation:
lean 3 declaration is
- forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
+ forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.linearOrderedCommMonoidWithZero.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
but is expected to have type
forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
Case conversion may be inaccurate. Consider using '#align cardinal.is_prime_pow_iff Cardinal.isPrimePow_iffₓ'. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -65,7 +65,7 @@ theorem isUnit_iff : IsUnit a ↔ a = 1 :=
· exact ht.1
all_goals rwa [one_le_iff_ne_zero]
· rintro rfl
- rw [mul_zero] at ht
+ rw [MulZeroClass.mul_zero] at ht
exact zero_ne_one ht
#align cardinal.is_unit_iff Cardinal.isUnit_iff
@@ -77,8 +77,8 @@ instance : Unique Cardinal.{u}ˣ where
theorem le_of_dvd : ∀ {a b : Cardinal}, b ≠ 0 → a ∣ b → a ≤ b
| a, _, b0, ⟨b, rfl⟩ => by
simpa only [mul_one] using
- mul_le_mul_left' (one_le_iff_ne_zero.2 fun h : b = 0 => by simpa only [h, mul_zero] using b0)
- a
+ mul_le_mul_left'
+ (one_le_iff_ne_zero.2 fun h : b = 0 => by simpa only [h, MulZeroClass.mul_zero] using b0) a
#align cardinal.le_of_dvd Cardinal.le_of_dvd
-/
@@ -135,7 +135,8 @@ theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m :=
have : ↑m < ℵ₀ := nat_lt_aleph_0 m
rw [hk, mul_lt_aleph_0_iff] at this
rcases this with (h | h | ⟨-, hk'⟩)
- iterate 2 simp only [h, mul_zero, zero_mul, Nat.cast_eq_zero] at hk; simp [hk]
+ iterate 2 simp only [h, MulZeroClass.mul_zero, MulZeroClass.zero_mul, Nat.cast_eq_zero] at hk;
+ simp [hk]
lift k to ℕ using hk'
exact ⟨k, by exact_mod_cast hk⟩
#align cardinal.nat_coe_dvd_iff Cardinal.nat_coe_dvd_iff
mathlib commit https://github.com/leanprover-community/mathlib/commit/195fcd60ff2bfe392543bceb0ec2adcdb472db4c
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Rodriguez
! This file was ported from Lean 3 source module set_theory.cardinal.divisibility
-! leanprover-community/mathlib commit 92ca63f0fb391a9ca5f22d2409a6080e786d99f7
+! leanprover-community/mathlib commit ee05e9ce1322178f0c12004eb93c00d2c8c00ed2
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -14,6 +14,9 @@ import Mathbin.SetTheory.Cardinal.Ordinal
/-!
# Cardinal Divisibility
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
We show basic results about divisibility in the cardinal numbers. This relation can be characterised
in the following simple way: if `a` and `b` are both less than `ℵ₀`, then `a ∣ b` iff they are
divisible as natural numbers. If `b` is greater than `ℵ₀`, then `a ∣ b` iff `a ≤ b`. This
mathlib commit https://github.com/leanprover-community/mathlib/commit/22131150f88a2d125713ffa0f4693e3355b1eb49
@@ -41,6 +41,12 @@ universe u
variable {a b : Cardinal.{u}} {n m : ℕ}
+/- warning: cardinal.is_unit_iff -> Cardinal.isUnit_iff is a dubious translation:
+lean 3 declaration is
+ forall {a : Cardinal.{u1}}, Iff (IsUnit.{succ u1} Cardinal.{u1} (MonoidWithZero.toMonoid.{succ u1} Cardinal.{u1} (Semiring.toMonoidWithZero.{succ u1} Cardinal.{u1} (OrderedSemiring.toSemiring.{succ u1} Cardinal.{u1} (OrderedCommSemiring.toOrderedSemiring.{succ u1} Cardinal.{u1} (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{succ u1} Cardinal.{u1} Cardinal.canonicallyOrderedCommSemiring.{u1}))))) a) (Eq.{succ (succ u1)} Cardinal.{u1} a (OfNat.ofNat.{succ u1} Cardinal.{u1} 1 (OfNat.mk.{succ u1} Cardinal.{u1} 1 (One.one.{succ u1} Cardinal.{u1} Cardinal.hasOne.{u1}))))
+but is expected to have type
+ forall {a : Cardinal.{u1}}, Iff (IsUnit.{succ u1} Cardinal.{u1} (MonoidWithZero.toMonoid.{succ u1} Cardinal.{u1} (Semiring.toMonoidWithZero.{succ u1} Cardinal.{u1} (OrderedSemiring.toSemiring.{succ u1} Cardinal.{u1} (OrderedCommSemiring.toOrderedSemiring.{succ u1} Cardinal.{u1} (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{succ u1} Cardinal.{u1} Cardinal.instCanonicallyOrderedCommSemiringCardinal.{u1}))))) a) (Eq.{succ (succ u1)} Cardinal.{u1} a (OfNat.ofNat.{succ u1} Cardinal.{u1} 1 (One.toOfNat1.{succ u1} Cardinal.{u1} Cardinal.instOneCardinal.{u1})))
+Case conversion may be inaccurate. Consider using '#align cardinal.is_unit_iff Cardinal.isUnit_iffₓ'. -/
@[simp]
theorem isUnit_iff : IsUnit a ↔ a = 1 :=
by
@@ -64,17 +70,22 @@ instance : Unique Cardinal.{u}ˣ where
default := 1
uniq a := Units.val_eq_one.mp <| isUnit_iff.mp a.IsUnit
+#print Cardinal.le_of_dvd /-
theorem le_of_dvd : ∀ {a b : Cardinal}, b ≠ 0 → a ∣ b → a ≤ b
| a, _, b0, ⟨b, rfl⟩ => by
simpa only [mul_one] using
mul_le_mul_left' (one_le_iff_ne_zero.2 fun h : b = 0 => by simpa only [h, mul_zero] using b0)
a
#align cardinal.le_of_dvd Cardinal.le_of_dvd
+-/
+#print Cardinal.dvd_of_le_of_aleph0_le /-
theorem dvd_of_le_of_aleph0_le (ha : a ≠ 0) (h : a ≤ b) (hb : ℵ₀ ≤ b) : a ∣ b :=
⟨b, (mul_eq_right hb h ha).symm⟩
#align cardinal.dvd_of_le_of_aleph_0_le Cardinal.dvd_of_le_of_aleph0_le
+-/
+#print Cardinal.prime_of_aleph0_le /-
@[simp]
theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a :=
by
@@ -91,7 +102,14 @@ theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a :=
have habc := le_of_dvd hz hbc
rwa [mul_eq_max' <| ha.trans <| habc, max_def', if_pos h] at hbc
#align cardinal.prime_of_aleph_0_le Cardinal.prime_of_aleph0_le
+-/
+/- warning: cardinal.not_irreducible_of_aleph_0_le -> Cardinal.not_irreducible_of_aleph0_le is a dubious translation:
+lean 3 declaration is
+ forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) -> (Not (Irreducible.{succ u1} Cardinal.{u1} (MonoidWithZero.toMonoid.{succ u1} Cardinal.{u1} (Semiring.toMonoidWithZero.{succ u1} Cardinal.{u1} (OrderedSemiring.toSemiring.{succ u1} Cardinal.{u1} (OrderedCommSemiring.toOrderedSemiring.{succ u1} Cardinal.{u1} (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{succ u1} Cardinal.{u1} Cardinal.canonicallyOrderedCommSemiring.{u1}))))) a))
+but is expected to have type
+ forall {a : Cardinal.{u1}}, (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) -> (Not (Irreducible.{succ u1} Cardinal.{u1} (MonoidWithZero.toMonoid.{succ u1} Cardinal.{u1} (Semiring.toMonoidWithZero.{succ u1} Cardinal.{u1} (OrderedSemiring.toSemiring.{succ u1} Cardinal.{u1} (OrderedCommSemiring.toOrderedSemiring.{succ u1} Cardinal.{u1} (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{succ u1} Cardinal.{u1} Cardinal.instCanonicallyOrderedCommSemiringCardinal.{u1}))))) a))
+Case conversion may be inaccurate. Consider using '#align cardinal.not_irreducible_of_aleph_0_le Cardinal.not_irreducible_of_aleph0_leₓ'. -/
theorem not_irreducible_of_aleph0_le (ha : ℵ₀ ≤ a) : ¬Irreducible a :=
by
rw [irreducible_iff, not_and_or]
@@ -100,6 +118,12 @@ theorem not_irreducible_of_aleph0_le (ha : ℵ₀ ≤ a) : ¬Irreducible a :=
h a ℵ₀
#align cardinal.not_irreducible_of_aleph_0_le Cardinal.not_irreducible_of_aleph0_le
+/- warning: cardinal.nat_coe_dvd_iff -> Cardinal.nat_coe_dvd_iff is a dubious translation:
+lean 3 declaration is
+ forall {n : Nat} {m : Nat}, Iff (Dvd.Dvd.{succ u1} Cardinal.{u1} (semigroupDvd.{succ u1} Cardinal.{u1} (SemigroupWithZero.toSemigroup.{succ u1} Cardinal.{u1} (NonUnitalSemiring.toSemigroupWithZero.{succ u1} Cardinal.{u1} (NonUnitalCommSemiring.toNonUnitalSemiring.{succ u1} Cardinal.{u1} (CommSemiring.toNonUnitalCommSemiring.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}))))) ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n) ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) m)) (Dvd.Dvd.{0} Nat Nat.hasDvd n m)
+but is expected to have type
+ forall {n : Nat} {m : Nat}, Iff (Dvd.dvd.{succ u1} Cardinal.{u1} (semigroupDvd.{succ u1} Cardinal.{u1} (SemigroupWithZero.toSemigroup.{succ u1} Cardinal.{u1} (NonUnitalSemiring.toSemigroupWithZero.{succ u1} Cardinal.{u1} (NonUnitalCommSemiring.toNonUnitalSemiring.{succ u1} Cardinal.{u1} (CommSemiring.toNonUnitalCommSemiring.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}))))) (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n) (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} m)) (Dvd.dvd.{0} Nat Nat.instDvdNat n m)
+Case conversion may be inaccurate. Consider using '#align cardinal.nat_coe_dvd_iff Cardinal.nat_coe_dvd_iffₓ'. -/
@[simp, norm_cast]
theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m :=
by
@@ -113,6 +137,12 @@ theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m :=
exact ⟨k, by exact_mod_cast hk⟩
#align cardinal.nat_coe_dvd_iff Cardinal.nat_coe_dvd_iff
+/- warning: cardinal.nat_is_prime_iff -> Cardinal.nat_is_prime_iff is a dubious translation:
+lean 3 declaration is
+ forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (Nat.Prime n)
+but is expected to have type
+ forall {n : Nat}, Iff (Prime.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (Nat.Prime n)
+Case conversion may be inaccurate. Consider using '#align cardinal.nat_is_prime_iff Cardinal.nat_is_prime_iffₓ'. -/
@[simp]
theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime :=
by
@@ -138,6 +168,12 @@ theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime :=
exact Or.inl (dvd_of_le_of_aleph_0_le hn ((nat_lt_aleph_0 n).le.trans hℵ₀b) hℵ₀b)
#align cardinal.nat_is_prime_iff Cardinal.nat_is_prime_iff
+/- warning: cardinal.is_prime_iff -> Cardinal.is_prime_iff is a dubious translation:
+lean 3 declaration is
+ forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) p)) (Nat.Prime p))))
+but is expected to have type
+ forall {a : Cardinal.{u1}}, Iff (Prime.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (p : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} p)) (Nat.Prime p))))
+Case conversion may be inaccurate. Consider using '#align cardinal.is_prime_iff Cardinal.is_prime_iffₓ'. -/
theorem is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ, a = p ∧ p.Prime :=
by
cases' le_or_lt ℵ₀ a with h h
@@ -146,6 +182,12 @@ theorem is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ,
simp [not_le.mpr h]
#align cardinal.is_prime_iff Cardinal.is_prime_iff
+/- warning: cardinal.is_prime_pow_iff -> Cardinal.isPrimePow_iff is a dubious translation:
+lean 3 declaration is
+ forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.hasLe.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a ((fun (a : Type) (b : Type.{succ u1}) [self : HasLiftT.{1, succ (succ u1)} a b] => self.0) Nat Cardinal.{u1} (HasLiftT.mk.{1, succ (succ u1)} Nat Cardinal.{u1} (CoeTCₓ.coe.{1, succ (succ u1)} Nat Cardinal.{u1} (Nat.castCoe.{succ u1} Cardinal.{u1} Cardinal.hasNatCast.{u1}))) n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
+but is expected to have type
+ forall {a : Cardinal.{u1}}, Iff (IsPrimePow.{succ u1} Cardinal.{u1} (CommSemiring.toCommMonoidWithZero.{succ u1} Cardinal.{u1} Cardinal.commSemiring.{u1}) a) (Or (LE.le.{succ u1} Cardinal.{u1} Cardinal.instLECardinal.{u1} Cardinal.aleph0.{u1} a) (Exists.{1} Nat (fun (n : Nat) => And (Eq.{succ (succ u1)} Cardinal.{u1} a (Nat.cast.{succ u1} Cardinal.{u1} Cardinal.instNatCastCardinal.{u1} n)) (IsPrimePow.{0} Nat (LinearOrderedCommMonoidWithZero.toCommMonoidWithZero.{0} Nat Nat.linearOrderedCommMonoidWithZero) n))))
+Case conversion may be inaccurate. Consider using '#align cardinal.is_prime_pow_iff Cardinal.isPrimePow_iffₓ'. -/
theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n : ℕ, a = n ∧ IsPrimePow n :=
by
by_cases h : ℵ₀ ≤ a
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
@@ -80,7 +80,8 @@ theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a := by
rcases eq_or_ne (b * c) 0 with hz | hz
· rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp
wlog h : c ≤ b
- · cases le_total c b <;> [skip; rw [or_comm]] <;> apply_assumption
+ · cases le_total c b <;> [solve_by_elim; rw [or_comm]]
+ apply_assumption
assumption'
all_goals rwa [mul_comm]
left
cases'
(#9171)
I literally went through and regex'd some uses of cases'
, replacing them with rcases
; this is meant to be a low effort PR as I hope that tools can do this in the future.
rcases
is an easier replacement than cases
, though with better tools we could in future do a second pass converting simple rcases
added here (and existing ones) to cases
.
@@ -77,7 +77,7 @@ theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a := by
refine' ⟨(aleph0_pos.trans_le ha).ne', _, fun b c hbc => _⟩
· rw [isUnit_iff]
exact (one_lt_aleph0.trans_le ha).ne'
- cases' eq_or_ne (b * c) 0 with hz hz
+ rcases eq_or_ne (b * c) 0 with hz | hz
· rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp
wlog h : c ≤ b
· cases le_total c b <;> [skip; rw [or_comm]] <;> apply_assumption
@@ -134,7 +134,7 @@ theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime := by
#align cardinal.nat_is_prime_iff Cardinal.nat_is_prime_iff
theorem is_prime_iff {a : Cardinal} : Prime a ↔ ℵ₀ ≤ a ∨ ∃ p : ℕ, a = p ∧ p.Prime := by
- cases' le_or_lt ℵ₀ a with h h
+ rcases le_or_lt ℵ₀ a with h | h
· simp [h]
lift a to ℕ using id h
simp [not_le.mpr h]
@@ -151,7 +151,7 @@ theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n
⟨p, k, nat_is_prime_iff.2 hp, hk, by rw [han]; exact mod_cast h⟩⟩
rintro ⟨p, k, hp, hk, hpk⟩
have key : p ^ (1 : Cardinal) ≤ ↑a := by
- rw [←hpk]; apply power_le_power_left hp.ne_zero; exact mod_cast hk
+ rw [← hpk]; apply power_le_power_left hp.ne_zero; exact mod_cast hk
rw [power_one] at key
lift p to ℕ using key.trans_lt (nat_lt_aleph0 a)
exact ⟨a, rfl, p, k, nat_is_prime_iff.mp hp, hk, mod_cast hpk⟩
exact_mod_cast
tactic with mod_cast
elaborator where possible (#8404)
We still have the exact_mod_cast
tactic, used in a few places, which somehow (?) works a little bit harder to prevent the expected type influencing the elaboration of the term. I would like to get to the bottom of this, and it will be easier once the only usages of exact_mod_cast
are the ones that don't work using the term elaborator by itself.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -97,14 +97,14 @@ theorem not_irreducible_of_aleph0_le (ha : ℵ₀ ≤ a) : ¬Irreducible a := by
@[simp, norm_cast]
theorem nat_coe_dvd_iff : (n : Cardinal) ∣ m ↔ n ∣ m := by
- refine' ⟨_, fun ⟨h, ht⟩ => ⟨h, by exact_mod_cast ht⟩⟩
+ refine' ⟨_, fun ⟨h, ht⟩ => ⟨h, mod_cast ht⟩⟩
rintro ⟨k, hk⟩
have : ↑m < ℵ₀ := nat_lt_aleph0 m
rw [hk, mul_lt_aleph0_iff] at this
rcases this with (h | h | ⟨-, hk'⟩)
iterate 2 simp only [h, mul_zero, zero_mul, Nat.cast_eq_zero] at hk; simp [hk]
lift k to ℕ using hk'
- exact ⟨k, by exact_mod_cast hk⟩
+ exact ⟨k, mod_cast hk⟩
#align cardinal.nat_coe_dvd_iff Cardinal.nat_coe_dvd_iff
@[simp]
@@ -112,15 +112,15 @@ theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime := by
simp only [Prime, Nat.prime_iff]
refine' and_congr (by simp) (and_congr _ ⟨fun h b c hbc => _, fun h b c hbc => _⟩)
· simp only [isUnit_iff, Nat.isUnit_iff]
- exact_mod_cast Iff.rfl
- · exact_mod_cast h b c (by exact_mod_cast hbc)
+ exact mod_cast Iff.rfl
+ · exact mod_cast h b c (mod_cast hbc)
cases' lt_or_le (b * c) ℵ₀ with h' h'
· rcases mul_lt_aleph0_iff.mp h' with (rfl | rfl | ⟨hb, hc⟩)
· simp
· simp
lift b to ℕ using hb
lift c to ℕ using hc
- exact_mod_cast h b c (by exact_mod_cast hbc)
+ exact mod_cast h b c (mod_cast hbc)
rcases aleph0_le_mul_iff.mp h' with ⟨hb, hc, hℵ₀⟩
have hn : (n : Cardinal) ≠ 0 := by
intro h
@@ -148,13 +148,13 @@ theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n
rw [isPrimePow_def]
refine'
⟨_, fun ⟨n, han, p, k, hp, hk, h⟩ =>
- ⟨p, k, nat_is_prime_iff.2 hp, hk, by rw [han]; exact_mod_cast h⟩⟩
+ ⟨p, k, nat_is_prime_iff.2 hp, hk, by rw [han]; exact mod_cast h⟩⟩
rintro ⟨p, k, hp, hk, hpk⟩
have key : p ^ (1 : Cardinal) ≤ ↑a := by
- rw [←hpk]; apply power_le_power_left hp.ne_zero; exact_mod_cast hk
+ rw [←hpk]; apply power_le_power_left hp.ne_zero; exact mod_cast hk
rw [power_one] at key
lift p to ℕ using key.trans_lt (nat_lt_aleph0 a)
- exact ⟨a, rfl, p, k, nat_is_prime_iff.mp hp, hk, by exact_mod_cast hpk⟩
+ exact ⟨a, rfl, p, k, nat_is_prime_iff.mp hp, hk, mod_cast hpk⟩
#align cardinal.is_prime_pow_iff Cardinal.isPrimePow_iff
end Cardinal
This is the supremum of
along with some minor fixes from failures on nightly-testing as Mathlib master
is merged into it.
Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.
I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0
branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.
In particular this includes adjustments for the Lean PRs
We can get rid of all the
local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)
macros across Mathlib (and in any projects that want to write natural number powers of reals).
Changes the default behaviour of simp
to (config := {decide := false})
. This makes simp
(and consequentially norm_num
) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp
or norm_num
to decide
or rfl
, or adding (config := {decide := true})
.
This changed the behaviour of simp
so that simp [f]
will only unfold "fully applied" occurrences of f
. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true })
. We may in future add a syntax for this, e.g. simp [!f]
; please provide feedback! In the meantime, we have made the following changes:
(config := { unfoldPartialApp := true })
in some places, to recover the old behaviour@[eqns]
to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp
and Function.flip
.This change in Lean may require further changes down the line (e.g. adding the !f
syntax, and/or upstreaming the special treatment for Function.comp
and Function.flip
, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!
Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>
@@ -150,7 +150,8 @@ theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n
⟨_, fun ⟨n, han, p, k, hp, hk, h⟩ =>
⟨p, k, nat_is_prime_iff.2 hp, hk, by rw [han]; exact_mod_cast h⟩⟩
rintro ⟨p, k, hp, hk, hpk⟩
- have key : p ^ 1 ≤ ↑a := by rw [←hpk]; apply power_le_power_left hp.ne_zero; exact_mod_cast hk
+ have key : p ^ (1 : Cardinal) ≤ ↑a := by
+ rw [←hpk]; apply power_le_power_left hp.ne_zero; exact_mod_cast hk
rw [power_one] at key
lift p to ℕ using key.trans_lt (nat_lt_aleph0 a)
exact ⟨a, rfl, p, k, nat_is_prime_iff.mp hp, hk, by exact_mod_cast hpk⟩
@@ -2,16 +2,13 @@
Copyright (c) 2022 Eric Rodriguez. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Rodriguez
-
-! This file was ported from Lean 3 source module set_theory.cardinal.divisibility
-! leanprover-community/mathlib commit ea050b44c0f9aba9d16a948c7cc7d2e7c8493567
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Algebra.IsPrimePow
import Mathlib.SetTheory.Cardinal.Ordinal
import Mathlib.Tactic.WLOG
+#align_import set_theory.cardinal.divisibility from "leanprover-community/mathlib"@"ea050b44c0f9aba9d16a948c7cc7d2e7c8493567"
+
/-!
# Cardinal Divisibility
The main breaking change is that tac <;> [t1, t2]
is now written tac <;> [t1; t2]
, to avoid clashing with tactics like cases
and use
that take comma-separated lists.
@@ -83,7 +83,7 @@ theorem prime_of_aleph0_le (ha : ℵ₀ ≤ a) : Prime a := by
cases' eq_or_ne (b * c) 0 with hz hz
· rcases mul_eq_zero.mp hz with (rfl | rfl) <;> simp
wlog h : c ≤ b
- · cases le_total c b <;> [skip, rw [or_comm]] <;> apply_assumption
+ · cases le_total c b <;> [skip; rw [or_comm]] <;> apply_assumption
assumption'
all_goals rwa [mul_comm]
left
Mathlib 3: https://github.com/leanprover-community/mathlib/pull/18714
Co-authored-by: Scott Morrison <scott@tqft.net>
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Rodriguez
! This file was ported from Lean 3 source module set_theory.cardinal.divisibility
-! leanprover-community/mathlib commit 92ca63f0fb391a9ca5f22d2409a6080e786d99f7
+! leanprover-community/mathlib commit ea050b44c0f9aba9d16a948c7cc7d2e7c8493567
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
vscode is already configured by .vscode/settings.json
to trim these on save. It's not clear how they've managed to stick around.
By doing this all in one PR now, it avoids getting random whitespace diffs in PRs later.
This was done with a regex search in vscode,
@@ -132,7 +132,7 @@ theorem nat_is_prime_iff : Prime (n : Cardinal) ↔ n.Prime := by
wlog hℵ₀b : ℵ₀ ≤ b
refine' (this h c b _ _ hc hb hℵ₀.symm hn (hℵ₀.resolve_left hℵ₀b)).symm <;> try assumption
rwa [mul_comm] at hbc
- rwa [mul_comm] at h'
+ rwa [mul_comm] at h'
exact Or.inl (dvd_of_le_of_aleph0_le hn ((nat_lt_aleph0 n).le.trans hℵ₀b) hℵ₀b)
#align cardinal.nat_is_prime_iff Cardinal.nat_is_prime_iff
@@ -160,4 +160,3 @@ theorem isPrimePow_iff {a : Cardinal} : IsPrimePow a ↔ ℵ₀ ≤ a ∨ ∃ n
#align cardinal.is_prime_pow_iff Cardinal.isPrimePow_iff
end Cardinal
-
The unported dependencies are