Datasets:
Tasks:
Text Generation
Modalities:
Text
Sub-tasks:
language-modeling
Languages:
English
Size:
100K - 1M
License:
File size: 21,335 Bytes
4365a98 fc5e983 4365a98 fc5e983 4365a98 fc5e983 4365a98 fc5e983 4365a98 fc5e983 4365a98 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 |
/-
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen
-/
import field_theory.minpoly
import field_theory.subfield
import field_theory.tower
/-!
# Intermediate fields
Let `L / K` be a field extension, given as an instance `algebra K L`.
This file defines the type of fields in between `K` and `L`, `intermediate_field K L`.
An `intermediate_field K L` is a subfield of `L` which contains (the image of) `K`,
i.e. it is a `subfield L` and a `subalgebra K L`.
## Main definitions
* `intermediate_field K L` : the type of intermediate fields between `K` and `L`.
* `subalgebra.to_intermediate_field`: turns a subalgebra closed under `β»ΒΉ`
into an intermediate field
* `subfield.to_intermediate_field`: turns a subfield containing the image of `K`
into an intermediate field
* `intermediate_field.map`: map an intermediate field along an `alg_hom`
* `intermediate_field.restrict_scalars`: restrict the scalars of an intermediate field to a smaller
field in a tower of fields.
## Implementation notes
Intermediate fields are defined with a structure extending `subfield` and `subalgebra`.
A `subalgebra` is closed under all operations except `β»ΒΉ`,
## Tags
intermediate field, field extension
-/
open finite_dimensional polynomial
open_locale big_operators polynomial
variables (K L : Type*) [field K] [field L] [algebra K L]
/-- `S : intermediate_field K L` is a subset of `L` such that there is a field
tower `L / S / K`. -/
structure intermediate_field extends subalgebra K L :=
(neg_mem' : β x β carrier, -x β carrier)
(inv_mem' : β x β carrier, xβ»ΒΉ β carrier)
/-- Reinterpret an `intermediate_field` as a `subalgebra`. -/
add_decl_doc intermediate_field.to_subalgebra
variables {K L} (S : intermediate_field K L)
namespace intermediate_field
/-- Reinterpret an `intermediate_field` as a `subfield`. -/
def to_subfield : subfield L := { ..S.to_subalgebra, ..S }
instance : set_like (intermediate_field K L) L :=
β¨Ξ» S, S.to_subalgebra.carrier, by { rintros β¨β¨β©β© β¨β¨β©β© β¨hβ©, congr, }β©
instance : subfield_class (intermediate_field K L) L :=
{ add_mem := Ξ» s, s.add_mem',
zero_mem := Ξ» s, s.zero_mem',
neg_mem := neg_mem',
mul_mem := Ξ» s, s.mul_mem',
one_mem := Ξ» s, s.one_mem',
inv_mem := inv_mem' }
@[simp]
lemma mem_carrier {s : intermediate_field K L} {x : L} : x β s.carrier β x β s := iff.rfl
/-- Two intermediate fields are equal if they have the same elements. -/
@[ext] theorem ext {S T : intermediate_field K L} (h : β x, x β S β x β T) : S = T :=
set_like.ext h
@[simp] lemma coe_to_subalgebra : (S.to_subalgebra : set L) = S := rfl
@[simp] lemma coe_to_subfield : (S.to_subfield : set L) = S := rfl
@[simp] lemma mem_mk (s : set L) (hK : β x, algebra_map K L x β s)
(ho hm hz ha hn hi) (x : L) :
x β intermediate_field.mk (subalgebra.mk s ho hm hz ha hK) hn hi β x β s := iff.rfl
@[simp] lemma mem_to_subalgebra (s : intermediate_field K L) (x : L) :
x β s.to_subalgebra β x β s := iff.rfl
@[simp] lemma mem_to_subfield (s : intermediate_field K L) (x : L) :
x β s.to_subfield β x β s := iff.rfl
/-- Copy of an intermediate field with a new `carrier` equal to the old one. Useful to fix
definitional equalities. -/
protected def copy (S : intermediate_field K L) (s : set L) (hs : s = βS) :
intermediate_field K L :=
{ to_subalgebra := S.to_subalgebra.copy s (hs : s = (S.to_subalgebra).carrier),
neg_mem' :=
have hs' : (S.to_subalgebra.copy s hs).carrier = (S.to_subalgebra).carrier := hs,
hs'.symm βΈ S.neg_mem',
inv_mem' :=
have hs' : (S.to_subalgebra.copy s hs).carrier = (S.to_subalgebra).carrier := hs,
hs'.symm βΈ S.inv_mem' }
@[simp] lemma coe_copy (S : intermediate_field K L) (s : set L) (hs : s = βS) :
(S.copy s hs : set L) = s := rfl
lemma copy_eq (S : intermediate_field K L) (s : set L) (hs : s = βS) : S.copy s hs = S :=
set_like.coe_injective hs
section inherited_lemmas
/-! ### Lemmas inherited from more general structures
The declarations in this section derive from the fact that an `intermediate_field` is also a
subalgebra or subfield. Their use should be replaceable with the corresponding lemma from a
subobject class.
-/
/-- An intermediate field contains the image of the smaller field. -/
theorem algebra_map_mem (x : K) : algebra_map K L x β S :=
S.algebra_map_mem' x
/-- An intermediate field is closed under scalar multiplication. -/
theorem smul_mem {y : L} : y β S β β {x : K}, x β’ y β S := S.to_subalgebra.smul_mem
/-- An intermediate field contains the ring's 1. -/
protected theorem one_mem : (1 : L) β S := one_mem S
/-- An intermediate field contains the ring's 0. -/
protected theorem zero_mem : (0 : L) β S := zero_mem S
/-- An intermediate field is closed under multiplication. -/
protected theorem mul_mem {x y : L} : x β S β y β S β x * y β S := mul_mem
/-- An intermediate field is closed under addition. -/
protected theorem add_mem {x y : L} : x β S β y β S β x + y β S := add_mem
/-- An intermediate field is closed under subtraction -/
protected theorem sub_mem {x y : L} : x β S β y β S β x - y β S := sub_mem
/-- An intermediate field is closed under negation. -/
protected theorem neg_mem {x : L} : x β S β -x β S := neg_mem
/-- An intermediate field is closed under inverses. -/
protected theorem inv_mem {x : L} : x β S β xβ»ΒΉ β S := inv_mem
/-- An intermediate field is closed under division. -/
protected theorem div_mem {x y : L} : x β S β y β S β x / y β S := div_mem
/-- Product of a list of elements in an intermediate_field is in the intermediate_field. -/
protected lemma list_prod_mem {l : list L} : (β x β l, x β S) β l.prod β S := list_prod_mem
/-- Sum of a list of elements in an intermediate field is in the intermediate_field. -/
protected lemma list_sum_mem {l : list L} : (β x β l, x β S) β l.sum β S := list_sum_mem
/-- Product of a multiset of elements in an intermediate field is in the intermediate_field. -/
protected lemma multiset_prod_mem (m : multiset L) : (β a β m, a β S) β m.prod β S :=
multiset_prod_mem m
/-- Sum of a multiset of elements in a `intermediate_field` is in the `intermediate_field`. -/
protected lemma multiset_sum_mem (m : multiset L) : (β a β m, a β S) β m.sum β S :=
multiset_sum_mem m
/-- Product of elements of an intermediate field indexed by a `finset` is in the intermediate_field.
-/
protected lemma prod_mem {ΞΉ : Type*} {t : finset ΞΉ} {f : ΞΉ β L} (h : β c β t, f c β S) :
β i in t, f i β S := prod_mem h
/-- Sum of elements in a `intermediate_field` indexed by a `finset` is in the `intermediate_field`.
-/
protected lemma sum_mem {ΞΉ : Type*} {t : finset ΞΉ} {f : ΞΉ β L} (h : β c β t, f c β S) :
β i in t, f i β S := sum_mem h
protected lemma pow_mem {x : L} (hx : x β S) (n : β€) : x^n β S := zpow_mem hx n
protected lemma zsmul_mem {x : L} (hx : x β S) (n : β€) : n β’ x β S := zsmul_mem hx n
protected lemma coe_int_mem (n : β€) : (n : L) β S := coe_int_mem S n
protected lemma coe_add (x y : S) : (β(x + y) : L) = βx + βy := rfl
protected lemma coe_neg (x : S) : (β(-x) : L) = -βx := rfl
protected lemma coe_mul (x y : S) : (β(x * y) : L) = βx * βy := rfl
protected lemma coe_inv (x : S) : (β(xβ»ΒΉ) : L) = (βx)β»ΒΉ := rfl
protected lemma coe_zero : ((0 : S) : L) = 0 := rfl
protected lemma coe_one : ((1 : S) : L) = 1 := rfl
protected lemma coe_pow (x : S) (n : β) : (β(x ^ n) : L) = βx ^ n := submonoid_class.coe_pow x n
end inherited_lemmas
lemma coe_nat_mem (n : β) : (n : L) β S :=
by simpa using coe_int_mem S n
end intermediate_field
/-- Turn a subalgebra closed under inverses into an intermediate field -/
def subalgebra.to_intermediate_field (S : subalgebra K L) (inv_mem : β x β S, xβ»ΒΉ β S) :
intermediate_field K L :=
{ neg_mem' := Ξ» x, S.neg_mem,
inv_mem' := inv_mem,
.. S }
@[simp] lemma to_subalgebra_to_intermediate_field
(S : subalgebra K L) (inv_mem : β x β S, xβ»ΒΉ β S) :
(S.to_intermediate_field inv_mem).to_subalgebra = S :=
by { ext, refl }
@[simp] lemma to_intermediate_field_to_subalgebra (S : intermediate_field K L) :
S.to_subalgebra.to_intermediate_field (Ξ» x, S.inv_mem) = S :=
by { ext, refl }
/-- Turn a subalgebra satisfying `is_field` into an intermediate_field -/
def subalgebra.to_intermediate_field' (S : subalgebra K L) (hS : is_field S) :
intermediate_field K L :=
S.to_intermediate_field $ Ξ» x hx, begin
by_cases hx0 : x = 0,
{ rw [hx0, inv_zero],
exact S.zero_mem },
letI hS' := hS.to_field,
obtain β¨y, hyβ© := hS.mul_inv_cancel (show (β¨x, hxβ© : S) β 0, from subtype.ne_of_val_ne hx0),
rw [subtype.ext_iff, S.coe_mul, S.coe_one, subtype.coe_mk, mul_eq_one_iff_inv_eqβ hx0] at hy,
exact hy.symm βΈ y.2,
end
@[simp] lemma to_subalgebra_to_intermediate_field' (S : subalgebra K L) (hS : is_field S) :
(S.to_intermediate_field' hS).to_subalgebra = S :=
by { ext, refl }
@[simp] lemma to_intermediate_field'_to_subalgebra (S : intermediate_field K L) :
S.to_subalgebra.to_intermediate_field' (field.to_is_field S) = S :=
by { ext, refl }
/-- Turn a subfield of `L` containing the image of `K` into an intermediate field -/
def subfield.to_intermediate_field (S : subfield L)
(algebra_map_mem : β x, algebra_map K L x β S) :
intermediate_field K L :=
{ algebra_map_mem' := algebra_map_mem,
.. S }
namespace intermediate_field
/-- An intermediate field inherits a field structure -/
instance to_field : field S :=
S.to_subfield.to_field
@[simp, norm_cast]
lemma coe_sum {ΞΉ : Type*} [fintype ΞΉ] (f : ΞΉ β S) : (ββ i, f i : L) = β i, (f i : L) :=
begin
classical,
induction finset.univ using finset.induction_on with i s hi H,
{ simp },
{ rw [finset.sum_insert hi, add_mem_class.coe_add, H, finset.sum_insert hi] }
end
@[simp, norm_cast]
lemma coe_prod {ΞΉ : Type*} [fintype ΞΉ] (f : ΞΉ β S) : (ββ i, f i : L) = β i, (f i : L) :=
begin
classical,
induction finset.univ using finset.induction_on with i s hi H,
{ simp },
{ rw [finset.prod_insert hi, mul_mem_class.coe_mul, H, finset.prod_insert hi] }
end
/-! `intermediate_field`s inherit structure from their `subalgebra` coercions. -/
instance module' {R} [semiring R] [has_smul R K] [module R L] [is_scalar_tower R K L] :
module R S :=
S.to_subalgebra.module'
instance module : module K S := S.to_subalgebra.module
instance is_scalar_tower {R} [semiring R] [has_smul R K] [module R L]
[is_scalar_tower R K L] :
is_scalar_tower R K S :=
S.to_subalgebra.is_scalar_tower
@[simp] lemma coe_smul {R} [semiring R] [has_smul R K] [module R L] [is_scalar_tower R K L]
(r : R) (x : S) :
β(r β’ x) = (r β’ x : L) := rfl
instance algebra' {K'} [comm_semiring K'] [has_smul K' K] [algebra K' L]
[is_scalar_tower K' K L] :
algebra K' S :=
S.to_subalgebra.algebra'
instance algebra : algebra K S := S.to_subalgebra.algebra
instance to_algebra {R : Type*} [semiring R] [algebra L R] : algebra S R :=
S.to_subalgebra.to_algebra
instance is_scalar_tower_bot {R : Type*} [semiring R] [algebra L R] :
is_scalar_tower S L R :=
is_scalar_tower.subalgebra _ _ _ S.to_subalgebra
instance is_scalar_tower_mid {R : Type*} [semiring R] [algebra L R] [algebra K R]
[is_scalar_tower K L R] : is_scalar_tower K S R :=
is_scalar_tower.subalgebra' _ _ _ S.to_subalgebra
/-- Specialize `is_scalar_tower_mid` to the common case where the top field is `L` -/
instance is_scalar_tower_mid' : is_scalar_tower K S L :=
S.is_scalar_tower_mid
variables {L' : Type*} [field L'] [algebra K L']
/-- If `f : L β+* L'` fixes `K`, `S.map f` is the intermediate field between `L'` and `K`
such that `x β S β f x β S.map f`. -/
def map (f : L ββ[K] L') (S : intermediate_field K L) : intermediate_field K L' :=
{ inv_mem' := by { rintros _ β¨x, hx, rflβ©, exact β¨xβ»ΒΉ, S.inv_mem hx, f.map_inv xβ© },
neg_mem' := Ξ» x hx, (S.to_subalgebra.map f).neg_mem hx,
.. S.to_subalgebra.map f}
@[simp] lemma coe_map (f : L ββ[K] L') : (S.map f : set L') = f '' S := rfl
lemma map_map {K Lβ Lβ Lβ : Type*} [field K] [field Lβ] [algebra K Lβ]
[field Lβ] [algebra K Lβ] [field Lβ] [algebra K Lβ]
(E : intermediate_field K Lβ) (f : Lβ ββ[K] Lβ) (g : Lβ ββ[K] Lβ) :
(E.map f).map g = E.map (g.comp f) :=
set_like.coe_injective $ set.image_image _ _ _
/-- Given an equivalence `e : L ββ[K] L'` of `K`-field extensions and an intermediate
field `E` of `L/K`, `intermediate_field_equiv_map e E` is the induced equivalence
between `E` and `E.map e` -/
def intermediate_field_map (e : L ββ[K] L') (E : intermediate_field K L) :
E ββ[K] (E.map e.to_alg_hom) :=
e.subalgebra_map E.to_subalgebra
/- We manually add these two simp lemmas because `@[simps]` before `intermediate_field_map`
led to a timeout. -/
@[simp] lemma intermediate_field_map_apply_coe (e : L ββ[K] L') (E : intermediate_field K L)
(a : E) : β(intermediate_field_map e E a) = e a := rfl
@[simp] lemma intermediate_field_map_symm_apply_coe (e : L ββ[K] L') (E : intermediate_field K L)
(a : E.map e.to_alg_hom) : β((intermediate_field_map e E).symm a) = e.symm a := rfl
/-- The embedding from an intermediate field of `L / K` to `L`. -/
def val : S ββ[K] L :=
S.to_subalgebra.val
@[simp] theorem coe_val : βS.val = coe := rfl
@[simp] lemma val_mk {x : L} (hx : x β S) : S.val β¨x, hxβ© = x := rfl
lemma range_val : S.val.range = S.to_subalgebra :=
S.to_subalgebra.range_val
lemma aeval_coe {R : Type*} [comm_ring R] [algebra R K] [algebra R L]
[is_scalar_tower R K L] (x : S) (P : R[X]) : aeval (x : L) P = aeval x P :=
begin
refine polynomial.induction_on' P (Ξ» f g hf hg, _) (Ξ» n r, _),
{ rw [aeval_add, aeval_add, add_mem_class.coe_add, hf, hg] },
{ simp only [mul_mem_class.coe_mul, aeval_monomial, submonoid_class.coe_pow,
mul_eq_mul_right_iff],
left, refl }
end
lemma coe_is_integral_iff {R : Type*} [comm_ring R] [algebra R K] [algebra R L]
[is_scalar_tower R K L] {x : S} : is_integral R (x : L) β _root_.is_integral R x :=
begin
refine β¨Ξ» h, _, Ξ» h, _β©,
{ obtain β¨P, hPmo, hProotβ© := h,
refine β¨P, hPmo, (injective_iff_map_eq_zero _).1 (algebra_map β₯S L).injective _ _β©,
letI : is_scalar_tower R S L := is_scalar_tower.of_algebra_map_eq (congr_fun rfl),
rwa [evalβ_eq_eval_map, β evalβ_at_apply, evalβ_eq_eval_map, polynomial.map_map,
β is_scalar_tower.algebra_map_eq, β evalβ_eq_eval_map] },
{ obtain β¨P, hPmo, hProotβ© := h,
refine β¨P, hPmo, _β©,
rw [β aeval_def, aeval_coe, aeval_def, hProot, add_submonoid_class.coe_zero] },
end
/-- The map `E β F` when `E` is an intermediate field contained in the intermediate field `F`.
This is the intermediate field version of `subalgebra.inclusion`. -/
def inclusion {E F : intermediate_field K L} (hEF : E β€ F) : E ββ[K] F :=
subalgebra.inclusion hEF
lemma inclusion_injective {E F : intermediate_field K L} (hEF : E β€ F) :
function.injective (inclusion hEF) :=
subalgebra.inclusion_injective hEF
@[simp] lemma inclusion_self {E : intermediate_field K L}:
inclusion (le_refl E) = alg_hom.id K E :=
subalgebra.inclusion_self
@[simp] lemma inclusion_inclusion {E F G : intermediate_field K L} (hEF : E β€ F) (hFG : F β€ G)
(x : E) : inclusion hFG (inclusion hEF x) = inclusion (le_trans hEF hFG) x :=
subalgebra.inclusion_inclusion hEF hFG x
@[simp] lemma coe_inclusion {E F : intermediate_field K L} (hEF : E β€ F) (e : E) :
(inclusion hEF e : L) = e := rfl
variables {S}
lemma to_subalgebra_injective {S S' : intermediate_field K L}
(h : S.to_subalgebra = S'.to_subalgebra) : S = S' :=
by { ext, rw [β mem_to_subalgebra, β mem_to_subalgebra, h] }
variables (S)
lemma set_range_subset : set.range (algebra_map K L) β S :=
S.to_subalgebra.range_subset
lemma field_range_le : (algebra_map K L).field_range β€ S.to_subfield :=
Ξ» x hx, S.to_subalgebra.range_subset (by rwa [set.mem_range, β ring_hom.mem_field_range])
@[simp] lemma to_subalgebra_le_to_subalgebra {S S' : intermediate_field K L} :
S.to_subalgebra β€ S'.to_subalgebra β S β€ S' := iff.rfl
@[simp] lemma to_subalgebra_lt_to_subalgebra {S S' : intermediate_field K L} :
S.to_subalgebra < S'.to_subalgebra β S < S' := iff.rfl
variables {S}
section tower
/-- Lift an intermediate_field of an intermediate_field -/
def lift {F : intermediate_field K L} (E : intermediate_field K F) : intermediate_field K L :=
E.map (val F)
instance has_lift {F : intermediate_field K L} :
has_lift_t (intermediate_field K F) (intermediate_field K L) := β¨liftβ©
section restrict_scalars
variables (K) [algebra L' L] [is_scalar_tower K L' L]
/-- Given a tower `L / β₯E / L' / K` of field extensions, where `E` is an `L'`-intermediate field of
`L`, reinterpret `E` as a `K`-intermediate field of `L`. -/
def restrict_scalars (E : intermediate_field L' L) :
intermediate_field K L :=
{ carrier := E.carrier,
..E.to_subfield,
..E.to_subalgebra.restrict_scalars K }
@[simp] lemma coe_restrict_scalars {E : intermediate_field L' L} :
(restrict_scalars K E : set L) = (E : set L) := rfl
@[simp] lemma restrict_scalars_to_subalgebra {E : intermediate_field L' L} :
(E.restrict_scalars K).to_subalgebra = E.to_subalgebra.restrict_scalars K :=
set_like.coe_injective rfl
@[simp] lemma restrict_scalars_to_subfield {E : intermediate_field L' L} :
(E.restrict_scalars K).to_subfield = E.to_subfield :=
set_like.coe_injective rfl
@[simp] lemma mem_restrict_scalars {E : intermediate_field L' L} {x : L} :
x β restrict_scalars K E β x β E := iff.rfl
lemma restrict_scalars_injective :
function.injective (restrict_scalars K : intermediate_field L' L β intermediate_field K L) :=
Ξ» U V H, ext $ Ξ» x, by rw [β mem_restrict_scalars K, H, mem_restrict_scalars]
end restrict_scalars
/-- This was formerly an instance called `lift2_alg`, but an instance above already provides it. -/
example {F : intermediate_field K L} {E : intermediate_field F L} : algebra K E :=
by apply_instance
end tower
section finite_dimensional
variables (F E : intermediate_field K L)
instance finite_dimensional_left [finite_dimensional K L] : finite_dimensional K F :=
left K F L
instance finite_dimensional_right [finite_dimensional K L] : finite_dimensional F L :=
right K F L
@[simp] lemma dim_eq_dim_subalgebra :
module.rank K F.to_subalgebra = module.rank K F := rfl
@[simp] lemma finrank_eq_finrank_subalgebra :
finrank K F.to_subalgebra = finrank K F := rfl
variables {F} {E}
@[simp] lemma to_subalgebra_eq_iff : F.to_subalgebra = E.to_subalgebra β F = E :=
by { rw [set_like.ext_iff, set_like.ext'_iff, set.ext_iff], refl }
lemma eq_of_le_of_finrank_le [finite_dimensional K L] (h_le : F β€ E)
(h_finrank : finrank K E β€ finrank K F) : F = E :=
to_subalgebra_injective $ subalgebra.to_submodule_injective $ eq_of_le_of_finrank_le h_le h_finrank
lemma eq_of_le_of_finrank_eq [finite_dimensional K L] (h_le : F β€ E)
(h_finrank : finrank K F = finrank K E) : F = E :=
eq_of_le_of_finrank_le h_le h_finrank.ge
lemma eq_of_le_of_finrank_le' [finite_dimensional K L] (h_le : F β€ E)
(h_finrank : finrank F L β€ finrank E L) : F = E :=
begin
apply eq_of_le_of_finrank_le h_le,
have h1 := finrank_mul_finrank K F L,
have h2 := finrank_mul_finrank K E L,
have h3 : 0 < finrank E L := finrank_pos,
nlinarith,
end
lemma eq_of_le_of_finrank_eq' [finite_dimensional K L] (h_le : F β€ E)
(h_finrank : finrank F L = finrank E L) : F = E :=
eq_of_le_of_finrank_le' h_le h_finrank.le
end finite_dimensional
lemma is_algebraic_iff {x : S} : is_algebraic K x β is_algebraic K (x : L) :=
(is_algebraic_algebra_map_iff (algebra_map S L).injective).symm
lemma is_integral_iff {x : S} : is_integral K x β is_integral K (x : L) :=
by rw [βis_algebraic_iff_is_integral, is_algebraic_iff, is_algebraic_iff_is_integral]
lemma minpoly_eq (x : S) : minpoly K x = minpoly K (x : L) :=
begin
by_cases hx : is_integral K x,
{ exact minpoly.eq_of_algebra_map_eq (algebra_map S L).injective hx rfl },
{ exact (minpoly.eq_zero hx).trans (minpoly.eq_zero (mt is_integral_iff.mpr hx)).symm },
end
end intermediate_field
/-- If `L/K` is algebraic, the `K`-subalgebras of `L` are all fields. -/
def subalgebra_equiv_intermediate_field (alg : algebra.is_algebraic K L) :
subalgebra K L βo intermediate_field K L :=
{ to_fun := Ξ» S, S.to_intermediate_field (Ξ» x hx, S.inv_mem_of_algebraic (alg (β¨x, hxβ© : S))),
inv_fun := Ξ» S, S.to_subalgebra,
left_inv := Ξ» S, to_subalgebra_to_intermediate_field _ _,
right_inv := to_intermediate_field_to_subalgebra,
map_rel_iff' := Ξ» S S', iff.rfl }
@[simp] lemma mem_subalgebra_equiv_intermediate_field (alg : algebra.is_algebraic K L)
{S : subalgebra K L} {x : L} :
x β subalgebra_equiv_intermediate_field alg S β x β S :=
iff.rfl
@[simp] lemma mem_subalgebra_equiv_intermediate_field_symm (alg : algebra.is_algebraic K L)
{S : intermediate_field K L} {x : L} :
x β (subalgebra_equiv_intermediate_field alg).symm S β x β S :=
iff.rfl
|