Set ↔ Finset bridge for epistemic scale proofs #
Infrastructure for proving Set (Fin n) difference equalities by reducing them
to decidable Finset (Fin n) operations. This bridges the gap between the
Prop-valued Set operations used by EpistemicSystemFA and the decidable
Finset operations needed for automation.
Main definitions #
set_sdiff_fin— tactic macro that proves(A : Set (Fin n)) \ B = Cby normalizing Set literals to Finset coercions, computing the sdiff in Finset land, and closing bydecide.set_sdiff_eq_of_finset— bridge lemma: givenA \ B = C(bydecideonFinset), concludes(↑A : Set _) \ ↑B = ↑C.set_univ_sdiff_eq_of_finset— variant forSet.univ \ ↑B = ↑C.
Finset-native FA operations (Phase 2) #
EpistemicSystemFA.geFS—sys.gelifted to Finset argumentsgeFS_additive— additivity with automatic Finset sdiff computationgeFS_trans,geFS_mono,geFS_total,geFS_refl— FA axioms in Finset land
These are designed for use in compact chamber proofs (Phase 4) where all reasoning happens in Finset land:
geFS_mono {0} {0, 2}— subset bydecide, nofin_casesproof(geFS_additive {1,2} {1,3}).mpr h23— nosd_*lemmas needed
Usage #
These replace the manual ext x; fin_cases x <;> simp [Set.mem_diff, ...]
pattern used throughout the epistemic scale proofs. Every sd_* lemma in
CancellationHelpers.lean can be proved by set_sdiff_fin.
Variant of set_sdiff_eq_of_finset for Set.univ as the left operand.
Tactic for proving (A : Set (Fin n)) \ B = C where A, B, C are Set
literals or Set.univ. Normalizes to Finset coercions, computes the sdiff
via kernel reduction, and closes by rfl or decide. Falls back to
ext x; fin_cases x for edge cases.
Equations
- Core.Scale.tacticSet_sdiff_fin = Lean.ParserDescr.node `Core.Scale.tacticSet_sdiff_fin 1024 (Lean.ParserDescr.nonReservedSymbol "set_sdiff_fin" false)
Instances For
Transitivity in Finset land.
Monotonicity in Finset land: A ⊆ B → geFS B A.
The subset check is decidable on Finsets (default: by decide).
Totality in Finset land.
Reflexivity in Finset land.
¬geFS A B via positivity: if additivity reduces geFS A B to geFS ∅ {i},
and hpos says ¬geFS ∅ {i}, contradiction. The sdiff equalities
A \ B = ∅ and B \ A = {i} are checked by decide.
¬ge A B via positivity (∀-quantified hpos variant): if A ⊆ B (i.e., A\B = ∅),
additivity gives ge ∅ (B\A), and ge_empty_contra derives contradiction
from hpos. Takes the full ∀ i, ¬ge ∅ {i} to avoid metavar issues in
tactic search.
¬ge A B when there exists C with ge C A and C ⊆ B: trans gives ge C B, additive gives ge (C\B) (B\C) = ge ∅ (B\C), contradicting positivity. Combines trans + additive + positivity in one step.
¬ge A B from ¬ge C B when ge C A follows from additivity: ge (C\A) (A\C) → ge C A (by additive.mpr) → trans with assumed ge A B → ge C B → contradiction with ¬ge C B.
¬ge A B via double additive: use additive.mpr to get ge C A from ge (C\A) (A\C), then trans with assumed ge A B gives ge C B, then additive.mp on ge C B gives ge (C\B) (B\C), which contradicts ¬ge (C\B) (B\C).
ge B A via one additive step + one trans step: derive ge B C from ge (B\C) (C\B) via additive.mpr, then chain with ge C A in context.
ge B A via two additive steps through bridge set C: ge B C from ge (B\C) (C\B), ge C A from ge (C\A) (A\C).
¬ge A B via trans to superset: if ge B C and A ⊆ C (A\C = ∅), then ge A B → ge A C → ge ∅ (C\A) → contradiction with hpos.