File size: 2,258 Bytes
cdec422
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.LinearAlgebra.MatrixMultiplication.FieldGroups.NativeLaws

namespace OAI

/-! Group assignments, orbit counts and extraction capacities. -/

noncomputable section

namespace MatrixMultiplication.AllFieldGroupBranchDesignation

open AllFieldHistory AllFieldHistoryChildLaws AllFieldGroupOrbitData
open AllFieldGroupNativeLaws
attribute [local instance] Classical.propDecidable Classical.decEq

def nativeBranchDesignated {K : ℕ} (w : Work K) (right : Bool)
    (side : Fin 3) (b : w.Branch) : Prop :=
  w.stage ≠ 2 ∧ AllFieldNativeCapacity.designated w.priority side
    (halfShape w.parentShape (w.splitShape b) right)

theorem sharing_iff_stage_ne_two {K tick : ℕ} {sigma : Placement}
    (h : ActiveOrder K tick sigma) :
    sharing h = true ↔ h.val.val.1.stage ≠ 2 := by
  rcases h with ⟨⟨⟨work, _⟩, _⟩, _⟩
  cases work <;> simp [sharing, Work.stage]

theorem order_branch_childWeight {K tick : ℕ} {sigma : Placement}
    (right : Bool) (h : ActiveOrder K tick sigma) (side : Fin 3)
    (b : h.val.val.1.Branch) :
    childWeight right h.val (branchShape h.val.val b) (sigma side) =
      (halfShape h.val.val.1.parentShape (h.val.val.1.splitShape b) right)
        (h.val.val.1.priority side) := by
  rw [← halfShape_childWeight, canonicalChildShape_branchShape,
    placement_symm_order_side]

theorem designated_branchShape {K tick : ℕ} {sigma : Placement}
    (right : Bool) (side : Fin 3) (h : ActiveOrder K tick sigma)
    (hside : side ≠ 0) (b : h.val.val.1.Branch) :
    AllFieldGroupOrbitData.designated right side sigma h (branchShape h.val.val b) ↔
      nativeBranchDesignated h.val.val.1 right side b := by
  change (sharing h = true ∧
    (if side = 1 then childWeight right h.val (branchShape h.val.val b) (sigma 2) = 0
      else if side = 2 then
        childWeight right h.val (branchShape h.val.val b) (sigma 0) *
          childWeight right h.val (branchShape h.val.val b) (sigma 1) = 0
      else False)) ↔ _
  rw [sharing_iff_stage_ne_two]
  simp only [order_branch_childWeight, nativeBranchDesignated,
    AllFieldNativeCapacity.designated]
  fin_cases side
  · exact False.elim (hside rfl)
  · simp
  · simp

end MatrixMultiplication.AllFieldGroupBranchDesignation

end

end OAI