Skip to content
Open
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
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⁻¹, 1⟩ 1
def AddGroup (T: Type) [Add T] [Neg T] [OfNat T 0]: Type := @Group T ⟨fun a b => a + b, fun a => -a, 0⟩ 0
-- 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