field_theory.cardinalityMathlib.FieldTheory.Cardinality

This file has been ported!

Changes since the initial port

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.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Rodriguez
 -/
 import Algebra.Field.ULift
-import Data.MvPolynomial.Cardinal
+import Algebra.MvPolynomial.Cardinal
 import Data.Nat.Factorization.PrimePow
 import Data.Rat.Denumerable
 import FieldTheory.Finite.GaloisField
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2022 Eric Rodriguez. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Rodriguez
 -/
-import Algebra.Field.Ulift
+import Algebra.Field.ULift
 import Data.MvPolynomial.Cardinal
 import Data.Nat.Factorization.PrimePow
 import Data.Rat.Denumerable
Diff
@@ -3,14 +3,14 @@ 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.Field.Ulift
-import Mathbin.Data.MvPolynomial.Cardinal
-import Mathbin.Data.Nat.Factorization.PrimePow
-import Mathbin.Data.Rat.Denumerable
-import Mathbin.FieldTheory.Finite.GaloisField
-import Mathbin.Logic.Equiv.TransferInstance
-import Mathbin.RingTheory.Localization.Cardinality
-import Mathbin.SetTheory.Cardinal.Divisibility
+import Algebra.Field.Ulift
+import Data.MvPolynomial.Cardinal
+import Data.Nat.Factorization.PrimePow
+import Data.Rat.Denumerable
+import FieldTheory.Finite.GaloisField
+import Logic.Equiv.TransferInstance
+import RingTheory.Localization.Cardinality
+import SetTheory.Cardinal.Divisibility
 
 #align_import field_theory.cardinality from "leanprover-community/mathlib"@"1b089e3bdc3ce6b39cd472543474a0a137128c6c"
 
Diff
@@ -2,11 +2,6 @@
 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 field_theory.cardinality
-! leanprover-community/mathlib commit 1b089e3bdc3ce6b39cd472543474a0a137128c6c
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Algebra.Field.Ulift
 import Mathbin.Data.MvPolynomial.Cardinal
@@ -17,6 +12,8 @@ import Mathbin.Logic.Equiv.TransferInstance
 import Mathbin.RingTheory.Localization.Cardinality
 import Mathbin.SetTheory.Cardinal.Divisibility
 
+#align_import field_theory.cardinality from "leanprover-community/mathlib"@"1b089e3bdc3ce6b39cd472543474a0a137128c6c"
+
 /-!
 # Cardinality of Fields
 
Diff
@@ -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 field_theory.cardinality
-! leanprover-community/mathlib commit 0723536a0522d24fc2f159a096fb3304bef77472
+! leanprover-community/mathlib commit 1b089e3bdc3ce6b39cd472543474a0a137128c6c
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -20,6 +20,9 @@ import Mathbin.SetTheory.Cardinal.Divisibility
 /-!
 # Cardinality of Fields
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 In this file we show all the possible cardinalities of fields. All infinite cardinals can harbour
 a field structure, and so can all types with prime power cardinalities, and this is sharp.
 
Diff
@@ -39,6 +39,7 @@ open scoped Cardinal nonZeroDivisors
 
 universe u
 
+#print Fintype.isPrimePow_card_of_field /-
 /-- A finite field has prime power cardinality. -/
 theorem Fintype.isPrimePow_card_of_field {α} [Fintype α] [Field α] : IsPrimePow ‖α‖ :=
   by
@@ -52,7 +53,9 @@ theorem Fintype.isPrimePow_card_of_field {α} [Fintype α] [Field α] : IsPrimeP
   rw [← FiniteDimensional.finrank_eq_card_basis b]
   exact finite_dimensional.finrank_pos.ne'
 #align fintype.is_prime_pow_card_of_field Fintype.isPrimePow_card_of_field
+-/
 
+#print Fintype.nonempty_field_iff /-
 /-- A `fintype` can be given a field structure iff its cardinality is a prime power. -/
 theorem Fintype.nonempty_field_iff {α} [Fintype α] : Nonempty (Field α) ↔ IsPrimePow ‖α‖ :=
   by
