Theoremsc_top
Statement
theorem sc_top : (a : ATopDec) → (C : Ctx) → (Γ : Shape) → (E : Env) → (PE : PortEnv) → Abs C Γ →
checkTopDec C a = some (E, PE) → scTop Γ a.erase = true
| .value VE vb, C, Γ, E, PE, hA, h => by
simp only [checkTopDec] at h
split at h
· rename_i hc
simp only [Bool.and_eq_true, decide_eq_true_eq] at hc
replace hcProof
hc.1
simp only [ATopDec.erase, scTop]
have hk : KeysIn VE (vbVars vb.erase) := hc.2 ▸ keys_valBind vb
exact sc_valBind vb _ _ (abs_plusVE hA hk) hc.1
· cases h
| .types _ _ _ _, _, _, _, _, _, _ => rfl
| .port _ _ _, _, _, _, _, _, _ => rfl
| .seq a1 a2, C, Γ, E, PE, hA, h => by
simp only [checkTopDec] at h
split at h
· rename_i E1 PE1 h1
split at h
· rename_i E2 PE2 h2
have s1 := topSound a1 C E1 PE1 h1
simp only [ATopDec.erase, scTop, Bool.and_eq_true]
exact ⟨sc_top a1 C Γ E1 PE1 hA h1,
sc_top a2 _ _ E2 PE2 (abs_ext hA s1.2 (lookupExt_oplusE C s1.1)) h2⟩
· cases h
· cases hProved by a term, which Lean's kernel checks directly.
Theorems it uses
Used by
In StandardElmMech/Stat/RefuseScope.lean: Refusals by scope, constructor arity and imports, for one module and for a module after a helper (scopeFailB).
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.