All proofs
Project-declaredLean 4.31.0 · null

Evaluate Policy ok implies well formed env

Cedar.Thm.evaluatePolicy_ok_implies_well_formed_env

Plain-language statement

If evaluatePolicy succeeds on a concrete request, and the schema and entities pass validation, then InstanceOfWellFormedEnvironment holds for the environment determined by the schema and request.

Exact Lean statement

theorem evaluatePolicy_ok_implies_well_formed_env
  {schema : Schema} {p : Policy} {req : Request} {es : Entities} {r : Residual} :
  evaluatePolicy schema p req.asPartialRequest Map.empty = .ok r →
  schema.validateWellFormed = .ok () →
  validateEntities schema es = .ok () →
  ∃ env,
    schema.environment? req.asPartialRequest.principal.ty req.asPartialRequest.resource.ty req.asPartialRequest.action = .some env ∧
    InstanceOfWellFormedEnvironment req es env

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem evaluatePolicy_ok_implies_well_formed_env  {schema : Schema} {p : Policy} {req : Request} {es : Entities} {r : Residual} :  evaluatePolicy schema p req.asPartialRequest Map.empty = .ok r   schema.validateWellFormed = .ok ()   validateEntities schema es = .ok ()    env,    schema.environment? req.asPartialRequest.principal.ty req.asPartialRequest.resource.ty req.asPartialRequest.action = .some env     InstanceOfWellFormedEnvironment req es env:= by  intro h_ep h_schema_wf h_entities  obtain env, h_env := evaluatePolicy_ok_implies_env_some h_ep  have h_mem := environment_some_mem_environments h_env  exact env, h_env, instance_of_well_formed_env    (List.forM_ok_implies_all_ok _ _ h_schema_wf _ h_mem)    (evaluatePolicy_ok_implies_requestMatchesEnvironment h_ep env h_env)    (List.forM_ok_implies_all_ok _ _ h_entities _ h_mem)
Project
Cedar Specification
License
Apache-2.0
Commit
3f093947b8ae
Source
cedar-lean/Cedar/Thm/BatchedEvaluator/Authorize.lean:57-72

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