@@ -61,12 +64,16 @@ theorem Fintype.nonempty_field_iff {α} [Fintype α] : Nonempty (Field α) ↔ I
   haveI := Fact.mk hp.nat_prime
   exact ⟨(Fintype.equivOfCardEq ((GaloisField.card p n hn.ne').trans hα)).symm.Field⟩
 #align fintype.nonempty_field_iff Fintype.nonempty_field_iff
+-/
 
+#print Fintype.not_isField_of_card_not_prime_pow /-
 theorem Fintype.not_isField_of_card_not_prime_pow {α} [Fintype α] [Ring α] :
     ¬IsPrimePow ‖α‖ → ¬IsField α :=
   mt fun h => Fintype.nonempty_field_iff.mp ⟨h.toField⟩
 #align fintype.not_is_field_of_card_not_prime_pow Fintype.not_isField_of_card_not_prime_pow
+-/
 
+#print Infinite.nonempty_field /-
 /-- Any infinite type can be endowed a field structure. -/
 theorem Infinite.nonempty_field {α : Type u} [Infinite α] : Nonempty (Field α) :=
   by
@@ -81,7 +88,9 @@ theorem Infinite.nonempty_field {α : Type u} [Infinite α] : Nonempty (Field α
     simpa [MvPolynomial.monomial_eq_monomial_iff, Finsupp.single_eq_single_iff] using h
   · simp
 #align infinite.nonempty_field Infinite.nonempty_field
+-/
 
+#print Field.nonempty_iff /-
 /-- There is a field structure on type if and only if its cardinality is a prime power. -/
 theorem Field.nonempty_iff {α : Type u} : Nonempty (Field α) ↔ IsPrimePow (#α) :=
   by
@@ -92,4 +101,5 @@ theorem Field.nonempty_iff {α : Type u} : Nonempty (Field α) ↔ IsPrimePow (#
       (Cardinal.nat_lt_aleph0 _).not_le, false_or_iff] using Fintype.nonempty_field_iff
   · simpa only [← Cardinal.infinite_iff, h, true_or_iff, iff_true_iff] using Infinite.nonempty_field
 #align field.nonempty_iff Field.nonempty_iff
+-/
 
Diff
@@ -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 field_theory.cardinality
-! leanprover-community/mathlib commit 13e18cfa070ea337ea960176414f5ae3a1534aae
+! leanprover-community/mathlib commit 0723536a0522d24fc2f159a096fb3304bef77472
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -42,8 +42,10 @@ universe u
 /-- A finite field has prime power cardinality. -/
 theorem Fintype.isPrimePow_card_of_field {α} [Fintype α] [Field α] : IsPrimePow ‖α‖ :=
   by
+  -- TODO: `algebra` version of `char_p.exists`, of type `Σ p, algebra (zmod p) α`
   cases' CharP.exists α with p _
   haveI hp := Fact.mk (CharP.char_is_prime α p)
+  letI : Algebra (ZMod p) α := ZMod.algebra _ _
   let b := IsNoetherian.finsetBasis (ZMod p) α
   rw [Module.card_fintype b, ZMod.card, isPrimePow_pow_iff]
   · exact hp.1.IsPrimePow
Diff
@@ -33,7 +33,6 @@ a field structure, and so can all types with prime power cardinalities, and this
 -/
 
 
--- mathport name: «expr‖ ‖»
 local notation "‖" x "‖" => Fintype.card x
 
 open scoped Cardinal nonZeroDivisors
Diff
@@ -36,7 +36,7 @@ a field structure, and so can all types with prime power cardinalities, and this
 -- mathport name: «expr‖ ‖»
 local notation "‖" x "‖" => Fintype.card x
 
-open Cardinal nonZeroDivisors
+open scoped Cardinal nonZeroDivisors
 
 universe u
 
Diff
@@ -4,18 +4,18 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Rodriguez
 
 ! This file was ported from Lean 3 source module field_theory.cardinality
-! leanprover-community/mathlib commit c946d6097a6925ad16d7ec55677bbc977f9846de
+! leanprover-community/mathlib commit 13e18cfa070ea337ea960176414f5ae3a1534aae
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
-import Mathbin.Algebra.Ring.Ulift
+import Mathbin.Algebra.Field.Ulift
 import Mathbin.Data.MvPolynomial.Cardinal
+import Mathbin.Data.Nat.Factorization.PrimePow
 import Mathbin.Data.Rat.Denumerable
 import Mathbin.FieldTheory.Finite.GaloisField
 import Mathbin.Logic.Equiv.TransferInstance
 import Mathbin.RingTheory.Localization.Cardinality
 import Mathbin.SetTheory.Cardinal.Divisibility
-import Mathbin.Data.Nat.Factorization.PrimePow
 
 /-!
 # Cardinality of Fields

Changes in mathlib4

mathlib3
mathlib4
move(Polynomial): Move out of Data (#11751)

Polynomial and MvPolynomial are algebraic objects, hence should be under Algebra (or at least not under Data)

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Rodriguez
 -/
 import Mathlib.Algebra.Field.ULift
-import Mathlib.Data.MvPolynomial.Cardinal
+import Mathlib.Algebra.MvPolynomial.Cardinal
 import Mathlib.Data.Nat.Factorization.PrimePow
 import Mathlib.Data.Rat.Denumerable
 import Mathlib.FieldTheory.Finite.GaloisField
chore: removing unneeded maxHeartbeats (#7761)

Due to recent changes in core we can reduce or remove many set_option maxHeartbeats statements.

I have tried to be careful to not leave anything too close to the line, so don't be surprised if some of these can still be reduced further.

This reduces us from 96 maxHeartbeats statements to 44. (There are 10 false positives in meta or testing code.)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -62,7 +62,6 @@ theorem Fintype.not_isField_of_card_not_prime_pow {α} [Fintype α] [Ring α] :
   mt fun h => Fintype.nonempty_field_iff.mp ⟨h.toField⟩
 #align fintype.not_is_field_of_card_not_prime_pow Fintype.not_isField_of_card_not_prime_pow
 
-set_option synthInstance.maxHeartbeats 50000 in
 /-- Any infinite type can be endowed a field structure. -/
 theorem Infinite.nonempty_field {α : Type u} [Infinite α] : Nonempty (Field α) := by
   letI K := FractionRing (MvPolynomial α <| ULift.{u} ℚ)
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,11 +2,6 @@
 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 field_theory.cardinality
-! leanprover-community/mathlib commit 0723536a0522d24fc2f159a096fb3304bef77472
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Algebra.Field.ULift
 import Mathlib.Data.MvPolynomial.Cardinal
@@ -17,6 +12,8 @@ import Mathlib.Logic.Equiv.TransferInstance
 import Mathlib.RingTheory.Localization.Cardinality
 import Mathlib.SetTheory.Cardinal.Divisibility
 
+#align_import field_theory.cardinality from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472"
+
 /-!
 # Cardinality of Fields
 
fix: precedence of # (#5623)
Diff
@@ -69,7 +69,7 @@ set_option synthInstance.maxHeartbeats 50000 in
 /-- Any infinite type can be endowed a field structure. -/
 theorem Infinite.nonempty_field {α : Type u} [Infinite α] : Nonempty (Field α) := by
   letI K := FractionRing (MvPolynomial α <| ULift.{u} ℚ)
-  suffices (#α) = (#K) by
+  suffices #α = #K by
     obtain ⟨e⟩ := Cardinal.eq.1 this
     exact ⟨e.field⟩
   rw [← IsLocalization.card (MvPolynomial α <| ULift.{u} ℚ)⁰ K le_rfl]
@@ -81,7 +81,7 @@ theorem Infinite.nonempty_field {α : Type u} [Infinite α] : Nonempty (Field α
 #align infinite.nonempty_field Infinite.nonempty_field
 
 /-- There is a field structure on type if and only if its cardinality is a prime power. -/
-theorem Field.nonempty_iff {α : Type u} : Nonempty (Field α) ↔ IsPrimePow (#α) := by
+theorem Field.nonempty_iff {α : Type u} : Nonempty (Field α) ↔ IsPrimePow #α := by
   rw [Cardinal.isPrimePow_iff]
   cases' fintypeOrInfinite α with h h
   · simpa only [Cardinal.mk_fintype, Nat.cast_inj, exists_eq_left',
feat: port FieldTheory.Cardinality (#5345)

Dependencies 10 + 705

706 files ported (98.6%)
286545 lines ported (98.8%)
Show graph

The unported dependencies are