def
definition
F2Power
show as:
view math explainer →
open explainer
Generate a durable explainer page for this declaration.
open lean source
IndisputableMonolith.Algebra.F2Power on GitHub at line 49.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
used by
-
booker_count_eq_F2Power3_nonzero -
booker_seven_eq_2_pow_3_minus_1 -
card_eq_seven -
narrativeGeodesicCert -
NarrativeGeodesicCert -
narrative_geodesic_one_statement -
no_eighth_plot -
plot_composition_cancels_iff -
plot_count_scaling -
plotEncoding -
plotEncoding_image_eq_nonzero -
plotEncoding_image_nonzero -
plotWeight -
Q3_nontrivial_subgroup_count -
singleAxis_plots -
three_act_resolution_below_climax -
threeAxis_plots -
twoAxis_plots -
add_apply -
add_self -
axis1 -
axis12 -
axis123 -
axis123_weight -
axis13 -
axis2 -
axis23 -
axis3 -
card_eq -
card_weight_zero_three -
hammingWeight -
hammingWeight_le -
hammingWeight_zero -
neg_eq_self -
nonzero_card -
nonzero_card_three -
oneDimSubspace -
oneDimSubspace_card -
oneDimSubspace_closed -
sub_eq_add
formal source
46
47/-- The elementary abelian 2-group of rank `D`, modeled as
48 `Fin D → Bool` with pointwise XOR. -/
49def F2Power (D : ℕ) : Type := Fin D → Bool
50
51namespace F2Power
52
53variable {D : ℕ}
54
55instance : DecidableEq (F2Power D) := by
56 unfold F2Power; infer_instance
57
58instance : Fintype (F2Power D) := by
59 unfold F2Power; infer_instance
60
61instance : Inhabited (F2Power D) := by
62 unfold F2Power; infer_instance
63
64/-- The zero element: all coordinates `false`. -/
65instance : Zero (F2Power D) := ⟨fun _ => false⟩
66
67@[simp] theorem zero_apply (i : Fin D) : (0 : F2Power D) i = false := rfl
68
69/-- Pointwise XOR. -/
70instance : Add (F2Power D) := ⟨fun u v => fun i => xor (u i) (v i)⟩
71
72@[simp] theorem add_apply (u v : F2Power D) (i : Fin D) :
73 (u + v) i = xor (u i) (v i) := rfl
74
75/-- Negation in characteristic 2 is the identity. -/
76instance : Neg (F2Power D) := ⟨fun v => v⟩
77
78@[simp] theorem neg_eq_self (v : F2Power D) : -v = v := rfl
79