openAI-math-dataset / lean /OAI /Algebra /AuslanderReiten /Tensor /ExternalBalancedShuffle.lean
roseking's picture
Add lean source and binary files (part 6)
2c7d975 verified
Raw History Blame Contribute Delete
3.25 kB
23
def scalarShuffle : Src ≃ₗ[k] BM ⊗[k] BN :=
body · 2 lines
  equiv (bimoduleCoordinates k A B M N) (ExternalTensor.moduleScalarCoordinates k A B X Y)
    (bimoduleCoordinates_right k A B M N) (fun _ _ _ _ => rfl)
27
@[simp] theorem scalarShuffle_pure (m : FM) (n : FN) (x : X) (y : Y) :
    scalarShuffle k A B M N X Y
      (BalancedTensor.tmul ((bimoduleCoordinates k A B M N).symm (m ⊗ₜ[k] n))
        ((ExternalTensor.moduleScalarCoordinates k A B X Y).symm (x ⊗ₜ[k] y))) =
      BalancedTensor.tmul (R := A) m x ⊗ₜ[k] BalancedTensor.tmul (R := B) n y :=
proof · 1 line
  equiv_pure _ _ _ _ m n x y
34
theorem scalarShuffle_smul (r : A ⊗[k] B) (z : Src) :
    scalarShuffle k A B M N X Y (r • z) =
      ExternalTensor.representation k A B BM BN r (scalarShuffle k A B M N X Y z) := by
proof · 18 lines
  induction r using TensorProduct.inductionOn with
  | add r s hr hs => simp only [add_smul, map_add, LinearMap.add_apply, hr, hs]
  | tmul a b =>
    induction z using BalancedTensor.induction_on with
    | zero => simp
    | add z w hz hw => simp only [smul_add, map_add, hz, hw]
    | tmul z w =>
      obtain ⟨z, rfl⟩ := (bimoduleCoordinates k A B M N).symm.surjective z
      obtain ⟨w, rfl⟩ := (ExternalTensor.moduleScalarCoordinates k A B X Y).symm.surjective w
      induction z using TensorProduct.inductionOn with
      | add z z' hz hz' => simp only [map_add, BalancedTensor.add_tmul, smul_add, hz, hz']
      | tmul m n =>
        induction w using TensorProduct.inductionOn with
        | add w w' hw hw' => simp only [map_add, BalancedTensor.tmul_add, smul_add, hw, hw']
        | tmul x y =>
          rw [BalancedTensor.smul_tmul, bimoduleCoordinates_left, scalarShuffle_pure,
            scalarShuffle_pure]
          rfl
56
def shuffle : Src ≃ₗ[A ⊗[k] B] Tgt where
body · 2 lines
  __ := (scalarShuffle k A B M N X Y).toAddEquiv
  map_smul' := scalarShuffle_smul k A B M N X Y
60
@[simp] theorem shuffle_pure (m : FM) (n : FN) (x : X) (y : Y) :
    shuffle k A B M N X Y
      (BalancedTensor.tmul ((bimoduleCoordinates k A B M N).symm (m ⊗ₜ[k] n))
        ((ExternalTensor.moduleScalarCoordinates k A B X Y).symm (x ⊗ₜ[k] y))) =
      (BalancedTensor.tmul (R := A) m x ⊗ₜ[k] BalancedTensor.tmul (R := B) n y : Tgt) :=
proof · 1 line
  scalarShuffle_pure k A B M N X Y m n x y