Plain-language statement
If a set of policies is well-typed (valid) with respect to the schema according to the validator, and the input request and entities are consistent with the schema, then evaluating a policy in this set either produces a boolean value, or throws an error of type entityDoesNotExist, extensionError, or arithBoundsError. These errors cannot be protected...
Exact Lean statement
theorem validation_is_sound (policies : Policies) (schema : Schema) (request : Request) (entities : Entities) : schema.validateWellFormed = .ok () → validate policies schema = .ok () → validateRequest schema request = .ok () → validateEntities schema entities = .ok () → AllEvaluateToBool policies request entities
Formal artifact
Lean source
theorem validation_is_sound (policies : Policies) (schema : Schema) (request : Request) (entities : Entities) : schema.validateWellFormed = .ok () → validate policies schema = .ok () → validateRequest schema request = .ok () → validateEntities schema entities = .ok () → AllEvaluateToBool policies request entities:= by intro hwf h₀ h₁ h₂ have h₁ := request_and_entities_validate_implies_instance_of_wf_schema schema request entities hwf h₁ h₂ unfold validate at h₀ simp only [AllEvaluateToBool] cases h₃ : policies with | nil => simp only [List.not_mem_nil, false_implies, implies_true] | cons h' t' => intro policy pin simp only [EvaluatesToBool] apply typecheck_policy_with_environments_is_sound policy schema request entities h₁ subst h₃ simp only [List.forM_eq_forM, List.forM_cons] at h₀ simp_do_let (typecheckPolicyWithEnvironments typecheckPolicy h' schema) as h₄ at h₀ case ok _ => rw [List.mem_cons] at pin cases pin with | inl h₅ => subst h₅ exact h₄ | inr h₅ => apply List.forM_ok_implies_all_ok t' (typecheckPolicyWithEnvironments _ · schema) repeat assumption- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/Validation.lean:51-79
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.