File size: 2,851 Bytes
4a56cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import Mathlib.Algebra.Category.ModuleCat.Basic
import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects
import Mathlib.LinearAlgebra.Pi

namespace OAI
noncomputable section
open CategoryTheory CategoryTheory.Limits
namespace LittleFinitistic.FiniteSupportReindex
universe u
variable {R : Type u} [Ring R]
variable (V : β„€ β†’ ModuleCat.{u} R)
variable {l m : β„•} (p : Fin l β†’ β„€) (q : Fin m β†’ β„€)

/-- Extend a finite family of actual components by zero in every other degree. -/
def coefficient (n : β„€) : (βˆ€ i, V (p i)) β†’β‚—[R] V n := by
  classical
  exact if h : βˆƒ i, p i = n then
    ((eqToHom (congrArg V h.choose_spec)).hom).comp (LinearMap.proj h.choose)
  else 0

@[simp] theorem coefficient_at (hp : Function.Injective p) (i : Fin l) (x : βˆ€ i, V (p i)) :
    coefficient V p (p i) x = x i := by
  classical
  unfold coefficient
  split_ifs with h
  Β· have transport (j : Fin l) (hji : j=i) (hpi : p j=p i) :
        (eqToHom (congrArg V hpi)).hom (x j) = x i := by
      subst j
      rfl
    exact transport h.choose (hp h.choose_spec) h.choose_spec
  · exact False.elim (h ⟨i,rfl⟩)

theorem coefficient_outside (n : β„€) (hn : βˆ€ i, p i β‰  n) : coefficient V p n = 0 := by
  classical
  exact dite_eq_right (by simpa only [not_exists] using hn)

/-- Read the same family using another finite set of support degrees. -/
def reindex : (βˆ€ i, V (p i)) β†’β‚—[R] (βˆ€ j, V (q j)) :=
  LinearMap.pi (fun j => coefficient V p (q j))

@[simp] theorem reindex_apply (x : βˆ€ i, V (p i)) (j : Fin m) :
    reindex V p q x j = coefficient V p (q j) x := rfl

theorem coefficient_reindex (hq : Function.Injective q)
    (hV : βˆ€ n, (βˆ€ j, q j β‰  n) β†’ IsZero (V n))
    (n : β„€) (x : βˆ€ i, V (p i)) :
    coefficient V q n (reindex V p q x) = coefficient V p n x := by
  classical
  by_cases h : βˆƒ j, q j=n
  · obtain ⟨j,rfl⟩ := h
    rw [coefficient_at V q hq,reindex_apply]
  Β· let := ModuleCat.subsingleton_of_isZero (hV n (by simpa only [not_exists] using h))
    exact Subsingleton.elim _ _

/-- Changing finite support indices adds or removes only zero terms. The maps
are the actual coordinate inclusions/projections, including all degree transports. -/
def equivalence (hp : Function.Injective p) (hq : Function.Injective q)
    (hVp : βˆ€ n, (βˆ€ i, p i β‰  n) β†’ IsZero (V n))
    (hVq : βˆ€ n, (βˆ€ j, q j β‰  n) β†’ IsZero (V n)) :
    (βˆ€ i, V (p i)) ≃ₗ[R] (βˆ€ j, V (q j)) where
  __ := reindex V p q
  invFun := reindex V q p
  left_inv x := by
    funext i
    change coefficient V q (p i) (reindex V p q x) = x i
    rw [coefficient_reindex V p q hq hVq,coefficient_at V p hp]
  right_inv x := by
    funext j
    change coefficient V p (q j) (reindex V q p x) = x j
    rw [coefficient_reindex V q p hp hVp,coefficient_at V q hq]
end LittleFinitistic.FiniteSupportReindex

end

end OAI