Module

NatCardAlgHomComapEqRamificationIdxMulInertiaDeg.lean

Nyll.ValuedFieldTheory.Valuation.Subring.Ramification.NatCardAlgHomComapEqRamificationIdxMulInertiaDeg
19 declarations indexed from sourceView source ↗

Valuation Subring nat Card alg Hom comap eq ramification Idx mul inertia Deg

Imports81
  • Mathlib.Algebra.Algebra.Defs
  • Mathlib.Algebra.Algebra.Equiv
  • Mathlib.Algebra.Algebra.Hom
  • Mathlib.Algebra.Algebra.Subalgebra.Basic
  • Mathlib.Algebra.Algebra.Tower
  • Mathlib.Algebra.BigOperators.Group.Finset.Basic
  • Mathlib.Algebra.BigOperators.Group.Finset.Defs
  • Mathlib.Algebra.BigOperators.Ring.Finset
  • Mathlib.Algebra.Group.Action.Defs
  • Mathlib.Algebra.Group.DivInvMonoid
  • Mathlib.Algebra.Group.Equiv.Basic
  • Mathlib.Algebra.Group.Hom.Defs
  • Mathlib.Algebra.Group.Units.Defs
  • Mathlib.Algebra.GroupWithZero.Units.Lemmas
  • Mathlib.Algebra.Module.Torsion.Free
  • Mathlib.Algebra.Prime.Defs
  • Mathlib.Algebra.Ring.Hom.Defs
  • Mathlib.Algebra.Ring.Subsemiring.Basic
  • Mathlib.Data.Finset.Defs
  • Mathlib.Data.Fintype.Card
  • Mathlib.Data.Set.Card
  • Mathlib.Data.Set.Finite.Basic
  • Mathlib.Basic.SetLike.Basic
  • Mathlib.FieldTheory.Galois.Basic
  • Mathlib.FieldTheory.Galois.IsGaloisGroup
  • Mathlib.FieldTheory.IntermediateField.Adjoin.Basic
  • Mathlib.FieldTheory.IntermediateField.Basic
  • Mathlib.FieldTheory.IsAlgClosed.Basic
  • Mathlib.FieldTheory.Normal.Basic
  • Mathlib.FieldTheory.Normal.Closure
  • Mathlib.FieldTheory.Normal.Defs
  • Mathlib.FieldTheory.Separable
  • Mathlib.FieldTheory.SeparableClosure
  • Mathlib.GroupTheory.GroupAction.Defs
  • Mathlib.GroupTheory.Index
  • Mathlib.LinearAlgebra.Dimension.Finite
  • Mathlib.LinearAlgebra.Dimension.Finrank
  • Mathlib.LinearAlgebra.Dimension.Localization
  • Mathlib.LinearAlgebra.Dimension.StrongRankCondition
  • Mathlib.LinearAlgebra.FiniteDimensional.Defs
  • Mathlib.Logic.Equiv.Basic
  • Mathlib.Logic.Equiv.Set
  • Mathlib.NumberTheory.RamificationInertia.Galois
  • Mathlib.NumberTheory.RamificationInertia.Ramification
  • Mathlib.RingTheory.DedekindDomain.AdicValuation.Completion
  • Mathlib.RingTheory.DedekindDomain.AdicValuation.Valuation
  • Mathlib.RingTheory.DedekindDomain.Basic
  • Mathlib.RingTheory.DedekindDomain.Dvr
  • Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas
  • Mathlib.RingTheory.DedekindDomain.IntegralClosure
  • Mathlib.RingTheory.DiscreteValuationRing.Basic
  • Mathlib.RingTheory.Finiteness.Basic
  • Mathlib.RingTheory.Flat.TorsionFree
  • Mathlib.RingTheory.Ideal.GoingUp
  • Mathlib.RingTheory.Ideal.Maps
  • Mathlib.RingTheory.Ideal.Nonunits
  • Mathlib.RingTheory.Ideal.Over
  • Mathlib.RingTheory.Ideal.Pointwise
  • Mathlib.RingTheory.Ideal.Quotient.Defs
  • Mathlib.RingTheory.IntegralClosure.Algebra.Basic
  • Mathlib.RingTheory.IntegralClosure.IntegralRestrict
  • Mathlib.RingTheory.IntegralClosure.IntegrallyClosed
  • Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic
  • Mathlib.RingTheory.IntegralClosure.IsIntegralClosure.Basic
  • Mathlib.RingTheory.Invariant.Basic
  • Mathlib.RingTheory.Invariant.Galois
  • Mathlib.RingTheory.IsGaloisGroup.Basic
  • Mathlib.RingTheory.LocalRing.MaximalIdeal.Basic
  • Mathlib.RingTheory.Localization.AtPrime.Basic
  • Mathlib.RingTheory.Localization.FractionRing
  • Mathlib.RingTheory.Localization.Integral
  • Mathlib.RingTheory.RamificationInertia.Basic
  • Mathlib.RingTheory.RamificationInertia.Inertia
  • Mathlib.RingTheory.RamificationInertia.Ramification
  • Mathlib.RingTheory.SimpleRing.Basic
  • Mathlib.RingTheory.Valuation.LocalSubring
  • Mathlib.RingTheory.Valuation.ValuationSubring
  • Mathlib.SetTheory.Cardinal.Finite
  • Mathlib.Tactic.Ring.RingNF
  • Nyll.ValuedFieldTheory.Valuation.Subring.Discrete.DVRAlgebraMapMemSeparable
  • Nyll.SchemeTheory.RingTheory.Localization.InertiaDegree
