File size: 3,792 Bytes
cdec422
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.LinearAlgebra.CirculantHadamard.LocalizationMaps
import Mathlib.RingTheory.IntegralClosure.Algebra.Basic
import Mathlib.RingTheory.LocalRing.ResidueField.Basic
import Mathlib.Algebra.CharP.Two
import Mathlib.Tactic.Ring
import Mathlib.Tactic.NormNum

namespace OAI

universe uB uO uk uF

/-!
# The characteristic-two local ring for the binary contradiction

The maximal ideal is constructed from an actual finite characteristic-zero
integer algebra.  Unit denominators follow from the odd norm identity, not
from an assumed extension of complex conjugation to a localization.
-/

namespace CirculantHadamard.BinaryLocalization

/-- A finite characteristic-zero integer algebra has a maximal ideal over two. -/
theorem exists_maximal_two_mem (B : Type uB) [CommRing B] [CharZero B]
    [Module.Finite ℤ B] :
    ∃ m : Ideal B, m.IsMaximal ∧ (2 : B) ∈ m := by
  let : Algebra.IsIntegral ℤ B := Algebra.IsIntegral.of_finite ℤ B
  obtain ⟨m, hm, _, htwo⟩ :=
    exists_maximal_ideal_over_nat_prime_of_charZero B Nat.prime_two
  exact ⟨m, hm, htwo⟩

/-- The one residue field used by both first-order maps has characteristic two. -/
theorem residue_char_two {B : Type uB} [CommRing B] (m : Ideal B) [m.IsPrime]
    (htwo : (2 : B) ∈ m) :
    CharP (IsLocalRing.ResidueField (Localization.AtPrime m)) 2 := by
  let O := Localization.AtPrime m
  apply CharTwo.of_one_ne_zero_of_two_eq_zero one_ne_zero
  have hmem : (2 : O) ∈ IsLocalRing.maximalIdeal O := by
    simpa only [map_ofNat] using
      (IsLocalization.AtPrime.to_map_mem_maximal_iff O m (2 : B)).mpr htwo
  have hz := (IsLocalRing.residue_eq_zero_iff (2 : O)).mpr hmem
  simpa only [map_ofNat] using hz

/-- A square root of minus one reduces to one in a field of characteristic two. -/
theorem map_i_eq_one {O : Type uO} {k : Type uk} [CommRing O] [Field k] [CharP k 2]
    (φ : O →+* k) (i : O) (hi : i ^ 2 = -1) : φ i = 1 := by
  have htwo : (2 : k) = 0 := CharTwo.two_eq_zero
  have hsquare : (φ i) ^ 2 = -1 := by
    simpa using congrArg φ hi
  have hsq : (φ i - 1) ^ 2 = 0 := by
    calc
      (φ i - 1) ^ 2 = (φ i) ^ 2 - 2 * φ i + 1 := by ring
      _ = 0 := by rw [hsquare, htwo]; ring
  exact sub_eq_zero.mp (eq_zero_of_pow_eq_zero hsq)

/-- An odd scalar is one in the common characteristic-two residue field. -/
theorem map_odd_nat_eq_one {O : Type uO} {k : Type uk} [CommRing O] [Field k] [CharP k 2]
    (φ : O →+* k) {u : ℕ} (hu : Odd u) : φ (u : O) = 1 := by
  rw [map_natCast]
  exact natCast_eq_one_of_odd_of_two_eq_zero hu CharTwo.two_eq_zero

/-- The odd norm supplies a unit without requiring the second factor to be a
conjugation operation on the local ring. -/
theorem isUnit_of_mul_eq_odd_square {O : Type uO} [CommRing O] [IsLocalRing O]
    [CharP (IsLocalRing.ResidueField O) 2] {x y : O} {u : ℕ}
    (hu : Odd u) (hxy : x * y = (u : O) ^ 2) : IsUnit x := by
  apply (IsLocalRing.residue_ne_zero_iff_isUnit x).mp
  intro hx
  have h := congrArg (IsLocalRing.residue O) hxy
  have hu' := map_odd_nat_eq_one (IsLocalRing.residue O) hu
  have hbad : (0 : IsLocalRing.ResidueField O) = 1 := by
    simpa only [map_mul, map_pow, hx, zero_mul, hu', one_pow] using h
  exact zero_ne_one hbad

/-- A faithful ring embedding reflects the odd-power witness for an actual unit. -/
theorem odd_power_of_map {O : Type uO} {F : Type uF} [CommRing O] [CommRing F]
    (f : O →+* F) (hf : Function.Injective f) (u : Oˣ)
    (h : ∃ m : ℕ, 0 < m ∧ Odd m ∧ (f (u : O)) ^ m = 1) :
    ∃ m : ℕ, 0 < m ∧ Odd m ∧ u ^ m = 1 := by
  obtain ⟨m, hm, hodd, hpow⟩ := h
  refine ⟨m, hm, hodd, ?_⟩
  apply Units.ext
  apply hf
  simpa only [Units.val_pow_eq_pow_val, Units.val_one, map_pow, map_one] using hpow

end CirculantHadamard.BinaryLocalization

end OAI