-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Possible alternative group representation
- Loading branch information
1 parent
b2d9b67
commit 316fe5d
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
47
Mathematics/Experiments/alternative_group_representation.lean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |