File size: 1,891 Bytes
67aee1d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Analysis.GroupDeterminants.LampDenominators

namespace OAI

universe uH

noncomputable section
open scoped BigOperators Pointwise

namespace GroupRingDeterminant
variable {H : Type uH} [Group H]

lemma zmodTwo_eq_one_of_ne_zero (z : ZMod 2) (hz : z ≠ 0) : z = 1 := by
  exact (by decide : ∀ z : ZMod 2, z ≠ 0 → z = 1) z hz

lemma binary_support_expansion (a : MonoidAlgebra (ZMod 2) H) (ha : a.coeff 1 = 1) :
    ∃ S : Finset H, 1 ∉ S ∧ a = 1 + ∑ s ∈ S, MonoidAlgebra.single s 1 := by
  classical
  have hm : 1 ∈ a.coeff.support := Finsupp.mem_support_iff.mpr (ha ▸ one_ne_zero)
  refine ⟨a.coeff.support.erase 1, Finset.notMem_erase _ _, ?_⟩
  calc
    a = ∑ s ∈ a.coeff.support, MonoidAlgebra.single s (a.coeff s) :=
      (MonoidAlgebra.sum_coeff_single a).symm
    _ = MonoidAlgebra.single 1 (a.coeff 1) +
        ∑ s ∈ a.coeff.support.erase 1, MonoidAlgebra.single s (a.coeff s) :=
      (Finset.add_sum_erase _ _ hm).symm
    _ = _ := by
      rw [ha, ← MonoidAlgebra.one_def]
      congr 1
      apply Finset.sum_congr rfl
      intro s hs
      rw [zmodTwo_eq_one_of_ne_zero (a.coeff s)
        (Finsupp.mem_support_iff.mp (Finset.mem_of_mem_erase hs))]

lemma binary_coefficient_normalize (a : MonoidAlgebra (ZMod 2) H) (ha : a ≠ 0) :
    ∃ h : H, ∃ S : Finset H, 1 ∉ S ∧
      MonoidAlgebra.single h⁻¹ 1 * a = 1 + ∑ s ∈ S, MonoidAlgebra.single s 1 := by
  classical
  obtain ⟨h, hh⟩ : ∃ h, a.coeff h ≠ 0 := by
    by_contra! hn
    apply ha
    ext h
    exact hn h
  have he : (MonoidAlgebra.single h⁻¹ 1 * a).coeff 1 = 1 := by
    rw [MonoidAlgebra.coeff_single_mul_eq_mul_coeff h (by simp [inv_mul_eq_one, eq_comm])]
    exact one_mul _ |>.trans (zmodTwo_eq_one_of_ne_zero _ hh)
  obtain ⟨S, hS, he⟩ := binary_support_expansion _ he
  exact ⟨h, S, hS, he⟩
end GroupRingDeterminant

end

end OAI