Plain-language statement
If typechecking succeeds, then for any request consistent with the schema, either (1) evaluation produces a boolean or (2) it returns an error of type entityDoesNotExist, extensionError, or arithBoundsError. Both options are encoded in the EvaluatesTo predicate. The type checker cannot protect against these errors because it has no knowledge of th...
Exact Lean statement
theorem typecheck_is_sound (policy : Policy) (env : TypeEnv) (t : CedarType) (request : Request) (entities : Entities) : InstanceOfWellFormedEnvironment request entities env → typecheck policy env = .ok t → (∃ (b : Bool), EvaluatesTo policy.toExpr request entities b)
Formal artifact
Lean source
theorem typecheck_is_sound (policy : Policy) (env : TypeEnv) (t : CedarType) (request : Request) (entities : Entities) : InstanceOfWellFormedEnvironment request entities env → typecheck policy env = .ok t → (∃ (b : Bool), EvaluatesTo policy.toExpr request entities b):= by intro h₁ h₂ simp [typecheck] at h₂ cases h₃ : (typeOf (Policy.toExpr policy) [] env).typeOf <;> simp [h₃] at h₂ split at h₂ <;> simp at h₂ rename_i ht have hc := empty_capabilities_invariant request entities split_type_of h₃ ; rename_i h₃ have ⟨_, v, h₄, h₅⟩ := type_of_is_sound hc h₁ h₃ simp at h₂ rw [h₂] at ht h₅ have ⟨b, h₆⟩ := instance_of_type_bool_is_bool v t h₅ ht subst h₆ exists b- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/Typechecking.lean:43-60
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.