Documentation

HexBerlekampZassenhausMathlib.Multiquadratic

theorem Hex.SquareClass.isIntegral_of_sq {d : } {r : } (hr : r ^ 2 = d) :

A complex square root of an integer is integral over .

The complex roots of X ^ 2 - d are the complex square roots of d.

theorem Hex.SquareClass.normal_adjoin_sqrt {d : } {r : } (hr : r ^ 2 = d) :
Normal r

A quadratic subfield of the tower is normal: it splits X ^ 2 - d.

def Hex.SquareClass.signSum {R : Type u_1} [Ring R] {n : } (c : ) (r : Fin nR) (ε : Fin nBool) :
R

The sign-pattern sum c + ∑ᵢ ± rᵢ, where ε i selects the sign of the i-th root. Stated over an arbitrary ring so that the tower and the ambient share one definition.

Equations
Instances For
    theorem Hex.SquareClass.signSum_const_true {R : Type u_1} [Ring R] {n : } (c : ) (r : Fin nR) :
    (signSum c r fun (x : Fin n) => true) = c + i : Fin n, r i

    The all-plus pattern gives the untwisted sum c + ∑ᵢ rᵢ.

    theorem Hex.SquareClass.map_signSum {R : Type u_1} {S : Type u_2} [Ring R] [Ring S] {n : } (f : R →+* S) (c : ) (r : Fin nR) (ε : Fin nBool) :
    f (signSum c r ε) = signSum c (fun (i : Fin n) => f (r i)) ε

    A ring map carries a sign-pattern sum to the sign-pattern sum of the images.

    noncomputable def Hex.SquareClass.signPoly {R : Type u_1} [CommRing R] {n : } (c : ) (r : Fin nR) :

    The sign-pattern product ∏_ε (X - (c + ∑ᵢ ± rᵢ)), the candidate minimal polynomial.

    Equations
    Instances For
      theorem Hex.SquareClass.signPoly_monic {R : Type u_1} [CommRing R] {n : } (c : ) (r : Fin nR) :

      The sign-pattern product is monic, being a product of monic linear factors.

      theorem Hex.SquareClass.natDegree_signPoly {R : Type u_1} [CommRing R] [Nontrivial R] {n : } (c : ) (r : Fin nR) :
      (signPoly c r).natDegree = 2 ^ n

      The sign-pattern product has degree 2 ^ n, one factor per sign pattern.

      theorem Hex.SquareClass.map_signPoly {R : Type u_1} {S : Type u_2} [CommRing R] [CommRing S] {n : } (f : R →+* S) (c : ) (r : Fin nR) :
      Polynomial.map f (signPoly c r) = signPoly c fun (i : Fin n) => f (r i)

      A ring map carries the sign-pattern product to the sign-pattern product of the images.

      theorem Hex.SquareClass.signPoly_eval {R : Type u_1} [CommRing R] {n : } (c : ) (r : Fin nR) :
      Polynomial.eval (signSum c r fun (x : Fin n) => true) (signPoly c r) = 0

      The all-plus pattern is a root of the sign-pattern product.

      theorem Hex.SquareClass.getElem_mem_eraseIdx {α : Type u_1} {l : List α} {i j : Fin l.length} (hij : i j) :
      l[i] l.eraseIdx j

      Every entry except the j-th survives erasing position j.

      theorem Hex.SquareClass.perm_eraseIdx {α : Type u_1} [DecidableEq α] (l : List α) (j : Fin l.length) :
      l.Perm (l[j] :: l.eraseIdx j)

      Erasing position j and putting the j-th entry back in front recovers the list.

      theorem Hex.SquareClass.eq_zero_of_sum_eq_zero {ds : List } {r : Fin ds.length} (h : Independent ds) (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) {a : Fin ds.length} (ha : i : Fin ds.length, (a i) * r i = 0) (j : Fin ds.length) :
      a j = 0

      No integer linear relation holds among square roots of independent radicands.

      theorem Hex.SquareClass.adjoinSqrt_le {M : IntermediateField } (ds : List ) :
      (∀ (x : ), dds, x ^ 2 = dx M)adjoinSqrt ds M

      An intermediate field containing every square root of every radicand contains the tower.

      theorem Hex.SquareClass.eq_top_of_sqrt_mem {ds : List } (N : IntermediateField (adjoinSqrt ds)) (hN : ∀ (x : ), dds, x ^ 2 = dx IntermediateField.map (adjoinSqrt ds).val N) :
      N =

      An intermediate field of the tower whose image in contains every square root of every radicand is the whole tower.

      theorem Hex.SquareClass.eq_or_neg_of_sq {K : Type u_1} [Field K] [Algebra K] (σ : Gal(K/)) {x : K} {d : } (hx : x ^ 2 = d) :
      σ x = x σ x = -x

      An automorphism sends a square root of an integer to plus or minus itself.

      def Hex.SquareClass.root {ds : List } {r : Fin ds.length} (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (i : Fin ds.length) :
      (adjoinSqrt ds)

      The chosen square roots, as elements of the tower.

      Equations
      Instances For
        @[simp]
        theorem Hex.SquareClass.root_val {ds : List } {r : Fin ds.length} (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (i : Fin ds.length) :
        (root hr i) = r i

        The chosen root's underlying complex value.

        theorem Hex.SquareClass.root_sq {ds : List } {r : Fin ds.length} (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (i : Fin ds.length) :
        root hr i ^ 2 = ds[i]

        The chosen root squares to its radicand inside the tower.

        noncomputable def Hex.SquareClass.signOf {ds : List } {r : Fin ds.length} (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (σ : Gal((adjoinSqrt ds)/)) (i : Fin ds.length) :

        The sign pattern by which σ acts on the chosen roots.

        Equations
        Instances For
          theorem Hex.SquareClass.getElem_ne_zero {ds : List } (h : Independent ds) (i : Fin ds.length) :
          ds[i] 0

          A radicand of independent square classes is nonzero: 0 is a square.

          theorem Hex.SquareClass.root_ne_neg_self {ds : List } {r : Fin ds.length} (h : Independent ds) (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (i : Fin ds.length) :
          root hr i -root hr i

          A chosen root of an independent radicand is not its own negative.

          theorem Hex.SquareClass.apply_root {ds : List } {r : Fin ds.length} (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (σ : Gal((adjoinSqrt ds)/)) (i : Fin ds.length) :
          σ (root hr i) = if signOf hr σ i = true then root hr i else -root hr i

          Every automorphism of the tower acts on the chosen roots by its sign pattern.

          theorem Hex.SquareClass.signOf_eq_of_apply {ds : List } {r : Fin ds.length} (h : Independent ds) (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) {σ : Gal((adjoinSqrt ds)/)} {i : Fin ds.length} {b : Bool} (hb : σ (root hr i) = if b = true then root hr i else -root hr i) :
          signOf hr σ i = b

          Reading a sign off an action recovers the sign pattern, the roots being nonzero.

          noncomputable def Hex.SquareClass.gen {ds : List } {r : Fin ds.length} (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) :
          (adjoinSqrt ds)

          α = c + ∑ᵢ √dᵢ, as an element of the tower.

          Equations
          Instances For
            @[simp]
            theorem Hex.SquareClass.gen_val {ds : List } {r : Fin ds.length} (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) :
            (gen hr c) = signSum c r fun (x : Fin ds.length) => true

            The generator's underlying complex value is the all-plus sign sum.

            theorem Hex.SquareClass.eq_one_of_root_fixed {ds : List } {r : Fin ds.length} (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) {σ : Gal((adjoinSqrt ds)/)} ( : ∀ (i : Fin ds.length), σ (root hr i) = root hr i) :
            σ = 1

            Only the identity fixes every chosen root.

            theorem Hex.SquareClass.eq_one_of_gen_fixed {ds : List } {r : Fin ds.length} (h : Independent ds) (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) {σ : Gal((adjoinSqrt ds)/)} ( : σ (gen hr c) = gen hr c) :
            σ = 1

            Trivial stabilizer. Only the identity fixes the primitive element.

            theorem Hex.SquareClass.fixingSubgroup_adjoin_gen {ds : List } {r : Fin ds.length} (h : Independent ds) (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) :

            Nothing but the identity fixes ℚ(α) pointwise.

            theorem Hex.SquareClass.adjoin_gen_eq_top {ds : List } {r : Fin ds.length} (h : Independent ds) (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) :
            gen hr c =

            The tower theorem, part (2), read inside the tower.

            theorem Hex.SquareClass.signOf_injective {ds : List } {r : Fin ds.length} (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) :

            An automorphism is determined by its sign pattern, the roots generating the tower.

            @[simp]
            theorem Hex.SquareClass.signOf_one {ds : List } {r : Fin ds.length} (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) :
            signOf hr 1 = fun (x : Fin ds.length) => true

            The identity acts by the all-plus pattern.

            theorem Hex.SquareClass.signOf_mul {ds : List } {r : Fin ds.length} (h : Independent ds) (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (σ τ : Gal((adjoinSqrt ds)/)) :
            signOf hr (σ * τ) = fun (i : Fin ds.length) => signOf hr σ i == signOf hr τ i

            Composing automorphisms multiplies sign patterns pointwise. Bool under == with true as identity is ℤ/2, so this is the homomorphism law that turns signOf_bijective into the isomorphism Gal(K/ℚ) ≅ (ℤ/2)ⁿ.

            theorem Hex.SquareClass.signOf_bijective {ds : List } {r : Fin ds.length} (h : Independent ds) (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) :

            The Galois group is (ℤ/2)ⁿ. Reading σ off as the sign pattern by which it acts on the chosen roots is a bijection onto the 2ⁿ sign patterns: injective because the roots generate the tower, surjective by the degree theorem. It is a group homomorphism by signOf_mul.

            theorem Hex.SquareClass.signSum_congr {R : Type u_1} [Ring R] {n : } (c : ) {r r' : Fin nR} {ε ε' : Fin nBool} (h : ∀ (i : Fin n), (if ε i = true then r i else -r i) = if ε' i = true then r' i else -r' i) :
            signSum c r ε = signSum c r' ε'

            Sign-pattern sums agree when their signed summands do.

            theorem Hex.SquareClass.signPoly_comp_algEquiv {ds : List } {r : Fin ds.length} (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) (σ : Gal((adjoinSqrt ds)/)) :
            (signPoly c fun (i : Fin ds.length) => σ (root hr i)) = signPoly c (root hr)

            An automorphism permutes the sign patterns by exclusive-or with its own.

            theorem Hex.SquareClass.exists_monic_map_eq_signPoly {ds : List } {r : Fin ds.length} (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) :

            The sign-pattern product has coefficients in .

            theorem Hex.SquareClass.natDegree_minpoly_gen {ds : List } {r : Fin ds.length} (h : Independent ds) (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) :
            (minpoly (gen hr c)).natDegree = 2 ^ ds.length

            α has degree 2 ^ n over , by the Galois correspondence and the degree theorem.

            theorem Hex.SquareClass.minpoly_gen_map {ds : List } {r : Fin ds.length} (h : Independent ds) (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) :

            The tower theorem, part (3), read inside the tower.

            theorem Hex.SquareClass.minpoly_signSum {ds : List } {r : Fin ds.length} (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) :
            minpoly (signSum c r fun (x : Fin ds.length) => true) = minpoly (gen hr c)

            The minimal polynomial of α is computed inside the tower.

            theorem Hex.SquareClass.minpoly_map_eq_signPoly {ds : List } {r : Fin ds.length} (h : Independent ds) (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) :

            The tower theorem, part (3). The minimal polynomial is the sign-pattern product.

            theorem Hex.SquareClass.isIntegral_signSum {ds : List } {r : Fin ds.length} (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) :
            IsIntegral (signSum c r fun (x : Fin ds.length) => true)

            α is integral over , lying in a finite extension.

            theorem Hex.SquareClass.natDegree_minpoly_signSum {ds : List } {r : Fin ds.length} (h : Independent ds) (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) :
            (minpoly (signSum c r fun (x : Fin ds.length) => true)).natDegree = 2 ^ ds.length

            α has degree 2 ^ n over .

            theorem Hex.SquareClass.adjoin_signSum_eq {ds : List } {r : Fin ds.length} (h : Independent ds) (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) :
            signSum c r fun (x : Fin ds.length) => true = adjoinSqrt ds

            The tower theorem, part (2). α = c + ∑ᵢ √dᵢ generates the whole tower.

            theorem Hex.SquareClass.irreducible_of_map_eq_signPoly {ds : List } {r : Fin ds.length} (h : Independent ds) (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) {f : Polynomial } (hf : Polynomial.map (algebraMap ) f = signPoly c r) :

            The consequence the certificate needs. A rational polynomial that is the sign-pattern product of independent square classes is irreducible: it is the minimal polynomial of α.

            theorem Hex.SquareClass.irreducible_int_of_map_eq_signPoly {ds : List } {r : Fin ds.length} (h : Independent ds) (hr : ∀ (i : Fin ds.length), r i ^ 2 = ds[i]) (c : ) {f : Polynomial } (hfm : f.Monic) (hf : Polynomial.map (Int.castRingHom ) f = signPoly c r) :

            The same over , by Gauss's lemma: a monic integer sign-pattern product is irreducible.