Imported by2

Declarations

AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.mem_nonunits_comap_iff
Source context 12 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Dict
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {F : Type*} [Field F] [Algebra K F] [Algebra C F] [IsScalarTower C K F]
theorem mem_nonunits_comap_iff {L L' : Type*} [Field L] [Field L'] (B : ValuationSubring L')
    (f : L →+* L') (x : L) : x ∈ (B.comap f).nonunits ↔ f x ∈ B.nonunits
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.comap_center
Source context 14 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Dict
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {F : Type*} [Field F] [Algebra K F] [Algebra C F] [IsScalarTower C K F]
attribute [local instance] liesOver_maximalIdeal
omit K in
theorem comap_center (B : ValuationSubring F) (h : Over C B) :
    (center B h.mem).comap (algebraMap C (integralClosure C F)) = maximalIdeal C
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.center_liesOver
Source context 13 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Dict
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {F : Type*} [Field F] [Algebra K F] [Algebra C F] [IsScalarTower C K F]
attribute [local instance] liesOver_maximalIdeal
instance center_liesOver (B : ValuationSubring F) (h : Over C B) :
    (center B h.mem).LiesOver (maximalIdeal C)
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.vOf_asIdeal
Source context 13 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Dict
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {F : Type*} [Field F] [Algebra K F] [Algebra C F] [IsScalarTower C K F]
attribute [local instance] liesOver_maximalIdeal
theorem vOf_asIdeal (B : ValuationSubring F) (h : Over C B) :
    (vOf K B h).asIdeal = center B h.mem
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.isDiscreteValuationRing_W
Source context 17 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Dict
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {F : Type*} [Field F] [Algebra K F] [Algebra C F] [IsScalarTower C K F]
attribute [local instance] liesOver_maximalIdeal
section dedekind
variable [IsDedekindDomain (integralClosure C F)] [IsFractionRing (integralClosure C F) F]
local notation "W" => HeightOneSpectrum.valuationSubringAtPrime F
omit [IsDomain C] [IsDiscreteValuationRing C] in
theorem isDiscreteValuationRing_W (v : HeightOneSpectrum (integralClosure C F)) :
    IsDiscreteValuationRing (W v)
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.eq_of_center_eq
Source context 17 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Dict
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {F : Type*} [Field F] [Algebra K F] [Algebra C F] [IsScalarTower C K F]
attribute [local instance] liesOver_maximalIdeal
section dedekind
variable [IsDedekindDomain (integralClosure C F)] [IsFractionRing (integralClosure C F) F]
local notation "W" => HeightOneSpectrum.valuationSubringAtPrime F
include K in
theorem eq_of_center_eq (B B' : ValuationSubring F) (h : Over C B) (h' : Over C B')
    (hc : center B h.mem = center B' h'.mem) : B = B'
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.ef

The product of the ramification index and residue degree above the base maximal ideal.

Source context 16 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Dict
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {F : Type*} [Field F] [Algebra K F] [Algebra C F] [IsScalarTower C K F]
attribute [local instance] liesOver_maximalIdeal
section dedekind
variable [IsDedekindDomain (integralClosure C F)] [IsFractionRing (integralClosure C F) F]
local notation "W" => HeightOneSpectrum.valuationSubringAtPrime F
def ef (B : ValuationSubring F) (h : ∀ c : C, algebraMap C F c ∈ B) : ℕ
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.ef_W
Source context 17 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Dict
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {F : Type*} [Field F] [Algebra K F] [Algebra C F] [IsScalarTower C K F]
attribute [local instance] liesOver_maximalIdeal
section dedekind
variable [IsDedekindDomain (integralClosure C F)] [IsFractionRing (integralClosure C F) F]
local notation "W" => HeightOneSpectrum.valuationSubringAtPrime F
include K in
theorem ef_W (v : HeightOneSpectrum (integralClosure C F)) :
    ef (W v) (over_valuationSubringAtPrime v).mem =
    (maximalIdeal C).ramificationIdx' v.asIdeal * v.asIdeal.inertiaDeg C
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.ef_eq
Source context 17 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Dict
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {F : Type*} [Field F] [Algebra K F] [Algebra C F] [IsScalarTower C K F]
attribute [local instance] liesOver_maximalIdeal
section dedekind
variable [IsDedekindDomain (integralClosure C F)] [IsFractionRing (integralClosure C F) F]
local notation "W" => HeightOneSpectrum.valuationSubringAtPrime F
include K in
theorem ef_eq (B : ValuationSubring F) (h : Over C B) :
    ef B h.mem = (maximalIdeal C).ramificationIdx' (center B h.mem) *
      (center B h.mem).inertiaDeg C
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.jS

The map between integral closures induced by the inclusion of the intermediate field.

Source context 15 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Gal
open scoped Pointwise
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {κ : Type*} [Field κ] [Algebra K κ] [Algebra C κ] [IsScalarTower C K κ]
variable {N : Type*} [Field N] [Algebra K N] [Algebra C N] [IsScalarTower C K N]
variable [Algebra κ N] [IsScalarTower K κ N] [IsScalarTower C κ N]
def jS : integralClosure C κ →ₐ[C] integralClosure C N
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.coe_jS
Source context 16 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Gal
open scoped Pointwise
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {κ : Type*} [Field κ] [Algebra K κ] [Algebra C κ] [IsScalarTower C K κ]
variable {N : Type*} [Field N] [Algebra K N] [Algebra C N] [IsScalarTower C K N]
variable [Algebra κ N] [IsScalarTower K κ N] [IsScalarTower C κ N]
omit K [IsDomain C] [IsDiscreteValuationRing C] in
theorem coe_jS (s : integralClosure C κ) :
    ((jS (C := C) (κ := κ) (N := N) s : integralClosure C N) : N) = algebraMap κ N s
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.jS_injective
Source context 16 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Gal
open scoped Pointwise
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {κ : Type*} [Field κ] [Algebra K κ] [Algebra C κ] [IsScalarTower C K κ]
variable {N : Type*} [Field N] [Algebra K N] [Algebra C N] [IsScalarTower C K N]
variable [Algebra κ N] [IsScalarTower K κ N] [IsScalarTower C κ N]
omit K [IsDomain C] [IsDiscreteValuationRing C] in
theorem jS_injective : Function.Injective (jS (C := C) (κ := κ) (N := N))
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.card_smul_mem
Source context 15 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Gal
open scoped Pointwise
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {κ : Type*} [Field κ] [Algebra K κ] [Algebra C κ] [IsScalarTower C K κ]
variable {N : Type*} [Field N] [Algebra K N] [Algebra C N] [IsScalarTower C K N]
variable [Algebra κ N] [IsScalarTower K κ N] [IsScalarTower C κ N]
theorem card_smul_mem {G X : Type*} [Group G] [MulAction G X] [Finite G] (x₀ : X) (T : Set X)
    (hT : T ⊆ MulAction.orbit G x₀) (hTfin : T.Finite) :
    Nat.card {g : G // g • x₀ ∈ T} = Nat.card T * Nat.card (MulAction.stabilizer G x₀)
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.over_comap
Source context 16 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Gal
open scoped Pointwise
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {κ : Type*} [Field κ] [Algebra K κ] [Algebra C κ] [IsScalarTower C K κ]
variable {N : Type*} [Field N] [Algebra K N] [Algebra C N] [IsScalarTower C K N]
variable [Algebra κ N] [IsScalarTower K κ N] [IsScalarTower C κ N]
omit N [IsFractionRing C K] in
theorem over_comap {N' : Type*} [Field N'] [Algebra K N'] [Algebra C N'] [IsScalarTower C K N']
    (V : ValuationSubring N') (hV : Over C V) (τ : κ →ₐ[K] N') :
    Over C (V.comap (τ : κ →+* N'))
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.twist

The intermediate-field embedding obtained by composing inclusion with an automorphism.

Source context 15 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Gal
open scoped Pointwise
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {κ : Type*} [Field κ] [Algebra K κ] [Algebra C κ] [IsScalarTower C K κ]
variable {N : Type*} [Field N] [Algebra K N] [Algebra C N] [IsScalarTower C K N]
variable [Algebra κ N] [IsScalarTower K κ N] [IsScalarTower C κ N]
def twist (g : N ≃ₐ[K] N) : κ →ₐ[K] N
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.twist_apply
Source context 16 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Gal
open scoped Pointwise
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {κ : Type*} [Field κ] [Algebra K κ] [Algebra C κ] [IsScalarTower C K κ]
variable {N : Type*} [Field N] [Algebra K N] [Algebra C N] [IsScalarTower C K N]
variable [Algebra κ N] [IsScalarTower K κ N] [IsScalarTower C κ N]
omit C in
theorem twist_apply (g : N ≃ₐ[K] N) (x : κ) :
    twist K (κ := κ) g x = g (algebraMap κ N x)
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.card_twist
Source context 18 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Gal
open scoped Pointwise
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
variable {κ : Type*} [Field κ] [Algebra K κ] [Algebra C κ] [IsScalarTower C K κ]
variable {N : Type*} [Field N] [Algebra K N] [Algebra C N] [IsScalarTower C K N]
variable [Algebra κ N] [IsScalarTower K κ N] [IsScalarTower C κ N]
variable [FiniteDimensional K N] [IsGalois K N]
variable [IsDedekindDomain (integralClosure C κ)] [IsFractionRing (integralClosure C κ) κ]
variable [IsDedekindDomain (integralClosure C N)] [IsFractionRing (integralClosure C N) N]
theorem card_twist (V : ValuationSubring N) (hV : Over C V) (B : ValuationSubring κ)
    (hB : Over C B) [FiniteDimensional K κ] [Algebra.IsSeparable K κ] :
    Nat.card {g : N ≃ₐ[K] N // V.comap (twist K (κ := κ) g : κ →+* N) = B} =
      Module.finrank κ N * ef B hB.mem
AlgebraicCurves.Valuations.Proofs.ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg.KFA2a.card_stabilizer_algHom
Source context 11 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
namespace KFA2a
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (valuationSubringAtCenter_eq over_valuationSubringAtPrime overAlgebra
  algebraMap_injective algebraMap_overAlgebra_injective
  mem_of_mem_integralClosure ne_top_of_over coe_algebraMap_integralClosure
  algebraMap_integralClosure_injective isTorsionFree_integralClosure toOver coe_toOver center
  mem_center_iff
  center_isPrime center_ne_bot vOf mem_maximalIdeal_iff_inv_not_mem
  maximalIdeal_ne_bot liesOver_maximalIdeal)
section Emb
variable {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
variable (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
theorem card_stabilizer_algHom {κ N : Type*} [Field κ] [Field N] [Algebra K κ] [Algebra K N]
    [Algebra κ N] [IsScalarTower K κ N] [FiniteDimensional K N] [IsGalois K N]
    (act : MulAction (N ≃ₐ[K] N) (κ →ₐ[K] N))
    (hact : ∀ (g : N ≃ₐ[K] N) (τ : κ →ₐ[K] N), g • τ = (g : N →ₐ[K] N).comp τ) :
    Nat.card (MulAction.stabilizer (N ≃ₐ[K] N) (IsScalarTower.toAlgHom K κ N)) =
      Module.finrank κ N
ValuationSubring.natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
Source context 7 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section ProofImplementation
namespace AlgebraicCurves.Valuations.Proofs
namespace ValuationSubring_natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
open IsLocalRing IsDedekindDomain
open ValuationSubring_isDiscreteValuationRing_of_forall_algebraMap_mem_of_isSeparable.EmbCountDvr
  (Over)
open KFA2a in
theorem _root_.ValuationSubring.natCard_algHom_comap_eq_ramificationIdx_mul_inertiaDeg
    {C : Type*} [CommRing C] [IsDomain C] [IsDiscreteValuationRing C]
    (K : Type*) [Field K] [Algebra C K] [IsFractionRing C K]
    {L : Type*} [Field L] [IsAlgClosed L] [Algebra C L] [Algebra K L] [IsScalarTower C K L]
      [Algebra.IsAlgebraic K L]
    (A : ValuationSubring L) (hCA : ∀ c : C, algebraMap C L c ∈ A)
    (hCAmax : ∀ c : C, (⟨algebraMap C L c, hCA c⟩ : ↥A) ∈ maximalIdeal ↥A ↔ c ∈ maximalIdeal C)
    (κ : Type*) [Field κ] [Algebra K κ] [Algebra C κ] [IsScalarTower C K κ] [FiniteDimensional K κ]
      [Algebra.IsSeparable K κ]
    (B : ValuationSubring κ) (hCB : ∀ c : C, algebraMap C κ c ∈ B)
    (hCBmax : ∀ c : C, (⟨algebraMap C κ c, hCB c⟩ : ↥B) ∈ maximalIdeal ↥B ↔ c ∈ maximalIdeal C) :
    Finite {σ : κ →ₐ[K] L // A.comap (σ : κ →+* L) = B} ∧
    Nat.card {σ : κ →ₐ[K] L // A.comap (σ : κ →+* L) = B} =
      (letI : Algebra C ↥B := ((algebraMap C κ).codRestrict B hCB).toAlgebra
       (maximalIdeal C).ramificationIdx' (maximalIdeal ↥B) * (maximalIdeal ↥B).inertiaDeg C) := by
  classical
  refine ⟨inferInstance, ?_⟩
  have hB : Over C B :=
    ⟨hCB, fun c => by rw [← hCBmax c, ← ValuationSubring.coe_mem_nonunits_iff]⟩
  have hA : Over C A :=
    ⟨hCA, fun c => by rw [← hCAmax c, ← ValuationSubring.coe_mem_nonunits_iff]⟩
  have : IsAlgClosure K L := (isAlgClosure_iff K L).mpr ⟨inferInstance, inferInstance⟩
  set N : IntermediateField K L := IntermediateField.normalClosure K κ L with hN
  have : Algebra.IsSeparable K N := by
    rw [hN, normalClosure_def]
    have : ∀ f : κ →ₐ[K] L, Algebra.IsSeparable K f.fieldRange := fun f =>
      ⟨fun x => by
        obtain ⟨y, hy⟩ := (AlgHom.mem_fieldRange).mp x.2
        refine IsSeparable.of_algHom (F := K) (K := ↥f.fieldRange) (E := L)
          (f := f.fieldRange.val) ?_
        change IsSeparable K (x : L)
        rw [← hy]
        exact IsSeparable.map f f.injective (Algebra.IsSeparable.isSeparable K y)⟩
    infer_instance
  have : IsGalois K N := IsGalois.mk
  have hne : Nonempty (κ →ₐ[K] L) := ⟨IsAlgClosed.lift⟩
  let σ₀ : κ →ₐ[K] N := (normalClosure.algHomEquiv K κ L).symm hne.some
  let : Algebra κ N := σ₀.toRingHom.toAlgebra
  have : IsScalarTower K κ N := IsScalarTower.of_algebraMap_eq (fun x => (σ₀.commutes x).symm)
  have : IsScalarTower C κ N := IsScalarTower.of_algebraMap_eq (fun c => by
    change algebraMap C N c = σ₀ (algebraMap C κ c)
    rw [IsScalarTower.algebraMap_apply C K κ, AlgHom.commutes, ← IsScalarTower.algebraMap_apply])
  have hσ₀ : IsScalarTower.toAlgHom K κ N = σ₀ := AlgHom.ext fun x => rfl
  have : IsFractionRing (integralClosure C κ) κ :=
    integralClosure.isFractionRing_of_finite_extension K κ
  have : IsDedekindDomain (integralClosure C κ) :=
    IsIntegralClosure.isDedekindDomain C K κ (integralClosure C κ)
  have : IsFractionRing (integralClosure C N) N :=
    integralClosure.isFractionRing_of_finite_extension K N
  have : IsDedekindDomain (integralClosure C N) :=
    IsIntegralClosure.isDedekindDomain C K N (integralClosure C N)
  let ι : N →ₐ[K] L := N.val
  have hAN : Over C (A.comap (ι : N →+* L)) := KFA2a.over_comap K A hA ι
  have hcount := KFA2a.card_twist K (A.comap (ι : N →+* L)) hAN B hB
  let act : MulAction (N ≃ₐ[K] N) (κ →ₐ[K] N) :=
    { smul := fun g τ => (g : N →ₐ[K] N).comp τ
      one_smul := fun τ => by ext; rfl
      mul_smul := fun g h τ => by ext; rfl }
  have hact : ∀ (g : N ≃ₐ[K] N) (τ : κ →ₐ[K] N), g • τ = (g : N →ₐ[K] N).comp τ := fun _ _ => rfl
  have htwist : ∀ g : N ≃ₐ[K] N, KFA2a.twist K (κ := κ) g = g • IsScalarTower.toAlgHom K κ N :=
    fun g => rfl
  have horbit : ∀ τ : κ →ₐ[K] N, τ ∈ MulAction.orbit (N ≃ₐ[K] N) (IsScalarTower.toAlgHom K κ N) :=
    by
    intro τ
    let φ : N →ₐ[K] N := AlgHom.liftNormal τ N
    have hφ : ∀ x : κ, φ (algebraMap κ N x) = τ x := fun x => AlgHom.liftNormal_commutes τ N x
    refine MulAction.mem_orbit_iff.mpr ⟨AlgEquiv.ofBijective φ (AlgHom.normal_bijective K N N φ),
      ?_⟩
    rw [hact]
    exact AlgHom.ext fun x => hφ x
  set T : Set (κ →ₐ[K] N) := {τ | (A.comap (ι : N →+* L)).comap (τ : κ →+* N) = B} with hT
  have h1 : Nat.card {g : N ≃ₐ[K] N //
      (A.comap (ι : N →+* L)).comap (KFA2a.twist K (κ := κ) g : κ →+* N) = B} =
      Nat.card T * Module.finrank κ N := by
    rw [← KFA2a.card_stabilizer_algHom K act hact,
      ← KFA2a.card_smul_mem (IsScalarTower.toAlgHom K κ N) T (fun τ _ => horbit τ) (Set.toFinite T)]
    rfl
  have h2 : Nat.card T = Nat.card {σ : κ →ₐ[K] L // A.comap (σ : κ →+* L) = B} := by
    refine Nat.card_congr ((normalClosure.algHomEquiv K κ L).subtypeEquiv fun τ => ?_)
    change (A.comap (ι : N →+* L)).comap (τ : κ →+* N) = B ↔
      A.comap ((normalClosure.algHomEquiv K κ L τ : κ →ₐ[K] L) : κ →+* L) = B
    have : (A.comap (ι : N →+* L)).comap (τ : κ →+* N) =
        A.comap ((normalClosure.algHomEquiv K κ L τ : κ →ₐ[K] L) : κ →+* L) := by
      ext x; simp only [ValuationSubring.mem_comap, RingHom.coe_coe]; rfl
    rw [this]
  have hpos : 0 < Module.finrank κ N := by
    have : Module.Finite κ N := Module.Finite.of_restrictScalars_finite K κ N
    exact Module.finrank_pos
  have h3 : Nat.card T = KFA2a.ef B hCB := by
    have := h1.symm.trans hcount
    rw [mul_comm] at this
    exact Nat.eq_of_mul_eq_mul_left hpos this
  rw [← h2, h3]
  rfl