roseking's picture
Add lean source and binary files (part 6)
2c7d975 verified
Raw History Blame Contribute Delete
2.77 kB
17
theorem tmul_sum (f : F) (s : Finset ι) (m : ι → M) :
    tmul (k := k) (R := R) f (∑ i ∈ s, m i) = ∑ i ∈ s, tmul f (m i) := by
proof · 1 line
  exact map_sum (mk (k := k) (R := R) f) m s
21
def piRightMap : BalancedTensor k R F (ι → M) →ₗ[S] (ι → BalancedTensor k R F M) :=
body · 1 line
  LinearMap.pi fun i => mapRight (k := k) (S := S) (LinearMap.proj i)
25
@[simp] theorem piRightMap_tmul (f : F) (m : ι → M) (i : ι) :
    piRightMap (S := S) (tmul f m : BalancedTensor k R F (ι → M)) i = tmul f (m i) := rfl
28
def piRightInv : (ι → BalancedTensor k R F M) →ₗ[S] BalancedTensor k R F (ι → M) where
body · 3 lines
  toFun z := ∑ i, mapRight (k := k) (S := S) (LinearMap.single R (fun _ : ι => M) i) (z i)
  map_add' x y := by simp only [Pi.add_apply, map_add, Finset.sum_add_distrib]
  map_smul' s z := by simp only [Pi.smul_apply, map_smul, RingHom.id_apply, Finset.smul_sum]
34
theorem piRightMap_single (i j : ι) (z : BalancedTensor k R F M) :
    piRightMap (S := S) (mapRight (k := k) (S := S) (LinearMap.single R (fun _ : ι => M) j) z) i = if i = j then z else 0 := by
proof · 10 lines
  induction z using induction_on with
  | zero => simp
  | tmul f m =>
    simp only [mapRight_tmul, piRightMap_tmul, LinearMap.single_apply]
    by_cases h : i = j
    · subst i; simp
    · simp [h]
  | add x y hx hy =>
    simp only [map_add, Pi.add_apply, hx, hy]
    split_ifs <;> simp
47
def piRight : BalancedTensor k R F (ι → M) ≃ₗ[S] (ι → BalancedTensor k R F M) where
body · 17 lines
  __ := piRightMap
  invFun := piRightInv
  right_inv z := by
    ext i
    change piRightMap (S := S) (∑ j, mapRight (k := k) (S := S) (LinearMap.single R (fun _ : ι => M) j) (z j)) i = z i
    simp only [map_sum, Finset.sum_apply, piRightMap_single]
    simp
  left_inv z := by
    change piRightInv (S := S) (piRightMap (S := S) z) = z
    induction z using induction_on with
    | zero => simp
    | tmul f m =>
      change (∑ i, tmul (k := k) (R := R) f (Pi.single i (m i))) = tmul f m
      rw [← tmul_sum]
      congr
      exact Finset.univ_sum_single m
    | add x y hx hy => simp only [map_add, hx, hy]