Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(algebra/*): Add ring instances to clifford_algebra and exterior_…
…algebra (#4916) To do this, this removes the `irreducible` attributes. These attributes were present to try and "insulate" the quotient / generator based definitions, and force downstream proofs to use the universal property. Unfortunately, this irreducibility created massive headaches in typeclass resolution, and the tradeoff for neatness vs usability just isn't worth it. If someone wants to add back the `irreducible` attributes in future, they now have test-cases that force them not to break the `ring` instances when doing so.
- Loading branch information
1 parent
1ada09b
commit 34b7361
Showing
7 changed files
with
68 additions
and
9 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
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
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
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
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
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
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 @@ | ||
/- | ||
Copyright (c) 2020 Scott Morrison. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Eric Wieser | ||
-/ | ||
|
||
import linear_algebra.exterior_algebra | ||
import linear_algebra.clifford_algebra | ||
|
||
/-! | ||
Tests that the ring instances for `free_algebra` and derived quotient types actually work. | ||
There is some discussion about this in | ||
https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/algebra.2Esemiring_to_ring.20breaks.20semimodule.20typeclass.20lookup/near/212580241 | ||
In essence, the use of `attribute [irreducible] the_type` was breaking instance resolution on that | ||
type. | ||
-/ | ||
|
||
variables {S : Type*} {M : Type*} | ||
|
||
|
||
section free | ||
|
||
variables [comm_ring S] | ||
|
||
example : (1 : free_algebra S M) - (1 : free_algebra S M) = 0 := by rw sub_self | ||
|
||
end free | ||
|
||
|
||
section exterior | ||
|
||
variables [comm_ring S] [add_comm_monoid M] [semimodule S M] | ||
|
||
example : (1 : exterior_algebra S M) - (1 : exterior_algebra S M) = 0 := by rw sub_self | ||
|
||
end exterior | ||
|
||
|
||
section clifford | ||
|
||
variables [comm_ring S] [add_comm_group M] [semimodule S M] (Q : quadratic_form S M) | ||
|
||
example : (1 : clifford_algebra Q) - (1 : clifford_algebra Q) = 0 := by rw sub_self | ||
|
||
end clifford |