Skip to content

feat(FieldTheory): implement Artin-Schreier theorem - #41911

Open
kedlaya wants to merge 6 commits into
leanprover-community:masterfrom
kedlaya:artin-schreier
Open

kedlaya wants to merge 6 commits into
leanprover-community:masterfrom
kedlaya:artin-schreier

Conversation

@kedlaya

@kedlaya kedlaya commented Jul 19, 2026

Copy link
Copy Markdown

Implement the theorem of Artin-Schreier that a field with a finite algebraically closed extension is either algebraically closed or real closed. Depends on Artin-Schreier extensions of fields of characteristic p (#43947).

@github-actions github-actions Bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Jul 19, 2026
@github-actions

Copy link
Copy Markdown

Welcome new contributor!

Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests.

We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the awaiting-author tag, or another reason described in the Lifecycle of a PR. The review dashboard has a dedicated webpage which shows whether your PR is on the review queue, and (if not), why.

If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR.

Thank you again for joining our community.

@github-actions

github-actions Bot commented Jul 19, 2026

Copy link
Copy Markdown

PR summary 2fecd40b78

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.FieldTheory.ArtinSchreierExtension (new file) 2002
Mathlib.FieldTheory.IsRealClosed.ArtinSchreier (new file) 2740

Declarations diff (regex)

+ artinSchreierPoly_irreducible
+ artinSchreierPoly_irreducible_or_splits
+ artinSchreierPoly_isMonicOfDegree
+ artinSchreierPoly_splits
+ artinSchreierPoly_taylor
+ cyclic_charP_as_param
+ cyclic_charP_splitting
+ dvd_natDegree_of_monic_of_irreducible
+ exists_root_of_natDegree_eq_one
+ exists_root_or_all_irreducible_divisors
+ exists_root_or_all_irreducible_divisors'
+ irreducible_artinSchreierPoly_tower
+ irreducible_of_natDegree_eq_one
+ isAlgClosed_of_isSquare_neg_one
+ isAlgClosed_or_isRealClosed
+ isCyclic_charP_tfae
+ isRealClosed_of_isAlgClosed_adjoin
+ isSquare_mul_add_or_isSquare_neg
+ not_charP_of_finrank
+ perfect_of_finite_dimensional_algebraic_closure
+ prime_of_natDegree_eq_one

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit 2fecd40).

  • +14 new declarations
  • −0 removed declarations
+IsAlgClosure.congr_simp
+Polynomial.dvd_natDegree_of_monic_of_irreducible
+Polynomial.exists_root_of_natDegree_eq_one
+Polynomial.irreducible_of_natDegree_eq_one
+Polynomial.prime_of_natDegree_eq_one
+artinSchreierPoly_irreducible
+artinSchreierPoly_irreducible_or_splits
+artinSchreierPoly_isMonicOfDegree
+artinSchreierPoly_splits
+artinSchreierPoly_taylor
+cyclic_charP_splitting
+irreducible_artinSchreierPoly_tower
+isAlgClosed_or_isRealClosed
+isCyclic_charP_tfae

No changes to strong technical debt.

Increase in weak tech debt: (relative, absolute) = (1.00, 0.00)
Current number Change Type (weak)
exposed public sections 5074 1

Current commit 2fecd40b78
Reference commit 065356127b

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.py pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions Bot added the t-algebra Algebra (groups, rings, fields, etc) label Jul 19, 2026
@SnirBroshi

Copy link
Copy Markdown
Collaborator

Hello, can you disclose any AI usage per the contribution guidelines (linked above)?

@kedlaya

kedlaya commented Jul 19, 2026

Copy link
Copy Markdown
Author

Hello, can you disclose any AI usage per the contribution guidelines (linked above)?

none

Comment thread Mathlib/Algebra/Polynomial/FieldDivision.lean Outdated
Comment thread Mathlib/FieldTheory/IsRealClosed/ArtinSchreier.lean Outdated
Comment thread Mathlib/FieldTheory/IsRealClosed/ArtinSchreier.lean Outdated
Comment thread Mathlib/FieldTheory/IsRealClosed/ArtinSchreier.lean Outdated
Comment thread Mathlib/FieldTheory/IsRealClosed/ArtinSchreier.lean Outdated
Comment thread Mathlib/FieldTheory/IsRealClosed/ArtinSchreier.lean Outdated
Comment thread Mathlib/FieldTheory/IsRealClosed/ArtinSchreier.lean Outdated

