Documentation

CompPoly.Fields.Binary.Tower.Support.Preliminaries

Binary Tower Preliminaries #

Shared finite-field and bitwise preliminaries for the binary tower development.

@[implicit_reducible]
noncomputable instance GF_2_fintype :
theorem GF_2_pow_card (x : GF(2)) :
theorem GF_2_card :
Fintype.card (GF(2)) = 2 ^ 2 ^ 0
theorem non_zero_divisors_iff (M₀ : Type u_1) [Mul M₀] [Zero M₀] :
NoZeroDivisors M₀ ∀ {a b : M₀}, a * b = 0a = 0 b = 0
instance neZero_one_of_nontrivial_comm_monoid_zero {M₀ : Type u_1} [CommMonoidWithZero M₀] [instNontrivial : Nontrivial M₀] :
theorem GF_2_value_eq_zero_or_one (x : GF(2)) :
x = 0 x = 1

Any element in GF(2) is either 0 or 1.

theorem withBot_lt_one_cases (x : WithBot ) (h : x < 1) :
x = x = 0
theorem is_unit_iff_deg_0 {R : Type u_1} [Field R] {p : Polynomial R} :
theorem non_trivial_factors_of_non_trivial_poly_have_deg_ge_1 {R : Type u_1} [Field R] {p a b : Polynomial R} (h_prod : p = a * b) (h_p_nonzero : p 0) (h_a_non_unit : ¬IsUnit a) (h_b_non_unit : ¬IsUnit b) :
theorem prod_univ_twos {M : Type u_1} [CommMonoid M] {n : } (hn : n = 2) (f : Fin nM) :
i : Fin n, f i = f (Fin.cast 0) * f (Fin.cast 1)
theorem sum_univ_twos {M : Type u_1} [AddCommMonoid M] {n : } (hn : n = 2) (f : Fin nM) :
i : Fin n, f i = f (Fin.cast 0) + f (Fin.cast 1)
theorem unique_repr {R : Type u_1} [CommRing R] {S : Type u_2} [CommRing S] [Algebra R S] (pb : PowerBasis R S) (repr1 repr2 : Fin pb.dim →₀ R) (h : i : Fin pb.dim, repr1 i pb.basis i = i : Fin pb.dim, repr2 i pb.basis i) :
repr1 = repr2
theorem linear_sum_repr (R : Type u_1) [CommRing R] (S : Type u_2) [CommRing S] [Algebra R S] (pb : PowerBasis R S) (h_dim : pb.dim = 2) (s : S) :
∃ (a : R) (b : R), s = a pb.gen + (algebraMap R S) b
theorem unique_linear_sum_repr (R : Type u_1) [CommRing R] (S : Type u_2) [CommRing S] [Algebra R S] (pb : PowerBasis R S) (h_dim : pb.dim = 2) (s : S) :
∃! p : R × R, s = p.1 pb.gen + (algebraMap R S) p.2
theorem linear_form_of_elements_in_adjoined_commring {R : Type u_1} [CommRing R] (f : Polynomial R) (hf_deg : f.natDegree = 2) (hf_monic : f.Monic) (c1 : AdjoinRoot f) :
∃ (a : R) (b : R), c1 = (AdjoinRoot.of f) a * AdjoinRoot.root f + (AdjoinRoot.of f) b
theorem unique_linear_form_of_elements_in_adjoined_commring {R : Type u_1} [CommRing R] (f : Polynomial R) (hf_deg : f.natDegree = 2) (hf_monic : f.Monic) (c1 : AdjoinRoot f) :
∃! p : R × R, c1 = (AdjoinRoot.of f) p.1 * AdjoinRoot.root f + (AdjoinRoot.of f) p.2
structure GaloisAutomorphism (F : Type u_1) [Field F] (u : F) (k : ) :

Galois automorphism properties for a special element in a binary tower field. Encapsulates the key relationship : u^(2^(2^k)) = u⁻¹ and (u⁻¹)^(2^(2^k)) = u

