Skip to content

Commit

Permalink
feat(ring_theory/tensor_product): add assoc for tensor product as an …
Browse files Browse the repository at this point in the history
…algebra homomorphism (#13309)

By speeding up a commented out def, this goes from from ~100s to ~7s on my machine .


Co-authored-by: Scott Morrison <scott@tqft.net>
  • Loading branch information
alexjbest and semorrison committed Apr 13, 2022
1 parent 0c3f75b commit 9913860
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/ring_theory/tensor_product.lean
Expand Up @@ -664,23 +664,21 @@ lemma assoc_aux_2 (r : R) :
(tensor_product.assoc R A B C) (((algebra_map R A) r ⊗ₜ[R] 1) ⊗ₜ[R] 1) =
(algebra_map R (A ⊗ (B ⊗ C))) r := rfl

-- variables (R A B C)
variables (R A B C)

-- -- local attribute [elab_simple] alg_equiv_of_linear_equiv_triple_tensor_product
/-- The associator for tensor product of R-algebras, as an algebra isomorphism. -/
protected def assoc : ((A ⊗[R] B) ⊗[R] C) ≃ₐ[R] (A ⊗[R] (B ⊗[R] C)) :=
alg_equiv_of_linear_equiv_triple_tensor_product
(tensor_product.assoc.{u v₁ v₂ v₃} R A B C : (A ⊗ B ⊗ C) ≃ₗ[R] (A ⊗ (B ⊗ C)))
(@algebra.tensor_product.assoc_aux_1.{u v₁ v₂ v₃} R _ A _ _ B _ _ C _ _)
(@algebra.tensor_product.assoc_aux_2.{u v₁ v₂ v₃} R _ A _ _ B _ _ C _ _)

-- /-- The associator for tensor product of R-algebras, as an algebra isomorphism. -/
-- -- FIXME This is _really_ slow to compile. :-(
-- protected def assoc : ((A ⊗[R] B) ⊗[R] C) ≃ₐ[R] (A ⊗[R] (B ⊗[R] C)) :=
-- alg_equiv_of_linear_equiv_triple_tensor_product
-- (tensor_product.assoc R A B C)
-- assoc_aux_1 assoc_aux_2

-- variables {R A B C}
variables {R A B C}

-- @[simp] theorem assoc_tmul (a : A) (b : B) (c : C) :
-- ((tensor_product.assoc R A B C) :
-- (A ⊗[R] B) ⊗[R] C → A ⊗[R] (B ⊗[R] C)) ((a ⊗ₜ b) ⊗ₜ c) = a ⊗ₜ (b ⊗ₜ c) :=
-- rfl
@[simp] theorem assoc_tmul (a : A) (b : B) (c : C) :
((tensor_product.assoc R A B C) :
(A ⊗[R] B) ⊗[R] C → A ⊗[R] (B ⊗[R] C)) ((a ⊗ₜ b) ⊗ₜ c) = a ⊗ₜ (b ⊗ₜ c) :=
rfl

end

Expand Down

0 comments on commit 9913860

Please sign in to comment.