File size: 4,588 Bytes
7f5fab8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import OAI.AlgebraicGeometry.CharacterVarieties.Frames.FramedFlags

namespace OAI

/-!
# Transport of local frames along seams

The column and parent coordinate identifications transport local frame matrices
between the two ends of a surface seam.
-/

noncomputable section
namespace IntegralCharacterVarieties.SurfacePresentation.Diagram
open scoped Classical Matrix
open OccurrenceIncidence VertexTable MatrixExpression
variable {F S V R : Type} {arity : S → ℕ} [CommRing R]
    (D : Diagram F S V arity)
lemma portParentMatch_index (p u : LocalPort V D.ports.kind)
    (h : (D.ports.attach p).1=(D.ports.attach u).1) :
    (D.portParentMatch p u h).trans (D.portRowIndex u)=
      (D.portRowIndex p).trans (finCongr (congrArg D.seamDim h)) := by
  apply Equiv.ext
  intro i
  apply Fin.ext
  rfl
lemma localFrameUnit_match (f : D.PortFrames (R:=R)) (p u : LocalPort V D.ports.kind)
    (h : (D.ports.attach p).1=(D.ports.attach u).1)
    (hs : (f u).reindex (D.portColumnMatch p u h) (D.portParentMatch p u h)=f p) :
    (MatrixIso.unit (D.localFrameUnit f u)).reindex
      (finCongr (congrArg D.seamDim h)) (finCongr (congrArg D.seamDim h))=
      MatrixIso.unit (D.localFrameUnit f p) := by
  have hh := congrArg (fun z => z.reindex (D.portColumnIndex p).symm (D.portRowIndex p).symm) hs
  simp only [MatrixIso.reindex_reindex_eq,D.portColumnMatch_from_index,D.portParentMatch_from_index] at hh
  simpa only [localFrameUnit,MatrixIso.unit_toUnit,MatrixIso.reindex_reindex_eq] using hh
lemma localFrameUnit_rebase_match (f : D.PortFrames (R:=R)) (p u : LocalPort V D.ports.kind)
    (h : (D.ports.attach p).1=(D.ports.attach u).1)
    (hs : (f u).reindex (D.portColumnMatch p u h) (D.portParentMatch p u h)=f p) :
    rebaseUnit (congrArg D.seamDim h).symm (D.localFrameUnit f u)=D.localFrameUnit f p := by
  have hh := D.localFrameUnit_match f p u h hs
  have he : finCongr (congrArg D.seamDim h)=finCongr (congrArg D.seamDim h).symm.symm := rfl
  rw [he,←rebaseUnit_iso] at hh
  exact congrArg MatrixIso.toUnit hh
lemma frameValues_match (f : D.PortFrames (R:=R)) (p u : LocalPort V D.ports.kind)
    (h : (D.ports.attach p).1=(D.ports.attach u).1)
    (hs : (f u).reindex (D.portColumnMatch p u h) (D.portParentMatch p u h)=f p) :
    rebaseUnit (congrArg D.seamDim h).symm
      (D.frameValues f (D.ports.attach u).1 (D.ports.attach u).2)=
      D.frameValues f (D.ports.attach p).1 (D.ports.attach p).2 := by
  rw [D.frameValues_attach,D.frameValues_attach]
  exact D.localFrameUnit_rebase_match f p u h hs
lemma frameValues_seam_of_ports (f : D.PortFrames (R:=R))
    (p u : LocalPort V D.ports.kind) (s : S)
    (hp : D.ports.attach p=(s,false)) (hu : D.ports.attach u=(s,true))
    (h : (D.ports.attach p).1=(D.ports.attach u).1)
    (hs : (f u).reindex (D.portColumnMatch p u h) (D.portParentMatch p u h)=f p) :
    D.frameValues f s false=D.frameValues f s true := by
  have hh := D.frameValues_match f p u h hs
  have aux {a b : S × Bool} (ha : a=(s,false)) (hb : b=(s,true))
      (he : a.1=b.1)
      (ht : rebaseUnit (congrArg D.seamDim he).symm
        (D.frameValues f b.1 b.2)=D.frameValues f a.1 a.2) :
      D.frameValues f s false=D.frameValues f s true := by
    subst a
    subst b
    simpa only [rebaseUnit_refl] using ht.symm
  exact aux hp hu h hh
lemma attachedEnds_same (s : S) :
    (D.ports.attach (D.ports.attach.symm (s,false))).1=
      (D.ports.attach (D.ports.attach.symm (s,true))).1 := by
  simp only [Equiv.apply_symm_apply]
lemma frameValues_seam_match (f : D.PortFrames (R:=R)) (s : S)
    (hs : (f (D.ports.attach.symm (s,true))).reindex
      (D.portColumnMatch (D.ports.attach.symm (s,false)) (D.ports.attach.symm (s,true))
        (D.attachedEnds_same s))
      (D.portParentMatch (D.ports.attach.symm (s,false)) (D.ports.attach.symm (s,true))
        (D.attachedEnds_same s))=f (D.ports.attach.symm (s,false))) :
    D.frameValues f s false=D.frameValues f s true := by
  have hh := D.frameValues_match f (D.ports.attach.symm (s,false))
    (D.ports.attach.symm (s,true)) (D.attachedEnds_same s) hs
  have aux {a b : S × Bool} (ha : a=(s,false)) (hb : b=(s,true))
      (he : a.1=b.1)
      (ht : rebaseUnit (congrArg D.seamDim he).symm
        (D.frameValues f b.1 b.2)=D.frameValues f a.1 a.2) :
      D.frameValues f s false=D.frameValues f s true := by
    subst a
    subst b
    simpa only [rebaseUnit_refl] using ht.symm
  exact aux (D.ports.attach.apply_symm_apply (s,false))
    (D.ports.attach.apply_symm_apply (s,true)) (D.attachedEnds_same s) hh
end IntegralCharacterVarieties.SurfacePresentation.Diagram
end

end OAI