Skip to content

Commit

Permalink
Possible alternative group representation
Browse files Browse the repository at this point in the history
  • Loading branch information
kaleidawave committed Mar 3, 2024
1 parent b2d9b67 commit 316fe5d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions Mathematics/Experiments/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
most of these don't work
47 changes: 47 additions & 0 deletions Mathematics/Experiments/alternative_group_representation.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
structure GroupLike (T: Type) where
bop : T → T → T
inv : T → T
id : T

section group

-- TODO local
variable { T: Type } { on: GroupLike T }

-- TODO can this be moved into the class definition?
set_option quotPrecheck false
infix:100 "" => on.bop
local postfix:120 "⁻¹" => on.inv

class Group (id := on.id) where
associativity : ∀ a b c: T, a ⋆ (b ⋆ c) = (a ⋆ b) ⋆ c
identity : ∀ a: T, a ⋆ id = a ∧ id ⋆ a = a
inverse : ∀ a: T, (a⁻¹ ⋆ a) = id ∧ (a ⋆ a⁻¹) = id

end group

class Inv (T : Type) where
inv : T → T

postfix:max "⁻¹" => Inv.inverse

def MulGroup (T: Type) [Mul T] [Inv T] [OfNat T 1]: Type := @Group T ⟨fun a b => a * b, fun a => a⁻¹, 11
def AddGroup (T: Type) [Add T] [Neg T] [OfNat T 0]: Type := @Group T ⟨fun a b => a + b, fun a => -a, 00
-- TODO ComposeGroup

namespace theorems

variable { T: Type } {on: GroupLike T} {g: @Group T on on.id} { a b c: T }

set_option quotPrecheck false
infix:100 "" => on.bop
postfix:120 "⁻¹" => on.inverse

theorem left_identity : on.id ⋆ a = a := (g.identity a).2
theorem right_identity : a ⋆ on.id = a := (g.identity a).1

-- does't work :(
theorem inv_inv : (a⁻¹)⁻¹ = a := by
rw [←left_identity (a⁻¹)⁻¹] -- ...

end theorems

0 comments on commit 316fe5d

Please sign in to comment.