@ScottCarnahan ScottCarnahan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These results would make a fine addition to mathlib. My main suggestion is to look over the mathlib naming conventions page.

/- If a field admits an algebraically closed extension of degree dividing a prime `p`, any
polynomial either has a root or has all irreducible divisors of degree `p` and degree
divisible by `p`. -/
lemma divisor_by_finrank {p : ℕ} (f : F[X]) (hr : finrank F K ∣ p) (hp : p.Prime) :

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lemma divisor_by_finrank {p : ℕ} (f : F[X]) (hr : finrank F K ∣ p) (hp : p.Prime) :
lemma exists_root_or_all_irreducible_divisors {p : ℕ} (f : F[X]) (hr : finrank F K ∣ p) (hp : p.Prime) :

Feel free to use a name that you prefer, but it should reflect the statement of the lemma somehow.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confess I find these naming conventions an utter mystery, so I mostly followed your suggestions.

Comment on lines +36 to +37
polynomial either has a root or has all irreducible divisors of degree `p` and degree
divisible by `p`. -/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
polynomial either has a root or has all irreducible divisors of degree `p` and degree
divisible by `p`. -/
polynomial either has a root or has all irreducible divisors of degree `p`. -/

have ⟨x, hx⟩ := exists_root_of_natDegree_eq_one h
exact ⟨x, hx.dvd h2⟩

lemma divisor_by_finrank' {p : ℕ} (f : F[X]) (hr : finrank F K ∣ p) (hp : p.Prime) :

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lemma divisor_by_finrank' {p : ℕ} (f : F[X]) (hr : finrank F K ∣ p) (hp : p.Prime) :
lemma exists_root_or_all_irreducible_divisors' {p : ℕ} (f : F[X]) (hr : finrank F K ∣ p) (hp : p.Prime) :

f (fun d _ h1 h2 ↦ (h d h1 h2).symm.dvd))

/- A field admitting a finite extension which is algebraically closed is perfect. -/
lemma finite_alg_closure_perfect [hf : FiniteDimensional F K] : PerfectField F := by

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lemma finite_alg_closure_perfect [hf : FiniteDimensional F K] : PerfectField F := by
lemma perfect_of_finite_dimensional [hf : FiniteDimensional F K] : PerfectField F := by


/- If a field admits an extension of prime degree `p` which is algebraically closed, then
its characteristic cannot equal `p`. -/
lemma finite_alg_closure_prime {p : ℕ} (hp : p.Prime) (hr : finrank F K = p) : ¬CharP F p := by

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lemma finite_alg_closure_prime {p : ℕ} (hp : p.Prime) (hr : finrank F K = p) : ¬CharP F p := by
lemma not_charP_of_finrank {p : ℕ} (hp : p.Prime) (hr : finrank F K = p) : ¬CharP F p := by


/- If `a` and `b` belong to a field which admits an algebraically closed quadratic extension,
then one of `a^2 + b` or `-b` is a square. -/
lemma quadratic_alg_closure (h : finrank F K ∣ 2) (a b : F) :

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lemma quadratic_alg_closure (h : finrank F K ∣ 2) (a b : F) :
lemma isSquare_mul_add_or_isSquare_neg (h : finrank F K ∣ 2) (a b : F) :


/- A field containing a square root of `-1` and admitting a finite extension which is algebraically
closed is itself algebraically closed. -/
lemma finite_alg_closure_i [hf : FiniteDimensional F K] (hm : IsSquare (-1 : F)) :

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lemma finite_alg_closure_i [hf : FiniteDimensional F K] (hm : IsSquare (-1 : F)) :
lemma isAlgClosed_of_isSquare_neg_one [hf : FiniteDimensional F K] (hm : IsSquare (-1 : F)) :

