Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,6 @@ theorem modBits_all_false_iff (l f : List Bool) :
← length_modBits l f]
exact degree_polyOfBits_lt _

/-- Every nonzero binary polynomial is monic. -/
theorem monic_of_ne_zero {q : (ZMod 2)[X]} (hq : q ≠ 0) : q.Monic :=
(by decide : ∀ c : ZMod 2, c ≠ 0 → c = 1) _ (leadingCoeff_ne_zero.2 hq)

private theorem natDegree_polyOfCode_eq_log (m : ℕ) : (polyOfCode m).natDegree = Nat.log 2 m := by
rcases eq_or_ne m 0 with rfl | hm
· simp
Expand Down
8 changes: 6 additions & 2 deletions Complexity/Foundations/FieldTheory/Finite/BinaryField.lean
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ need `w ≠ 0`.

## Main results

* `Cslib.monic_of_ne_zero`: every nonzero binary polynomial is monic.
* `Cslib.irreducible_leastIrreducible`, `Cslib.monic_leastIrreducible`,
`Cslib.natDegree_leastIrreducible`: `leastIrreducible w` is monic and irreducible, of degree `w`
when `w ≠ 0`.
Expand Down Expand Up @@ -211,10 +212,13 @@ theorem exists_code_leastIrreducible {p : ℕ} (hp : p ≠ 0) :
· exact hlog ▸ Nat.pow_log_le_self 2 hm0
· exact hlog ▸ Nat.lt_pow_succ_log_self one_lt_two m

/-- Every nonzero binary polynomial is monic. -/
theorem monic_of_ne_zero {q : (ZMod 2)[X]} (hq : q ≠ 0) : q.Monic :=
(by decide : ∀ c : ZMod 2, c ≠ 0 → c = 1) _ (leadingCoeff_ne_zero.2 hq)

/-- `leastIrreducible w` is monic for every degree `w`, as every nonzero binary polynomial is. -/
theorem monic_leastIrreducible (w : ℕ) : (leastIrreducible w).Monic :=
(by decide : ∀ c : ZMod 2, c ≠ 0 → c = 1) _
(leadingCoeff_ne_zero.2 (irreducible_leastIrreducible w).ne_zero)
monic_of_ne_zero (irreducible_leastIrreducible w).ne_zero

/-- **The explicit binary field of degree `w`**: binary polynomials modulo the irreducible
polynomial of degree `w` with the least code. -/
Expand Down
Loading