Instances For
    structure TraceMapProperty (F : Type u_1) [Field F] (u : F) (k : ) :

    Trace map properties for elements in a binary tower field extension. Asserts that the trace of both an element and its inverse equals 1.

    Instances For
      structure SpecialElementRelation {F_prev : Type u_1} [Field F_prev] (t1 : F_prev) {F_cur : Type u_2} [Field F_cur] (u : F_cur) [Algebra F_prev F_cur] :

      Special element relationship in binary tower fields. Captures the key equation : u + u⁻¹ = t₁ (lifted previous special element)

      Instances For
        theorem two_eq_zero_in_char2_field {F : Type u_1} [Field F] (sumZeroIffEq : ∀ (x y : F), x + y = 0 x = y) :
        2 = 0
        theorem sum_of_pow_exp_of_2 {F : Type u_1} [Field F] (sumZeroIffEq : ∀ (x y : F), x + y = 0 x = y) (i : ) (a b c : F) :
        a + b = ca ^ 2 ^ i + b ^ 2 ^ i = c ^ 2 ^ i
        theorem sum_square_char2 {F : Type u_1} [Field F] (sumZeroIffEq : ∀ (x y : F), x + y = 0 x = y) (s : Finset ) (f : F) :
        (∑ js, f j) ^ 2 = js, f j ^ 2
        theorem sum_Icc_shift {M : Type u_1} [AddCommMonoid M] (f : M) (a b shift : ) :
        jFinset.Icc a b, f (j + shift) = jFinset.Icc (a + shift) (b + shift), f j
        theorem two_le_two_pow_n_plus_1 (n : ) :
        2 2 ^ (n + 1)
        theorem one_le_two_pow_n (n : ) :
        1 2 ^ n
        theorem zero_lt_pow_n (m n : ) (h_m : m > 0) :
        0 < m ^ n
        theorem one_le_sub_consecutive_two_pow (n : ) :
        1 2 ^ (n + 1) - 2 ^ n
        theorem two_pow_ne_zero (n : ) :
        2 ^ n 0
        theorem pow_exp_of_2_repr_given_x_square_repr {F : Type u_1} [instField : Field F] (sumZeroIffEq : ∀ (x y : F), x + y = 0 x = y) (x z : F) (h_z_non_zero : z 0) (h_x_square : x ^ 2 = x * z + 1) (i : ) :
        x ^ 2 ^ i = x * z ^ (2 ^ i - 1) + jFinset.Icc 1 i, z ^ (2 ^ i - 2 ^ j)

        For any field element (x : F) where x^2 = x*z + 1, this theorem gives a closed form for x^(2^i).

        theorem inverse_is_root_of_prevPoly {prevBTField : Type u_1} [Field prevBTField] {curBTField : Type u_2} [Field curBTField] (of_prev : prevBTField →+* curBTField) (u : curBTField) (t1 : prevBTField) (specialElementNeZero : u 0) (eval_prevPoly_at_root : u ^ 2 + of_prev t1 * u + 1 = 0) (h_eval : ∀ (x : curBTField), Polynomial.eval₂ of_prev x (Polynomial.X ^ 2 + (Polynomial.C t1 * Polynomial.X + 1)) = x ^ 2 + of_prev t1 * x + 1) :
        theorem sum_of_root_and_inverse_is_t1 {curBTField : Type u_1} [Field curBTField] (u t1 : curBTField) (specialElementNeZero : u 0) (eval_prevPoly_at_root : u ^ 2 + t1 * u + 1 = 0) (sumZeroIffEq : ∀ (x y : curBTField), x + y = 0 x = y) :
        u + u⁻¹ = t1
        theorem self_sum_eq_zero {prevBTField : Type u_1} [CommRing prevBTField] (sumZeroIffEqPrev : ∀ (x y : prevBTField), x + y = 0 x = y) (prevPoly : Polynomial prevBTField) (hf_deg : prevPoly.natDegree = 2) (hf_monic : prevPoly.Monic) (x : AdjoinRoot prevPoly) :
        x + x = 0
        theorem sum_zero_iff_eq_of_self_sum_zero {F : Type u_1} [AddGroup F] (h_self_sum_eq_zero : ∀ (x : F), x + x = 0) (x y : F) :
        x + y = 0 x = y
        theorem prod_mul_erase {α : Type u_1} {β : Type u_2} [CommMonoid β] [DecidableEq α] (s : Finset α) (f : αβ) {a : α} (h : a s) :
        f a * xs.erase a, f x = xs, f x

        A variant of Finset.mul_prod_erase with the multiplication swapped.

        theorem sum_add_erase {α : Type u_1} {β : Type u_2} [AddCommMonoid β] [DecidableEq α] (s : Finset α) (f : αβ) {a : α} (h : a s) :
        f a + xs.erase a, f x = xs, f x

        A variant of Finset.add_sum_erase with the addition swapped.-

        theorem eval₂_quadratic_prevField_coeff {prevBTField : Type u_1} [CommRing prevBTField] {curBTField : Type u_2} [CommRing curBTField] (of_prev : prevBTField →+* curBTField) (t1 : prevBTField) (x : curBTField) :
        Polynomial.eval₂ of_prev x (Polynomial.X ^ 2 + (Polynomial.C t1 * Polynomial.X + 1)) = x ^ 2 + of_prev t1 * x + 1
        theorem galois_eval_in_BTField {curBTField : Type u_1} [Field curBTField] (u t1 : curBTField) (k : ) (sumZeroIffEq : ∀ (x y : curBTField), x + y = 0 x = y) (prevSpecialElementNeZero : t1 0) (u_plus_inv_eq_t1 : u + u⁻¹ = t1) (h_u_square : u ^ 2 = u * t1 + 1) (h_t1_pow : t1 ^ (2 ^ 2 ^ k - 1) = 1 t1⁻¹ ^ (2 ^ 2 ^ k - 1) = 1) (h_t1_pow_2_pow_2_pow_k : t1 ^ 2 ^ 2 ^ k = t1) (h_t1_inv_pow_2_pow_2_pow_k : t1⁻¹ ^ 2 ^ 2 ^ k = t1⁻¹) (trace_map_at_inv : iFinset.range (2 ^ k), t1⁻¹ ^ 2 ^ i = 1) :
        u ^ 2 ^ 2 ^ k = u⁻¹
        theorem galois_automorphism_power {curBTField : Type u_1} [Field curBTField] (u t1 : curBTField) (k : ) (sumZeroIffEq : ∀ (x y : curBTField), x + y = 0 x = y) (specialElementNeZero : u 0) (prevSpecialElementNeZero : t1 0) (u_plus_inv_eq_t1 : u + u⁻¹ = t1) (h_u_square : u ^ 2 = u * t1 + 1) (h_t1_pow : t1 ^ (2 ^ 2 ^ k - 1) = 1 t1⁻¹ ^ (2 ^ 2 ^ k - 1) = 1) (trace_map_roots : iFinset.range (2 ^ k), t1 ^ 2 ^ i = 1 iFinset.range (2 ^ k), t1⁻¹ ^ 2 ^ i = 1) :
        u ^ 2 ^ 2 ^ k = u⁻¹ u⁻¹ ^ 2 ^ 2 ^ k = u
        theorem lifted_trace_map_eval_at_roots_prev_BTField {curBTField : Type u_1} [Field curBTField] (u t1 : curBTField) (k : ) (sumZeroIffEq : ∀ (x y : curBTField), x + y = 0 x = y) (u_plus_inv_eq_t1 : u + u⁻¹ = t1) (galois_automorphism : u ^ 2 ^ 2 ^ k = u⁻¹ u⁻¹ ^ 2 ^ 2 ^ k = u) (trace_map_at_prev_root : iFinset.range (2 ^ k), t1 ^ 2 ^ i = 1) :
        iFinset.range (2 ^ (k + 1)), u ^ 2 ^ i = 1
        theorem rsum_eq_t1_square_aux {curBTField : Type u_1} [Field curBTField] (u : curBTField) (k : ) (x_pow_card : ∀ (x : curBTField), x ^ 2 ^ 2 ^ k = x) (u_ne_zero : u 0) (trace_map_prop : TraceMapProperty curBTField u k) :
        jFinset.Icc 1 (2 ^ k), u ^ (2 ^ 2 ^ k - 2 ^ j) = u
        instance charP_eq_2_of_add_self_eq_zero {F : Type u_1} [Field F] (sumZeroIffEq : ∀ (x y : F), x + y = 0 x = y) :
        CharP F 2