/- A field in which `-1` is not a square, but adjoining its square root gives an algebraic
closure, is real closed. -/
omit Hac in
lemma RealClosed_from_quadratic (h1 : ¬IsSquare (-1 : F)) (h2 : ∃ i : K, i ^ 2 = -1 ∧

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lemma RealClosed_from_quadratic (h1 : ¬IsSquare (-1 : F)) (h2 : ∃ i : K, i ^ 2 = -1
lemma isRealClosed_of_isAlgClosed_adjoin (h1 : ¬IsSquare (-1 : F)) (h2 : ∃ i : K, i ^ 2 = -1

Comment on lines +86 to +87
have h := irreducible_artinSchreierPoly_tower hp rfl a x ha
have h := (degree_eq_iff_natDegree_eq_of_pos one_pos).mp (Hac.degree_eq_one_of_irreducible K h)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
have h := irreducible_artinSchreierPoly_tower hp rfl a x ha
have h := (degree_eq_iff_natDegree_eq_of_pos one_pos).mp (Hac.degree_eq_one_of_irreducible K h)
have h := (degree_eq_iff_natDegree_eq_of_pos one_pos).mp (Hac.degree_eq_one_of_irreducible K (irreducible_artinSchreierPoly_tower hp rfl a x ha)

Comment on lines +207 to +213
have hp1 := hp.one_lt
have := (Algebra.charP_iff F K p).mp ‹CharP F p›
have h := (artinSchreierPoly_irreducible_or_splits _).resolve_left h
have h_a {E} [Field E] (x : E) := artinSchreierPoly_isMonicOfDegree x hp1
have h_a1 := h_a ((algebraMap F K) a * x ^ (p-1))
have hs := (degree_eq_iff_natDegree_eq h_a1.ne_zero).mp.mt (h_a1.1.trans_ne hp.ne_zero)
have hy := eval_rootOfSplits h hs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tried golfing your proof, but it is unusual to need this many haves in succession.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are all used but not all at once, I shuffled things around a bit in the last commit.

@artie2000

artie2000 commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

I've thought a bit about how to formalise this stuff in the past. I'll review shortly. One immediate comment is that I think this would be better as two PRs: one for Artin-Schreier extensions / classification and one for the link to ACFs/RCFs.

@kedlaya

kedlaya commented Sep 18, 2026

Copy link
Copy Markdown
Author

I've thought a bit about how to formalise this stuff in the past. I'll review shortly. One immediate comment is that I think this would be better as two PRs: one for Artin-Schreier extensions / classification and one for the link to ACFs/RCFs.

Fair enough, see #43947 for the former (which I'll make a dependency for this).

Comment on lines +16 to +22

# Artin-Schreier theorem

This file proves the Artin-Schreier theorem `isAlgClosed_or_isRealClosed`:
a field admitting a finite extension which is algebraically closed is either algebraically
closed or real closed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Artin-Schreier theorem
This file proves the Artin-Schreier theorem `isAlgClosed_or_isRealClosed`:
a field admitting a finite extension which is algebraically closed is either algebraically
closed or real closed.
# Artin-Schreier theorem
This file proves the Artin-Schreier theorem `isAlgClosed_or_isRealClosed`:
a field admitting a finite extension which is algebraically closed is either algebraically
closed or real closed.


/- The Artin-Schreier theorem: a field admitting a finite extension which is algebraically closed
is either algebraically closed or real closed. -/
public theorem isAlgClosed_or_isRealClosed (F : Type u) (K : Type u) [Field F] [Field K]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can have this version of the theorem, but I think this should itself be a corollary of the two theorems corresponding to each of the branches. If -1 is a square then F is algebraically closed; if -1 is not a square then F is real closed.

@vihdzp vihdzp Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, is your proof is able to recover the fact that the extension is of degree 1 or 2 in the respective cases?

let n := exponent E K
rcases expChar_is_prime_or_one E p with h | h
· have : PerfectRing E p := by
refine ofSurjective E p (fun b ↦ ?_)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
refine ofSurjective E p (fun b ↦ ?_)
refine ofSurjective E p fun b ↦ ?_

rcases expChar_is_prime_or_one E p with h | h
· have : PerfectRing E p := by
refine ofSurjective E p (fun b ↦ ?_)
obtain ⟨x, hx⟩ := Hac.exists_pow_nat_eq ((algebraMap E K) b) (expChar_pow_pos E p (n + 1))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
obtain ⟨x, hx⟩ := Hac.exists_pow_nat_eq ((algebraMap E K) b) (expChar_pow_pos E p (n + 1))
obtain ⟨x, hx⟩ := Hac.exists_pow_nat_eq (algebraMap E K b) (expChar_pow_pos E p (n + 1))

have : PerfectField E := by
let n := exponent E K
rcases expChar_is_prime_or_one E p with h | h
· have : PerfectRing E p := by

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be a bit clearer to start the proof with suffices PerfectRing E p from toPerfectField E p. Saves you the indent.

@mathlib-dependent-issues mathlib-dependent-issues Bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Sep 20, 2026
@mathlib-dependent-issues

Copy link
Copy Markdown

This PR/issue depends on:

@kedlaya kedlaya changed the title feat(FieldTheory): implement Artin-Schreier extensions, Artin-Schreier theorem feat(FieldTheory): implement Artin-Schreier theorem Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants