IndisputableMonolith.RRF.Theorems.OrderPreservation
IndisputableMonolith/RRF/Theorems/OrderPreservation.lean · 101 lines · 8 declarations
show as:
view math explainer →
1import IndisputableMonolith.RRF.Core.DisplayChannel
2import IndisputableMonolith.RRF.Core.Strain
3import Mathlib.Data.Finset.Basic
4import Mathlib.Order.Basic
5import Mathlib.Tactic
6
7/-!
8# RRF Theorems: Order Preservation
9
10Theorems about how ordering on states is preserved under various operations.
11
12Key insight: RRF cares about *ordering* of states by strain, not absolute values.
13Any operation that preserves this ordering preserves "meaning."
14
15## Main Results
16
17- `rank_invariant`: Monotone transforms preserve rank ordering
18- `channel_transfer`: If channels are quality-equivalent, optimization transfers
19-/
20
21
22namespace IndisputableMonolith
23namespace RRF.Theorems
24
25variable {State : Type*}
26
27/-! ## Rank Preservation -/
28
29/-- The rank of a state x in a finite set S: number of states with lower J. -/
30noncomputable def rank [Fintype State] [DecidableEq State]
31 (J : State → ℝ) (x : State) : ℕ :=
32 Finset.card { y ∈ Finset.univ | J y < J x }
33
34/-- Strictly monotone transforms preserve strict ordering, hence ranks. -/
35theorem strictMono_preserves_strict_order
36 {J : State → ℝ} {g : ℝ → ℝ} (hg : StrictMono g)
37 {x y : State} (hxy : J x < J y) :
38 (g ∘ J) x < (g ∘ J) y :=
39 hg hxy
40
41/-- For finite state spaces, strictly monotone transforms preserve ranks. -/
42theorem rank_invariant [Fintype State] [DecidableEq State]
43 {J : State → ℝ} {g : ℝ → ℝ} (hg : StrictMono g) (x : State) :
44 rank J x = rank (g ∘ J) x := by
45 simp only [rank]
46 congr 1
47 ext y
48 simp only [Finset.mem_filter, Finset.mem_univ, true_and, Function.comp_apply]
49 exact ⟨fun h => hg h, fun h => hg.lt_iff_lt.mp h⟩
50
51/-! ## Channel Transfer -/
52
53open RRF.Core
54
55/-- If two channels are quality-equivalent, their optimal states coincide. -/
56theorem optimal_transfer {Obs₁ Obs₂ : Type*}
57 {C₁ : DisplayChannel State Obs₁}
58 {C₂ : DisplayChannel State Obs₂}
59 (heq : QualityEquiv C₁ C₂)
60 (x : State) :
61 C₁.isOptimal x ↔ C₂.isOptimal x :=
62 QualityEquiv.optimal_iff heq x
63
64/-- If C₂.quality = g ∘ C₁.quality for monotone g, they induce the same order. -/
65theorem channel_mono_transfer {Obs : Type*}
66 {C₁ C₂ : DisplayChannel State Obs}
67 {g : ℝ → ℝ} (hg : Monotone g)
68 (hqual : ∀ o, C₂.quality o = g (C₁.quality o))
69 (heq : C₁.observe = C₂.observe) :
70 ∀ x y, C₁.stateQuality x ≤ C₁.stateQuality y →
71 C₂.stateQuality x ≤ C₂.stateQuality y := by
72 intro x y h
73 simp only [DisplayChannel.stateQuality, Function.comp_apply] at *
74 rw [← heq, hqual, hqual]
75 exact hg h
76
77/-! ## Strain Ordering Lemmas -/
78
79/-- Strain ordering is transitive. -/
80theorem strain_order_trans {S : StrainFunctional State}
81 {x y z : State}
82 (hxy : S.weaklyBetter x y) (hyz : S.weaklyBetter y z) :
83 S.weaklyBetter x z :=
84 le_trans hxy hyz
85
86/-- Strict strain ordering is transitive. -/
87theorem strain_strict_order_trans {S : StrainFunctional State}
88 {x y z : State}
89 (hxy : S.strictlyBetter x y) (hyz : S.strictlyBetter y z) :
90 S.strictlyBetter x z :=
91 lt_trans hxy hyz
92
93/-- Equilibria are minimal elements. -/
94theorem equilibria_minimal [StrainFunctional.NonNeg S]
95 {x : State} (hx : S.isBalanced x) :
96 S.isMinimizer x :=
97 StrainFunctional.equilibria_are_minimizers x hx
98
99end RRF.Theorems
100end IndisputableMonolith
101