card of union needs
ProvedAPFPaper1.Source.card_of_union_needsapfapf-referencepullbacks-v46-2026-11
Result: card of union needs. All parameters and hypotheses are retained in the declaration below.
theorem card_of_union_needs (NS NT NU : Finset Record) (h : NS ∪ NT ⊆ NU) :
(NU.card : ℝ) =
(NS.card : ℝ) + (NT.card : ℝ) + ((NU \ (NS ∪ NT)).card : ℝ) - ((NS ∩ NT).card : ℝ)
Module context and limits: For parts of a unit-cost exact occupant, with free empty holding, the union-minus-separate cost equals epsilon times joint-only records minus shared records. Additivity and sign conclusions retain the explicit set and occupancy hypotheses. This realizes the bookkeeping identity on defined sourceNeeds sets without adopting the occupant premise.
Source scope parameters:
variable {Record : Type*} [DecidableEq Record]
variable {D P R Record : Type*} [DecidableEq D] [DecidableEq Record]
variable (wholeResource : P → R) (calibration : R → NNReal) (maintained : P → Set Record)
(sufficient : P → Set Record → D → Prop) (usesToRealize : P → D → Set Record → Prop)
(cost : Record → ℝ)
Public reference result; this record does not establish Foundation admission, physical K1–K4 closure, a forced transfer or Born-rule derivation.
Preamble
import Definitions.Def_APFPaper1_holding_nothing_costs_nothing_Vocabulary import Theorems.Thm_APFPaper1_Source_familyCost_empty_eq_zero import Theorems.Thm_APFPaper1_Source_sourceNeeds_empty_eq import Theorems.Thm_APFPaper1_Source_isOccupantOf_empty import Theorems.Thm_APFPaper1_Source_part_cost_eq_count_all import Theorems.Thm_APFPaper1_Source_individual_floor_of_holding_nothing_free import Theorems.Thm_APFPaper1_Source_nothing_is_the_one_minimum import Theorems.Thm_APFPaper1_Source_isOccupantOf_of_available import Theorems.Thm_APFB06_ResidueWorldR2_cost_empty import Theorems.Thm_APFB06_ResidueWorldR2_not_holdingNothingFree import Theorems.Thm_APFB06_ReadingsWorld_holdingNothingFree import Theorems.Thm_APFB06_ReadingsWorld_fcost_empty import Theorems.Thm_APFB06_ReadingsWorld_occupant_holds_with_parts_at_unit import Definitions.Def_APFPaper5_K1_SharedCost import Mathlib.Tactic.Linarith set_option autoImplicit false universe apfNative_u_1
Formal statement
theorem APFPaper1.Source.card_of_union_needs :
∀ {Record : Type apfNative_u_1} [inst : DecidableEq.{apfNative_u_1 + 1} Record]
(NS NT NU : Finset.{apfNative_u_1} Record)
(h :
@LE.le.{apfNative_u_1} (Finset.{apfNative_u_1} Record)
(@Preorder.toLE.{apfNative_u_1} (Finset.{apfNative_u_1} Record)
(@PartialOrder.toPreorder.{apfNative_u_1} (Finset.{apfNative_u_1} Record)
(@Finset.instPartialOrder.{apfNative_u_1} Record)))
(@Union.union.{apfNative_u_1} (Finset.{apfNative_u_1} Record) (@Finset.instUnion.{apfNative_u_1} Record inst) NS
NT)
NU),
@Eq.{1} Real (@Nat.cast.{0} Real Real.instNatCast (@Finset.card.{apfNative_u_1} Record NU))
(@HSub.hSub.{0, 0, 0} Real Real Real (@instHSub.{0} Real Real.instSub)
(@HAdd.hAdd.{0, 0, 0} Real Real Real (@instHAdd.{0} Real Real.instAdd)
(@HAdd.hAdd.{0, 0, 0} Real Real Real (@instHAdd.{0} Real Real.instAdd)
(@Nat.cast.{0} Real Real.instNatCast (@Finset.card.{apfNative_u_1} Record NS))
(@Nat.cast.{0} Real Real.instNatCast (@Finset.card.{apfNative_u_1} Record NT)))
(@Nat.cast.{0} Real Real.instNatCast
(@Finset.card.{apfNative_u_1} Record
(@SDiff.sdiff.{apfNative_u_1} (Finset.{apfNative_u_1} Record)
(@Finset.instSDiff.{apfNative_u_1} Record inst) NU
(@Union.union.{apfNative_u_1} (Finset.{apfNative_u_1} Record)
(@Finset.instUnion.{apfNative_u_1} Record inst) NS NT)))))
(@Nat.cast.{0} Real Real.instNatCast
(@Finset.card.{apfNative_u_1} Record
(@Inter.inter.{apfNative_u_1} (Finset.{apfNative_u_1} Record) (@Finset.instInter.{apfNative_u_1} Record inst)
NS NT)))) := by sorry
Source
['Theorems.Thm_APFPaper1_residue_is_a_count:61; pullbacks v46; source SHA-256 553728788abcf313f98ad6fd6875b0ddac9f8cb64fa94370201cbc1c14c42d39']