cfahlgren1/math / lean /OAI /NumberTheory /Ostmann /Construction /CanonicalOccurrenceTransportScalarTreeBasic.lean
cfahlgren1's picture
download
raw
1.43 kB
10
def rootCode {ι : Type} : {l : ℕ}→TreeCode ι l→StateCode ι
body · 2 lines
  | 0,e=>e
  | _+1,e=>e.1
14
def Plan.rootFrequency : {l : ℕ}→Plan l→ℤ
body · 2 lines
  | _,.leaf s=>s
  | _,.node s _ _ _ _ _ _ _ _=>s
18
def Plan.leftPlan {l : ℕ} : Plan (l+1)→Plan l
body · 1 line
  | .node _ _ _ _ _ _ _ left _=>left
21
def Plan.rightPlan {l : ℕ} : Plan (l+1)→Plan l
body · 1 line
  | .node _ _ _ _ _ _ _ _ right=>right
24
lemma rootCode_treeCode {ι : Type} {l : ℕ} (h : History l) (e : TreeExpr ι h) :
    rootCode (treeCode h e)=stateCode (treeRoot h e) := by cases h <;> rfl
27
lemma treeRoot_plus_eq_of_code {ι : Type} {l : ℕ} {h g : History l}
    (e : TreeExpr ι h) (f : TreeExpr ι g) (hc : treeCode h e=treeCode g f) :
    (treeRoot h e).plus=(treeRoot g f).plus := by
proof · 3 lines
  have hh := congrArg rootCode hc
  rw [rootCode_treeCode,rootCode_treeCode] at hh
  exact congrArg StateCode.plus hh
34
lemma plan_rootFrequency {l : ℕ} {V : ℕ→ℕ} {outside : List ℕ}
    (h : History l) (hs : h.Supported V outside) :
    (plan h hs).rootFrequency=h.root.frequency := by cases h <;> rfl

Xet Storage Details

Size:
1.43 kB
·
Xet hash:
0a345cf0016f8112983e4aa2a463df029f092050995844e766b36f450a611acb

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.