Binary beta-invariant relations
System F
StructureBeta-invariant binary relations on the term model#✓fully proved
A binary relation on the term model, invariant under beta conversion.
structure Rel where
/-- The actual binary predicate. -/
holds : Model → Model → Prop
/-- Conversion may replace either argument independently. -/
congr : ∀ {f f' g g'}, BetaEq f f' → BetaEq g g' →
(holds f g ↔ holds f' g')
abbrev Model : Type := {t : Term Nat // t.LcAt 0}
CSLibExt/Languages/LambdaCalculus/SystemF/Model.lean:27
abbrev BetaEq (f g : Model) : Prop :=
Relation.EqvGen Term.FullBeta f.val g.val
CSLibExt/Languages/LambdaCalculus/SystemF/Model.lean:30
holds : Model → Model → Prop
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:28
Uses 2 · Used by 33
Operations on beta-invariant relations
TheoremExtensionality of beta-invariant relations#✓fully proved
Admissible relations are determined by their binary predicates.
@[ext] theorem ext {R S : Rel}
(h : ∀ f g, R.holds f g ↔ S.holds f g) : R = S
structure Rel where
/-- The actual binary predicate. -/
holds : Model → Model → Prop
/-- Conversion may replace either argument independently. -/
congr : ∀ {f f' g g'}, BetaEq f f' → BetaEq g g' →
(holds f g ↔ holds f' g')
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:26
Uses 3
DefinitionFunction-space relation of beta-invariant relations#✓fully proved
Related functions send every related input pair to related outputs.
def arrow (A B : Rel) : Rel where
holds f g := ∀ x y, A.holds x y → B.holds (Model.app f x) (Model.app g y)
congr hff' hgg' := ⟨
fun h x y hxy => (B.congr (hff'.appFun x) (hgg'.appFun y)).mp (h x y hxy),
fun h x y hxy => (B.congr (hff'.appFun x) (hgg'.appFun y)).mpr (h x y hxy)⟩
structure Rel where
/-- The actual binary predicate. -/
holds : Model → Model → Prop
/-- Conversion may replace either argument independently. -/
congr : ∀ {f f' g g'}, BetaEq f f' → BetaEq g g' →
(holds f g ↔ holds f' g')
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:26
holds : Model → Model → Prop
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:28
def app (f a : Model) : Model :=
⟨.app f.val a.val, by
simpa only [Term.LcAt, Bool.and_eq_true] using
And.intro f.property a.property⟩
CSLibExt/Languages/LambdaCalculus/SystemF/Model.lean:36
congr : ∀ {f f' g g'}, BetaEq f f' → BetaEq g g' →
(holds f g ↔ holds f' g')
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:30
DefinitionUniversal quantification over a family of relations#✓fully proved
Universal relatedness, over any index sort, uses impredicative Prop.
def universal {ι : Sort u} (family : ι → Rel) : Rel where
holds f g := ∀ i, (family i).holds f g
congr hff' hgg' := ⟨
fun h i => ((family i).congr hff' hgg').mp (h i),
fun h i => ((family i).congr hff' hgg').mpr (h i)⟩
structure Rel where
/-- The actual binary predicate. -/
holds : Model → Model → Prop
/-- Conversion may replace either argument independently. -/
congr : ∀ {f f' g g'}, BetaEq f f' → BetaEq g g' →
(holds f g ↔ holds f' g')
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:26
holds : Model → Model → Prop
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:28
congr : ∀ {f f' g g'}, BetaEq f f' → BetaEq g g' →
(holds f g ↔ holds f' g')
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:30
Uses 3 · Used by 5
DefinitionEmpty beta-invariant relation#✓fully proved
The empty relation is admissible and prevents vacuous universality.
def empty : Rel where
holds _ _ := False
congr _ _ := Iff.rfl
structure Rel where
/-- The actual binary predicate. -/
holds : Model → Model → Prop
/-- Conversion may replace either argument independently. -/
congr : ∀ {f f' g g'}, BetaEq f f' → BetaEq g g' →
(holds f g ↔ holds f' g')
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:26
holds : Model → Model → Prop
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:28
congr : ∀ {f f' g g'}, BetaEq f f' → BetaEq g g' →
(holds f g ↔ holds f' g')
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:30
Uses 3 · Used by 3
DefinitionTotal beta-invariant relation#✓fully proved
The total binary relation is admissible.
def total : Rel where
holds _ _ := True
congr _ _ := Iff.rfl
structure Rel where
/-- The actual binary predicate. -/
holds : Model → Model → Prop
/-- Conversion may replace either argument independently. -/
congr : ∀ {f f' g g'}, BetaEq f f' → BetaEq g g' →
(holds f g ↔ holds f' g')
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:26
holds : Model → Model → Prop
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:28
congr : ∀ {f f' g g'}, BetaEq f f' → BetaEq g g' →
(holds f g ↔ holds f' g')
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:30
Uses 3 · Used by 4
DefinitionRelation of two terms beta-equal to a fixed term#✓fully proved
Both arguments belong to the fixed beta-conversion class of x.
def betaClass (x : Model) : Rel where
holds f g := BetaEq f x ∧ BetaEq g x
congr hff' hgg' := ⟨
fun h => ⟨hff'.symm.trans h.1, hgg'.symm.trans h.2⟩,
fun h => ⟨hff'.trans h.1, hgg'.trans h.2⟩⟩
abbrev Model : Type := {t : Term Nat // t.LcAt 0}
CSLibExt/Languages/LambdaCalculus/SystemF/Model.lean:27
structure Rel where
/-- The actual binary predicate. -/
holds : Model → Model → Prop
/-- Conversion may replace either argument independently. -/
congr : ∀ {f f' g g'}, BetaEq f f' → BetaEq g g' →
(holds f g ↔ holds f' g')
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:26
holds : Model → Model → Prop
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:28
abbrev BetaEq (f g : Model) : Prop :=
Relation.EqvGen Term.FullBeta f.val g.val
CSLibExt/Languages/LambdaCalculus/SystemF/Model.lean:30
congr : ∀ {f f' g g'}, BetaEq f f' → BetaEq g g' →
(holds f g ↔ holds f' g')
CSLibExt/Languages/LambdaCalculus/SystemF/Relations.lean:30
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.