Level based no dne get attr record
Cedar.Thm.level_based_no_dne_get_attr_record
Plain-language statement
Record branch. No entity is dereferenced, so the outer lookup is a record projection (attrDoesNotExist at worst). Only the inner expression e could DNE, and the IH rules that out.
Exact Lean statement
theorem level_based_no_dne_get_attr_record {e : Expr} {tx₁ : TypedExpr} {ty : CedarType} {rty : RecordType} {a : Attr} {n : Nat} {c₀ c₁ : Capabilities} {env : TypeEnv} {request : Request} {entities : Entities}
(hc : CapabilitiesInvariant c₀ request entities)
(hr : InstanceOfWellFormedEnvironment request entities env)
(hcl : EntitiesClosedAtLevel entities request n)
(hl : (tx₁.getAttr a ty).AtLevel env n)
(ht : typeOf e c₀ env = Except.ok (tx₁, c₁))
(hrty : tx₁.typeOf = CedarType.record rty)
(ihe : TypedAtLevelHasNoDNEError e) :
evaluate (.getAttr e a) request entities ≠ .error .entityDoesNotExistFormal artifact
Lean source
theorem level_based_no_dne_get_attr_record {e : Expr} {tx₁ : TypedExpr} {ty : CedarType} {rty : RecordType} {a : Attr} {n : Nat} {c₀ c₁ : Capabilities} {env : TypeEnv} {request : Request} {entities : Entities} (hc : CapabilitiesInvariant c₀ request entities) (hr : InstanceOfWellFormedEnvironment request entities env) (hcl : EntitiesClosedAtLevel entities request n) (hl : (tx₁.getAttr a ty).AtLevel env n) (ht : typeOf e c₀ env = Except.ok (tx₁, c₁)) (hrty : tx₁.typeOf = CedarType.record rty) (ihe : TypedAtLevelHasNoDNEError e) : evaluate (.getAttr e a) request entities ≠ .error .entityDoesNotExist:= by cases hl case getAttr hety => simp [hety] at hrty rename_i hl₁ simp only [evaluate] have ⟨ hgc, v, he, hi ⟩ := type_of_is_sound hc hr ht unfold EvaluatesTo at he rcases he with he | he | he | he · exact absurd he (ihe hc hr hcl ht hl₁) · simp [he] · simp [he] · rw [hrty] at hi obtain ⟨ attrs, hv ⟩ := instance_of_record_type_is_record hi subst hv simp only [he, Except.bind_ok, getAttr, attrsOf, Map.findOrErr] split <;> simp- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/Validation/Levels/NoEntitiesError.lean:494-519
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
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.
Source project: Cedar Specification
Person-level attribution pending.
Find? notmem keys
Cedar.Data.Map.find?_notmem_keys
Plain-language statement
Inverse of find?_mem_toList, except that this requires wf
Source project: Cedar Specification
Person-level attribution pending.
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
Source project: Cedar Specification
Person-level attribution pending.