All proofs
Project-declaredLean 4.31.0 · null

Typecheck policy with level no dne

Cedar.Thm.typecheck_policy_with_level_no_dne

Project documentation

Meaty case. Dispatches on whether the receiver has entity or record type (type_of_getAttr_inversion); the entity branch is where entityDoesNotExist can fire and where EntitiesClosedAtLevel is consumed. -/ theorem level_based_no_dne_get_attr {e : Expr} {a : Attr} {n : Nat} {c₀ c₁ : Capabilities} {env : TypeEnv} {request : Request} {entities : Entitie...

Exact Lean statement

theorem typecheck_policy_with_level_no_dne {p : Policy} {tx : TypedExpr} {n : Nat} {env : TypeEnv} {request : Request} {entities : Entities}
  (hr : InstanceOfWellFormedEnvironment request entities env)
  (hcl : EntitiesClosedAtLevel entities request n)
  (htl : typecheckPolicyWithLevel p n env = .ok tx) :
  evaluate p.toExpr request entities ≠ .error .entityDoesNotExist

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem typecheck_policy_with_level_no_dne {p : Policy} {tx : TypedExpr} {n : Nat} {env : TypeEnv} {request : Request} {entities : Entities}  (hr : InstanceOfWellFormedEnvironment request entities env)  (hcl : EntitiesClosedAtLevel entities request n)  (htl : typecheckPolicyWithLevel p n env = .ok tx) :  evaluate p.toExpr request entities  .error .entityDoesNotExist:= by  simp only [typecheckPolicyWithLevel, typecheckPolicy] at htl  split at htl <;> try contradiction  rename_i tx' _ htx'  cases htl₁ : tx'.typeOf ⊑ .bool .anyBool <;> simp only [htl₁, Bool.false_eq_true, ↓reduceIte, Except.bind_err, Except.bind_ok, reduceCtorEq] at htl  split at htl <;> simp only [reduceCtorEq, Except.ok.injEq] at htl  subst htl  rename_i htl'  have subst_pres := (@substitute_action_preserves_evaluation · · entities)  rw [subst_pres, action_matches_env hr]  rw [level_spec] at htl'  exact level_based_no_dne_expr (empty_capabilities_invariant request entities) hr hcl htx' htl'
Project
Cedar Specification
License
Apache-2.0
Commit
3f093947b8ae
Source
cedar-lean/Cedar/Thm/Validation/Levels/NoEntitiesError.lean:710-726

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