All proofs
Project-declaredLean 4.31.0 · null

Of Type wf

Cedar.Thm.ofType_wf

Plain-language statement

TermType.ofType of well-formed CedarType is well-formed (under the compiled SymEnv).

Exact Lean statement

theorem ofType_wf
  {Γ : TypeEnv} {ty : CedarType}
  (hwf : Γ.WellFormed)
  (hwf_ty : CedarType.WellFormed Γ ty) :
  (TermType.ofType ty).WellFormed (SymEnv.ofEnv Γ).entities

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem ofType_wf  {Γ : TypeEnv} {ty : CedarType}  (hwf : Γ.WellFormed)  (hwf_ty : CedarType.WellFormed Γ ty) :  (TermType.ofType ty).WellFormed (SymEnv.ofEnv Γ).entities:= by  cases ty with  | bool _ | int | string | ext _ => constructor  | entity ety =>    constructor    cases hwf_ty with | entity_wf hwf_ety =>    apply ofEnv_wf_entity hwf hwf_ety  | set sty =>    constructor    cases hwf_ty with | set_wf hwf_sty =>    exact ofType_wf hwf hwf_sty  | record rty =>    cases hwf_ty with | record_wf hwf_rty hwf_attrs =>    simp only [TermType.ofType, ofRecordType_eq_map]    constructor    · intros attr attr_ty hfind_attr      have := Map.find?_mem_toList hfind_attr      simp only [Map.toList_mk_id, List.mem_map, Prod.mk.injEq, Prod.exists] at this      replace a, qty, hmem, _, this := this ; subst a attr_ty      have hfind := hwf_attrs attr qty      have := (Map.in_list_iff_find?_some hwf_rty).mp hmem      specialize hfind this      cases hqty : qty with      | optional attr_ty' | required attr_ty' =>        simp only [hqty, TermType.ofQualifiedType] at hfind         cases hfind with | _ hfind =>        try constructor        exact ofType_wf hwf hfind    · apply Map.mapOnValues_wf.mp      exact hwf_rty
Project
Cedar Specification
License
Apache-2.0
Commit
3f093947b8ae
Source
cedar-lean/Cedar/Thm/SymCC/Env/ofEnv.lean:388-422

Reuse this declaration

Bring the exact result into your workflow

The import identifies the source module. Your project still needs the pinned package dependency shown on this page.

What this badge means

This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.

Continue in this project

Related declarations

Project-declaredLean 4.31.0

Find? ext

Cedar.Data.Map.find?_ext

Plain-language statement

Two well-formed maps are equal if they have the same find? for every key.

authorizationprogram verificationsemantics

Source project: Cedar Specification

Person-level attribution pending.

View proof record
Project-declaredLean 4.31.0

Find? notmem keys

Cedar.Data.Map.find?_notmem_keys

Plain-language statement

Inverse of find?_mem_toList, except that this requires wf

authorizationprogram verificationsemantics

Source project: Cedar Specification

Person-level attribution pending.

View proof record
Project-declaredLean 4.31.0

Find? some iff in values

Cedar.Data.Map.find?_some_iff_in_values

Plain-language statement

The mp direction of this does not need the wf precondition and, in fact, is available separately as find?_some_implies_in_values above

authorizationprogram verificationsemantics

Source project: Cedar Specification

Person-level attribution pending.

View proof record