MCPcopy Create free account
hub / github.com/argumentcomputer/ix / norm_level_le

Function norm_level_le

crates/kernel/src/level.rs:649–664  ·  view source on GitHub ↗

Semantic `l1 ≤ l2` on canonical forms. For each `(p1, n1)` in `l1`, the contribution `max(n1.const, u_w + v.off for v ∈ n1.var)` in the branch where `p1`'s params are all positive must be dominated by the max of contributions from `{(p2, n_p2) : p2 ⊆ p1}` in the same branch. # Divergence from Lean4Lean Lean4Lean's `NormLevel.le` (`refs/lean4lean/Lean4Lean/Level.lean:164`) looks for a *single* `p

(l1: &NormLevel, l2: &NormLevel)

Source from the content-addressed store, hash-verified

647/// during `normalize_aux` has `v.idx ∈ p2` (so `u_v ≥ 1` in an active
648/// branch).
649/// - For each `(w, off) ∈ n1.var`, if some `p2 ⊆ p1` has `(w, off') ∈
650/// n_p2.var` with `off' ≥ off`, then `l2`'s contribution along active
651/// `p1` is at least `u_w + off' ≥ u_w + off`.
652///
653/// This matches what Lean4Lean's paper-level theory expects but its
654/// implementation doesn't cover (cf. the `sorry` on
655/// `NormLevel.subsumption_eval` in `Verify/Level.lean:545`, and the absence
656/// of any `geq'_wf`).
657fn norm_level_le(l1: &NormLevel, l2: &NormLevel) -> bool {
658 for (p1, n1) in l1 {
659 if n1.constant == 0 && n1.var.is_empty() {
660 continue;
661 }
662 if n1.constant != 0 && !covers_const(l2, p1, n1.constant) {
663 return false;
664 }
665 for v in &n1.var {
666 if !covers_var(l2, p1, v.idx, v.offset) {
667 return false;

Callers 1

univ_geqFunction · 0.85

Calls 3

covers_constFunction · 0.85
covers_varFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected