srcContext
stringlengths 274
35.4k
| theoremStatement
stringlengths 62
1.08k
| theoremName
stringlengths 16
52
| fileCreated
dict | theoremCreated
dict | file
stringlengths 26
42
| module
stringlengths 15
31
| jsonFile
stringlengths 21
37
| positionMetadata
dict | dependencyMetadata
dict | proofMetadata
dict |
---|---|---|---|---|---|---|---|---|---|---|
import ConNF.Model.RaiseStrong
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal
open scoped Pointwise
namespace ConNF
variable [Params.{u}]
/-- A redefinition of the derivative of allowable permutations that is invariant of level,
but still has nice definitional properties. -/
@[default_instance 200]
instance {β γ : TypeIndex} : Derivative (AllPerm β) (AllPerm γ) β γ where
deriv ρ A :=
A.recSderiv
(motive := λ (δ : TypeIndex) (A : β ↝ δ) ↦
letI : Level := ⟨δ.recBotCoe (Nonempty.some inferInstance) id⟩
letI : LeLevel δ := ⟨δ.recBotCoe (λ _ ↦ bot_le) (λ _ h ↦ WithBot.coe_le_coe.mpr h.le)
(show δ.recBotCoe (Nonempty.some inferInstance) id = Level.α from rfl)⟩
AllPerm δ)
ρ (λ δ ε A h ρ ↦
letI : Level := ⟨δ.recBotCoe (Nonempty.some inferInstance) id⟩
letI : LeLevel δ := ⟨δ.recBotCoe (λ _ ↦ bot_le) (λ _ h ↦ WithBot.coe_le_coe.mpr h.le)
(show δ.recBotCoe (Nonempty.some inferInstance) id = Level.α from rfl)⟩
letI : LeLevel ε := ⟨h.le.trans LeLevel.elim⟩
PreCoherentData.allPermSderiv h ρ)
@[simp]
theorem allPerm_deriv_nil' {β : TypeIndex}
(ρ : AllPerm β) :
ρ ⇘ (.nil : β ↝ β) = ρ :=
rfl
@[simp]
theorem allPerm_deriv_sderiv' {β γ δ : TypeIndex}
(ρ : AllPerm β) (A : β ↝ γ) (h : δ < γ) :
ρ ⇘ (A ↘ h) = ρ ⇘ A ↘ h :=
rfl
@[simp]
theorem allPermSderiv_forget' {β γ : TypeIndex} (h : γ < β) (ρ : AllPerm β) :
(ρ ↘ h)ᵁ = ρᵁ ↘ h :=
letI : Level := ⟨β.recBotCoe (Nonempty.some inferInstance) id⟩
letI : LeLevel β := ⟨β.recBotCoe (λ _ ↦ bot_le) (λ _ h ↦ WithBot.coe_le_coe.mpr h.le)
(show β.recBotCoe (Nonempty.some inferInstance) id = Level.α from rfl)⟩
letI : LeLevel γ := ⟨h.le.trans LeLevel.elim⟩
allPermSderiv_forget h ρ
@[simp]
theorem allPerm_inv_sderiv' {β γ : TypeIndex} (h : γ < β) (ρ : AllPerm β) :
ρ⁻¹ ↘ h = (ρ ↘ h)⁻¹ := by
apply allPermForget_injective
rw [allPermSderiv_forget', allPermForget_inv, Tree.inv_sderiv, allPermForget_inv,
allPermSderiv_forget']
def Symmetric {α β : Λ} (s : Set (TSet β)) (hβ : (β : TypeIndex) < α) : Prop :=
∃ S : Support α, ∀ ρ : AllPerm α, ρᵁ • S = S → ρ ↘ hβ • s = s
def newSetEquiv {α : Λ} :
letI : Level := ⟨α⟩
@TSet _ α newModelData.toPreModelData ≃ TSet α :=
letI : Level := ⟨α⟩
castTSet (D₁ := newModelData) (D₂ := globalModelData) rfl
(by rw [globalModelData, motive_eq, constructMotive, globalLtData_eq])
@[simp]
theorem newSetEquiv_forget {α : Λ}
(x : letI : Level := ⟨α⟩; @TSet _ α newModelData.toPreModelData) :
(newSetEquiv x)ᵁ = xᵁ :=
letI : Level := ⟨α⟩
castTSet_forget (D₁ := newModelData) (D₂ := globalModelData) _ x
def allPermEquiv {α : Λ} :
letI : Level := ⟨α⟩
NewPerm ≃ AllPerm α :=
letI : Level := ⟨α⟩
castAllPerm (D₁ := newModelData) (D₂ := globalModelData) rfl
(by rw [globalModelData, motive_eq, constructMotive, globalLtData_eq])
@[simp]
theorem allPermEquiv_forget {α : Λ} (ρ : letI : Level := ⟨α⟩; NewPerm) :
(allPermEquiv ρ)ᵁ = ρᵁ :=
letI : Level := ⟨α⟩
castAllPerm_forget (D₁ := newModelData) (D₂ := globalModelData) _ ρ
theorem allPermEquiv_sderiv {α β : Λ}
(ρ : letI : Level := ⟨α⟩; NewPerm) (hβ : (β : TypeIndex) < α) :
letI : Level := ⟨α⟩
letI : LtLevel β := ⟨hβ⟩
allPermEquiv ρ ↘ hβ = ρ.sderiv β := by
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
letI : LtLevel β := ⟨hβ⟩
apply allPermForget_injective
rw [allPermSderiv_forget, allPermEquiv_forget, NewPerm.forget_sderiv]
theorem TSet.exists_of_symmetric {α β : Λ} (s : Set (TSet β)) (hβ : (β : TypeIndex) < α)
(hs : Symmetric s hβ) :
∃ x : TSet α, ∀ y : TSet β, y ∈[hβ] x ↔ y ∈ s := by
letI : Level := ⟨α⟩
letI : LtLevel β := ⟨hβ⟩
suffices ∃ x : (@TSet _ α newModelData.toPreModelData), ∀ y : TSet β, yᵁ ∈[hβ] xᵁ ↔ y ∈ s by
obtain ⟨x, hx⟩ := this
use newSetEquiv x
intro y
rw [← hx, ← TSet.forget_mem_forget, newSetEquiv_forget]
obtain rfl | hs' := s.eq_empty_or_nonempty
· use none
intro y
simp only [Set.mem_empty_iff_false, iff_false]
exact not_mem_none y
· use some (Code.toSet ⟨β, s, hs'⟩ ?_)
· intro y
erw [mem_some_iff]
exact Code.mem_toSet _
· obtain ⟨S, hS⟩ := hs
use S
intro ρ hρS
have := hS (allPermEquiv ρ) ?_
· simp only [NewPerm.smul_mk, Code.mk.injEq, heq_eq_eq, true_and]
rwa [allPermEquiv_sderiv] at this
· rwa [allPermEquiv_forget]
theorem TSet.exists_support {α : Λ} (x : TSet α) :
∃ S : Support α, ∀ ρ : AllPerm α, ρᵁ • S = S → ρ • x = x := by
letI : Level := ⟨α⟩
obtain ⟨S, hS⟩ := NewSet.exists_support (newSetEquiv.symm x)
use S
intro ρ hρ
have := @Support.Supports.supports _ _ _ newPreModelData _ _ _ hS (allPermEquiv.symm ρ) ?_
· apply tSetForget_injective
have := congr_arg (·ᵁ) this
simp only at this
erw [@smul_forget _ _ newModelData (allPermEquiv.symm ρ) (newSetEquiv.symm x),
← allPermEquiv_forget, ← newSetEquiv_forget, Equiv.apply_symm_apply,
Equiv.apply_symm_apply] at this
rwa [smul_forget]
· rwa [← allPermEquiv_forget, Equiv.apply_symm_apply]
| theorem TSet.symmetric {α β : Λ} (x : TSet α) (hβ : (β : TypeIndex) < α) :
Symmetric {y : TSet β | y ∈[hβ] x} hβ | ConNF.TSet.symmetric | {
"commit": "6fdc87c6b30b73931407a372f1430ecf0fef7601",
"date": "2024-12-03T00:00:00"
} | {
"commit": "b0bc9d69a413800c2ef0d0e3495ee0e71dc3fea7",
"date": "2024-12-01T00:00:00"
} | ConNF/ConNF/Model/TTT.lean | ConNF.Model.TTT | ConNF.Model.TTT.jsonl | {
"lineInFile": 154,
"tokenPositionInFile": 5178,
"theoremPositionInFile": 12
} | {
"inFilePremises": true,
"numInFilePremises": 4,
"repositoryPremises": true,
"numRepositoryPremises": 39,
"numPremises": 84
} | {
"hasProof": true,
"proof": ":= by\n obtain ⟨S, hS⟩ := exists_support x\n use S\n intro ρ hρ\n conv_rhs => rw [← hS ρ hρ]\n simp only [← forget_mem_forget, smul_forget, StrSet.mem_smul_iff]\n ext y\n rw [Set.mem_smul_set_iff_inv_smul_mem, Set.mem_setOf_eq, Set.mem_setOf_eq,\n smul_forget, allPermForget_inv, allPermSderiv_forget']",
"proofType": "tactic",
"proofLengthLines": 8,
"proofLengthTokens": 304
} |
import ConNF.Background.Rel
import ConNF.Base.Small
/-!
# Enumerations
In this file, we define enumerations of a type.
## Main declarations
* `ConNF.Enumeration`: The type family of enumerations.
-/
universe u
open Cardinal
namespace ConNF
variable [Params.{u}] {X Y : Type u}
@[ext]
structure Enumeration (X : Type u) where
bound : κ
rel : Rel κ X
lt_bound : ∀ i ∈ rel.dom, i < bound
rel_coinjective : rel.Coinjective
variable {E F G : Enumeration X}
namespace Enumeration
instance : CoeTC (Enumeration X) (Set X) where
coe E := E.rel.codom
instance : Membership X (Enumeration X) where
mem E x := x ∈ E.rel.codom
theorem mem_iff (x : X) (E : Enumeration X) :
x ∈ E ↔ x ∈ E.rel.codom :=
Iff.rfl
theorem mem_congr {E F : Enumeration X} (h : E = F) :
∀ x, x ∈ E ↔ x ∈ F := by
intro x
rw [h]
theorem dom_small (E : Enumeration X) :
Small E.rel.dom :=
(iio_small E.bound).mono E.lt_bound
theorem coe_small (E : Enumeration X) :
Small (E : Set X) :=
small_codom_of_small_dom E.rel_coinjective E.dom_small
theorem graph'_small (E : Enumeration X) :
Small E.rel.graph' :=
small_graph' E.dom_small E.coe_small
noncomputable def empty : Enumeration X where
bound := 0
rel _ _ := False
lt_bound _ h := by cases h; contradiction
rel_coinjective := by constructor; intros; contradiction
| @[simp]
theorem not_mem_empty (x : X) : x ∉ Enumeration.empty | ConNF.Enumeration.not_mem_empty | {
"commit": "39c33b4a743bea62dbcc549548b712ffd38ca65c",
"date": "2024-12-05T00:00:00"
} | {
"commit": "6709914ae7f5cd3e2bb24b413e09aa844554d234",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/ModelData/Enumeration.lean | ConNF.ModelData.Enumeration | ConNF.ModelData.Enumeration.jsonl | {
"lineInFile": 66,
"tokenPositionInFile": 1348,
"theoremPositionInFile": 5
} | {
"inFilePremises": true,
"numInFilePremises": 4,
"repositoryPremises": true,
"numRepositoryPremises": 6,
"numPremises": 13
} | {
"hasProof": true,
"proof": ":= by\n rintro ⟨i, h⟩\n cases h",
"proofType": "tactic",
"proofLengthLines": 2,
"proofLengthTokens": 31
} |
import ConNF.Levels.Path
/-!
# Trees
In this file, we define the notion of a tree on a type.
## Main declarations
* `ConNF.Tree`: The type family of trees parametrised by a given type.
-/
universe u
open Cardinal
namespace ConNF
variable [Params.{u}] {X Y : Type _} {α β γ : TypeIndex}
/-- An `α`-tree of `X` associates an object of type `X` to each path `α ↝ ⊥`. -/
def Tree (X : Type _) (α : TypeIndex) :=
(α ↝ ⊥) → X
namespace Tree
instance : Derivative (Tree X α) (Tree X β) α β where
deriv T A B := T (A ⇘ B)
@[simp]
theorem deriv_apply (T : Tree X α) (A : α ↝ β) (B : β ↝ ⊥) :
(T ⇘ A) B = T (A ⇘ B) :=
rfl
@[simp]
theorem deriv_nil (T : Tree X α) :
T ⇘ .nil = T := by
funext A
rw [deriv_apply, Path.nil_deriv]
theorem deriv_deriv (T : Tree X α) (A : α ↝ β) (B : β ↝ γ) :
T ⇘ A ⇘ B = T ⇘ (A ⇘ B) := by
funext C
simp only [deriv_apply, Path.deriv_assoc]
theorem deriv_sderiv (T : Tree X α) (A : α ↝ β) (h : γ < β) :
T ⇘ A ↘ h = T ⇘ (A ↘ h) := by
rw [← Derivative.deriv_single, ← Derivative.deriv_single, deriv_deriv]
@[simp]
theorem sderiv_apply (T : Tree X α) (h : β < α) (B : β ↝ ⊥) :
(T ↘ h) B = T (B ↗ h) :=
rfl
instance : BotDerivative (Tree X α) X α where
botDeriv T A := T A
botSderiv T := T <| Path.nil ↘.
botDeriv_single T h := by
cases α using WithBot.recBotCoe with
| bot => cases lt_irrefl ⊥ h
| coe => rfl
@[simp]
theorem botDeriv_eq (T : Tree X α) (A : α ↝ ⊥) :
T ⇘. A = T A :=
rfl
theorem botSderiv_eq (T : Tree X α) :
T ↘. = T (Path.nil ↘.) :=
rfl
/-- The group structure on the type of `α`-trees of `X` is given by "branchwise" multiplication,
given by `Pi.group`. -/
instance group [Group X] : Group (Tree X α) :=
Pi.group
@[simp]
theorem one_apply [Group X] (A : α ↝ ⊥) :
(1 : Tree X α) A = 1 :=
rfl
@[simp]
theorem one_deriv [Group X] (A : α ↝ β) :
(1 : Tree X α) ⇘ A = 1 :=
rfl
@[simp]
theorem one_sderiv [Group X] (h : β < α) :
(1 : Tree X α) ↘ h = 1 :=
rfl
@[simp]
theorem one_sderivBot [Group X] :
(1 : Tree X α) ↘. = 1 :=
rfl
@[simp]
theorem mul_apply [Group X] (T₁ T₂ : Tree X α) (A : α ↝ ⊥) :
(T₁ * T₂) A = T₁ A * T₂ A :=
rfl
| @[simp]
theorem mul_deriv [Group X] (T₁ T₂ : Tree X α) (A : α ↝ β) :
(T₁ * T₂) ⇘ A = T₁ ⇘ A * T₂ ⇘ A | ConNF.Tree.mul_deriv | {
"commit": "8896e416a16c39e1fe487b5fc7c78bc20c4e182b",
"date": "2024-12-03T00:00:00"
} | {
"commit": "012929981ca97cb4447881b386c61e3bac0c6b93",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/Levels/Tree.lean | ConNF.Levels.Tree | ConNF.Levels.Tree.jsonl | {
"lineInFile": 102,
"tokenPositionInFile": 2187,
"theoremPositionInFile": 13
} | {
"inFilePremises": true,
"numInFilePremises": 3,
"repositoryPremises": true,
"numRepositoryPremises": 7,
"numPremises": 16
} | {
"hasProof": true,
"proof": ":=\n rfl",
"proofType": "term",
"proofLengthLines": 1,
"proofLengthTokens": 8
} |
import ConNF.Model.Result
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
def union (x y : TSet α) : TSet α :=
(xᶜ' ⊓' yᶜ')ᶜ'
notation:68 x:68 " ⊔[" h "] " y:68 => _root_.ConNF.union h x y
notation:68 x:68 " ⊔' " y:68 => x ⊔[by assumption] y
@[simp]
theorem mem_union_iff (x y : TSet α) :
∀ z : TSet β, z ∈' x ⊔' y ↔ z ∈' x ∨ z ∈' y := by
rw [union]
intro z
rw [mem_compl_iff, mem_inter_iff, mem_compl_iff, mem_compl_iff, or_iff_not_and_not]
def higherIndex (α : Λ) : Λ :=
(exists_gt α).choose
theorem lt_higherIndex {α : Λ} :
(α : TypeIndex) < higherIndex α :=
WithBot.coe_lt_coe.mpr (exists_gt α).choose_spec
theorem tSet_nonempty (h : ∃ β : Λ, (β : TypeIndex) < α) : Nonempty (TSet α) := by
obtain ⟨α', hα⟩ := h
constructor
apply typeLower lt_higherIndex lt_higherIndex lt_higherIndex hα
apply cardinalOne lt_higherIndex lt_higherIndex
def empty : TSet α :=
(tSet_nonempty ⟨β, hβ⟩).some ⊓' (tSet_nonempty ⟨β, hβ⟩).someᶜ'
@[simp]
theorem mem_empty_iff :
∀ x : TSet β, ¬x ∈' empty hβ := by
intro x
rw [empty, mem_inter_iff, mem_compl_iff]
exact and_not_self
def univ : TSet α :=
(empty hβ)ᶜ'
@[simp]
theorem mem_univ_iff :
∀ x : TSet β, x ∈' univ hβ := by
intro x
simp only [univ, mem_compl_iff, mem_empty_iff, not_false_eq_true]
/-- The set of all ordered pairs. -/
def orderedPairs : TSet α :=
vCross hβ hγ hδ (univ hδ)
@[simp]
theorem mem_orderedPairs_iff (x : TSet β) :
x ∈' orderedPairs hβ hγ hδ ↔ ∃ a b, x = ⟨a, b⟩' := by
simp only [orderedPairs, vCross_spec, mem_univ_iff, and_true]
def converse (x : TSet α) : TSet α :=
converse' hβ hγ hδ x ⊓' orderedPairs hβ hγ hδ
@[simp]
theorem op_mem_converse_iff (x : TSet α) :
∀ a b, ⟨a, b⟩' ∈' converse hβ hγ hδ x ↔ ⟨b, a⟩' ∈' x := by
intro a b
simp only [converse, mem_inter_iff, converse'_spec, mem_orderedPairs_iff, op_inj, exists_and_left,
exists_eq', and_true]
def cross (x y : TSet γ) : TSet α :=
converse hβ hγ hδ (vCross hβ hγ hδ x) ⊓' vCross hβ hγ hδ y
@[simp]
theorem mem_cross_iff (x y : TSet γ) :
∀ a, a ∈' cross hβ hγ hδ x y ↔ ∃ b c, a = ⟨b, c⟩' ∧ b ∈' x ∧ c ∈' y := by
intro a
rw [cross, mem_inter_iff, vCross_spec]
constructor
· rintro ⟨h₁, b, c, rfl, h₂⟩
simp only [op_mem_converse_iff, vCross_spec, op_inj] at h₁
obtain ⟨b', c', ⟨rfl, rfl⟩, h₁⟩ := h₁
exact ⟨b, c, rfl, h₁, h₂⟩
· rintro ⟨b, c, rfl, h₁, h₂⟩
simp only [op_mem_converse_iff, vCross_spec, op_inj]
exact ⟨⟨c, b, ⟨rfl, rfl⟩, h₁⟩, ⟨b, c, ⟨rfl, rfl⟩, h₂⟩⟩
def singletonImage (x : TSet β) : TSet α :=
singletonImage' hβ hγ hδ hε x ⊓' (cross hβ hγ hδ (cardinalOne hδ hε) (cardinalOne hδ hε))
@[simp]
theorem singletonImage_spec (x : TSet β) :
∀ z w,
⟨ {z}', {w}' ⟩' ∈' singletonImage hβ hγ hδ hε x ↔ ⟨z, w⟩' ∈' x := by
intro z w
rw [singletonImage, mem_inter_iff, singletonImage'_spec, and_iff_left_iff_imp]
intro hzw
rw [mem_cross_iff]
refine ⟨{z}', {w}', rfl, ?_⟩
simp only [mem_cardinalOne_iff, singleton_inj, exists_eq', and_self]
theorem exists_of_mem_singletonImage {x : TSet β} {z w : TSet δ}
(h : ⟨z, w⟩' ∈' singletonImage hβ hγ hδ hε x) :
∃ a b, z = {a}' ∧ w = {b}' := by
simp only [singletonImage, mem_inter_iff, mem_cross_iff, op_inj, mem_cardinalOne_iff] at h
obtain ⟨-, _, _, ⟨rfl, rfl⟩, ⟨a, rfl⟩, ⟨b, rfl⟩⟩ := h
exact ⟨a, b, rfl, rfl⟩
/-- Turn a model element encoding a relation into an actual relation. -/
def ExternalRel (r : TSet α) : Rel (TSet δ) (TSet δ) :=
λ x y ↦ ⟨x, y⟩' ∈' r
@[simp]
theorem externalRel_converse (r : TSet α) :
ExternalRel hβ hγ hδ (converse hβ hγ hδ r) = (ExternalRel hβ hγ hδ r).inv := by
ext
simp only [ExternalRel, op_mem_converse_iff, Rel.inv_apply]
/-- The codomain of a relation. -/
def codom (r : TSet α) : TSet γ :=
(typeLower lt_higherIndex hβ hγ hδ (singletonImage lt_higherIndex hβ hγ hδ r)ᶜ[lt_higherIndex])ᶜ'
| @[simp]
theorem mem_codom_iff (r : TSet α) (x : TSet δ) :
x ∈' codom hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).codom | ConNF.mem_codom_iff | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | ConNF/ConNF/External/Basic.lean | ConNF.External.Basic | ConNF.External.Basic.jsonl | {
"lineInFile": 139,
"tokenPositionInFile": 4169,
"theoremPositionInFile": 23
} | {
"inFilePremises": true,
"numInFilePremises": 7,
"repositoryPremises": true,
"numRepositoryPremises": 22,
"numPremises": 57
} | {
"hasProof": true,
"proof": ":= by\n simp only [codom, mem_compl_iff, mem_typeLower_iff, not_forall, not_not]\n constructor\n · rintro ⟨y, hy⟩\n obtain ⟨a, b, rfl, hb⟩ := exists_of_mem_singletonImage lt_higherIndex hβ hγ hδ hy\n rw [singleton_inj] at hb\n subst hb\n rw [singletonImage_spec] at hy\n exact ⟨a, hy⟩\n · rintro ⟨a, ha⟩\n use {a}'\n rw [singletonImage_spec]\n exact ha",
"proofType": "tactic",
"proofLengthLines": 12,
"proofLengthTokens": 368
} |
import ConNF.Model.Externalise
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal
namespace ConNF
variable [Params.{u}] {β γ : Λ} {hγ : (γ : TypeIndex) < β}
namespace Support
theorem not_mem_scoderiv_botDeriv (S : Support γ) (N : NearLitter) :
N ∉ (S ↗ hγ ⇘. (Path.nil ↘.))ᴺ := by
rintro ⟨i, ⟨A, N'⟩, h₁, h₂⟩
simp only [Prod.mk.injEq] at h₂
cases A
case sderiv δ A hδ _ =>
simp only [Path.deriv_sderiv] at h₂
cases A
case nil => cases h₂.1
case sderiv ζ A hζ _ =>
simp only [Path.deriv_sderiv] at h₂
cases h₂.1
variable [Level] [LtLevel β]
theorem not_mem_strong_botDeriv (S : Support γ) (N : NearLitter) :
N ∉ ((S ↗ hγ).strong ⇘. (Path.nil ↘.))ᴺ := by
rintro h
rw [strong, close_nearLitters, preStrong_nearLitters, Enumeration.mem_add_iff] at h
obtain h | h := h
· exact not_mem_scoderiv_botDeriv S N h
· rw [mem_constrainsNearLitters_nearLitters] at h
obtain ⟨B, N', hN', h⟩ := h
cases h using Relation.ReflTransGen.head_induction_on
case refl => exact not_mem_scoderiv_botDeriv S N hN'
case head x hx₁ hx₂ _ =>
obtain ⟨⟨γ, δ, ε, hδ, hε, hδε, A⟩, t, B, hB, hN, ht⟩ := hx₂
simp only at hB
cases B
case nil =>
cases hB
obtain ⟨C, N''⟩ := x
simp only at ht
cases ht.1
change _ ∈ t.supportᴺ at hN
rw [t.support_supports.2 rfl] at hN
obtain ⟨i, hN⟩ := hN
cases hN
case sderiv δ B hδ _ _ =>
cases B
case nil => cases hB
case sderiv ζ B hζ _ _ => cases hB
theorem raise_preStrong' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).PreStrong := by
apply hS.toPreStrong.add
constructor
intro A N hN P t hA ht
obtain ⟨A, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN
simp only [scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, interferenceSupport_nearLitters,
Enumeration.mem_add_iff, Enumeration.mem_smul, Enumeration.not_mem_empty, or_false] at hN
obtain ⟨δ, ε, ζ, hε, hζ, hεζ, B⟩ := P
dsimp only at *
cases A
case sderiv ζ' A hζ' _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_left_inj.mp at hA
cases A
case nil =>
cases hA
cases not_mem_strong_botDeriv T _ hN
case sderiv ι A hι _ _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
cases hA
haveI : LtLevel δ := ⟨A.le.trans_lt LtLevel.elim⟩
haveI : LtLevel ε := ⟨hε.trans LtLevel.elim⟩
haveI : LtLevel ζ := ⟨hζ.trans LtLevel.elim⟩
have := (T ↗ hγ).strong_strong.support_le hN ⟨δ, ε, ζ, hε, hζ, hεζ, A⟩
(ρ⁻¹ ⇘ A ↘ hε • t) rfl ?_
· simp only [Tangle.smul_support, allPermSderiv_forget, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv] at this
have := smul_le_smul this (ρᵁ ⇘ A ↘ hε)
simp only [smul_inv_smul] at this
apply le_trans this
intro B
constructor
· intro a ha
simp only [smul_derivBot, Tree.sderiv_apply, Tree.deriv_apply, Path.deriv_scoderiv,
deriv_derivBot, Enumeration.mem_smul] at ha
rw [deriv_derivBot, ← Path.deriv_scoderiv, Path.coderiv_deriv', scoderiv_botDeriv_eq,]
simp only [Path.deriv_scoderiv, add_derivBot, smul_derivBot,
BaseSupport.add_atoms, BaseSupport.smul_atoms, Enumeration.mem_add_iff,
Enumeration.mem_smul]
exact Or.inl ha
· intro N hN
simp only [smul_derivBot, Tree.sderiv_apply, Tree.deriv_apply, Path.deriv_scoderiv,
deriv_derivBot, Enumeration.mem_smul] at hN
rw [deriv_derivBot, ← Path.deriv_scoderiv, Path.coderiv_deriv', scoderiv_botDeriv_eq,]
simp only [Path.deriv_scoderiv, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul]
exact Or.inl hN
· rw [← smul_fuzz hε hζ hεζ, ← ht]
simp only [Path.botSderiv_coe_eq, BasePerm.smul_nearLitter_litter, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.inv_sderivBot]
rfl
theorem raise_closed' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β)
(hρ : ρᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).Closed := by
constructor
intro A
constructor
intro N₁ N₂ hN₁ hN₂ a ha
simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff,
BaseSupport.add_atoms] at hN₁ hN₂ ⊢
obtain hN₁ | hN₁ := hN₁
· obtain hN₂ | hN₂ := hN₂
· exact Or.inl ((hS.closed A).interference_subset hN₁ hN₂ a ha)
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN₂
simp only [smul_add, scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul, BaseSupport.add_atoms, BaseSupport.smul_atoms] at hN₁ hN₂ ⊢
refine Or.inr (Or.inr ?_)
rw [mem_interferenceSupport_atoms]
refine ⟨(ρᵁ B)⁻¹ • N₁, ?_, (ρᵁ B)⁻¹ • N₂, ?_, ?_⟩
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
rw [← Enumeration.mem_smul, ← BaseSupport.smul_nearLitters, ← smul_derivBot, hρ]
exact Or.inl hN₁
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₂
exact Or.inr hN₂
· rw [← BasePerm.smul_interference]
exact Set.smul_mem_smul_set ha
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN₁
simp only [smul_add, scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul, BaseSupport.add_atoms, BaseSupport.smul_atoms] at hN₁ hN₂ ⊢
refine Or.inr (Or.inr ?_)
rw [mem_interferenceSupport_atoms]
refine ⟨(ρᵁ B)⁻¹ • N₁, ?_, (ρᵁ B)⁻¹ • N₂, ?_, ?_⟩
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₁
exact Or.inr hN₁
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₂
obtain hN₂ | hN₂ := hN₂
· rw [← Enumeration.mem_smul, ← BaseSupport.smul_nearLitters, ← smul_derivBot, hρ]
exact Or.inl hN₂
· exact Or.inr hN₂
· rw [← BasePerm.smul_interference]
exact Set.smul_mem_smul_set ha
theorem raise_strong' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β)
(hρ : ρᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).Strong :=
⟨raise_preStrong' S hS T ρ hγ, raise_closed' S hS T ρ hγ hρ⟩
| theorem convAtoms_injective_of_fixes {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(A : ↑α ↝ ⊥) :
(convAtoms
(S + (ρ₁ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim) A).Injective | ConNF.Support.convAtoms_injective_of_fixes | {
"commit": "abf71bc79c407ceb462cc2edd2d994cda9cdef05",
"date": "2024-04-04T00:00:00"
} | {
"commit": "6709914ae7f5cd3e2bb24b413e09aa844554d234",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/Model/RaiseStrong.lean | ConNF.Model.RaiseStrong | ConNF.Model.RaiseStrong.jsonl | {
"lineInFile": 181,
"tokenPositionInFile": 7503,
"theoremPositionInFile": 5
} | {
"inFilePremises": false,
"numInFilePremises": 0,
"repositoryPremises": true,
"numRepositoryPremises": 71,
"numPremises": 148
} | {
"hasProof": true,
"proof": ":= by\n rw [Support.smul_eq_iff] at hρ₁ hρ₂\n constructor\n rintro a₁ a₂ a₃ ⟨i, hi₁, hi₂⟩ ⟨j, hj₁, hj₂⟩\n simp only [add_derivBot, BaseSupport.add_atoms, Rel.inv_apply,\n Enumeration.rel_add_iff] at hi₁ hi₂ hj₁ hj₂\n obtain hi₁ | ⟨i, rfl, hi₁⟩ := hi₁\n · obtain hi₂ | ⟨i', rfl, _⟩ := hi₂\n swap\n · have := Enumeration.lt_bound _ _ ⟨_, hi₁⟩\n simp only [add_lt_iff_neg_left] at this\n cases (κ_zero_le i').not_lt this\n cases (Enumeration.rel_coinjective _).coinjective hi₁ hi₂\n obtain hj₁ | ⟨j, rfl, hj₁⟩ := hj₁\n · obtain hj₂ | ⟨j', rfl, _⟩ := hj₂\n · exact (Enumeration.rel_coinjective _).coinjective hj₂ hj₁\n · have := Enumeration.lt_bound _ _ ⟨_, hj₁⟩\n simp only [add_lt_iff_neg_left] at this\n cases (κ_zero_le j').not_lt this\n · obtain hj₂ | hj₂ := hj₂\n · have := Enumeration.lt_bound _ _ ⟨_, hj₂⟩\n simp only [add_lt_iff_neg_left] at this\n cases (κ_zero_le j).not_lt this\n · simp only [add_right_inj, exists_eq_left] at hj₂\n obtain ⟨B, rfl⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨j, hj₁⟩\n simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,\n BaseSupport.add_atoms, Enumeration.smul_rel, add_right_inj, exists_eq_left] at hj₁ hj₂\n have := (Enumeration.rel_coinjective _).coinjective hj₁ hj₂\n rw [← (hρ₂ B).1 a₁ ⟨_, hi₁⟩, inv_smul_smul, inv_smul_eq_iff, (hρ₁ B).1 a₁ ⟨_, hi₁⟩] at this\n exact this.symm\n · obtain ⟨B, rfl⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨i, hi₁⟩\n simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,\n BaseSupport.add_atoms, Enumeration.smul_rel, add_right_inj, exists_eq_left] at hi₁ hi₂ hj₁ hj₂\n obtain hi₂ | hi₂ := hi₂\n · have := Enumeration.lt_bound _ _ ⟨_, hi₂⟩\n simp only [add_lt_iff_neg_left] at this\n cases (κ_zero_le i).not_lt this\n have hi := (Enumeration.rel_coinjective _).coinjective hi₁ hi₂\n suffices hj : (ρ₁ᵁ B)⁻¹ • a₂ = (ρ₂ᵁ B)⁻¹ • a₃ by\n rwa [← hj, smul_left_cancel_iff] at hi\n obtain hj₁ | ⟨j, rfl, hj₁⟩ := hj₁\n · obtain hj₂ | ⟨j', rfl, _⟩ := hj₂\n · rw [← (hρ₁ B).1 a₂ ⟨_, hj₁⟩, ← (hρ₂ B).1 a₃ ⟨_, hj₂⟩, inv_smul_smul, inv_smul_smul]\n exact (Enumeration.rel_coinjective _).coinjective hj₁ hj₂\n · have := Enumeration.lt_bound _ _ ⟨_, hj₁⟩\n simp only [add_lt_iff_neg_left] at this\n cases (κ_zero_le j').not_lt this\n · obtain hj₂ | hj₂ := hj₂\n · have := Enumeration.lt_bound _ _ ⟨_, hj₂⟩\n simp only [add_lt_iff_neg_left] at this\n cases (κ_zero_le j).not_lt this\n · simp only [add_right_inj, exists_eq_left] at hj₂\n exact (Enumeration.rel_coinjective _).coinjective hj₁ hj₂",
"proofType": "tactic",
"proofLengthLines": 52,
"proofLengthTokens": 2698
} |
import ConNF.ModelData.PathEnumeration
/-!
# Supports
In this file, we define the notion of a support.
## Main declarations
* `ConNF.BaseSupport`: The type of supports of atoms.
* `ConNF.Support`: The type of supports of objects of arbitrary type indices.
-/
universe u
open Cardinal
namespace ConNF
variable [Params.{u}]
/-!
## Base supports
-/
structure BaseSupport where
atoms : Enumeration Atom
nearLitters : Enumeration NearLitter
namespace BaseSupport
instance : SuperA BaseSupport (Enumeration Atom) where
superA := atoms
instance : SuperN BaseSupport (Enumeration NearLitter) where
superN := nearLitters
@[simp]
theorem mk_atoms {a : Enumeration Atom} {N : Enumeration NearLitter} :
(BaseSupport.mk a N)ᴬ = a :=
rfl
@[simp]
theorem mk_nearLitters {a : Enumeration Atom} {N : Enumeration NearLitter} :
(BaseSupport.mk a N)ᴺ = N :=
rfl
theorem atoms_congr {S T : BaseSupport} (h : S = T) :
Sᴬ = Tᴬ :=
h ▸ rfl
theorem nearLitters_congr {S T : BaseSupport} (h : S = T) :
Sᴺ = Tᴺ :=
h ▸ rfl
@[ext]
theorem ext {S T : BaseSupport} (h₁ : Sᴬ = Tᴬ) (h₂ : Sᴺ = Tᴺ) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
cases h₁
cases h₂
rfl
instance : SMul BasePerm BaseSupport where
smul π S := ⟨π • Sᴬ, π • Sᴺ⟩
@[simp]
theorem smul_atoms (π : BasePerm) (S : BaseSupport) :
(π • S)ᴬ = π • Sᴬ :=
rfl
@[simp]
theorem smul_nearLitters (π : BasePerm) (S : BaseSupport) :
(π • S)ᴺ = π • Sᴺ :=
rfl
@[simp]
theorem smul_atoms_eq_of_smul_eq {π : BasePerm} {S : BaseSupport}
(h : π • S = S) :
π • Sᴬ = Sᴬ := by
rw [← smul_atoms, h]
@[simp]
theorem smul_nearLitters_eq_of_smul_eq {π : BasePerm} {S : BaseSupport}
(h : π • S = S) :
π • Sᴺ = Sᴺ := by
rw [← smul_nearLitters, h]
instance : MulAction BasePerm BaseSupport where
one_smul S := by
apply ext
· rw [smul_atoms, one_smul]
· rw [smul_nearLitters, one_smul]
mul_smul π₁ π₂ S := by
apply ext
· rw [smul_atoms, smul_atoms, smul_atoms, mul_smul]
· rw [smul_nearLitters, smul_nearLitters, smul_nearLitters, mul_smul]
theorem smul_eq_smul_iff (π₁ π₂ : BasePerm) (S : BaseSupport) :
π₁ • S = π₂ • S ↔ (∀ a ∈ Sᴬ, π₁ • a = π₂ • a) ∧ (∀ N ∈ Sᴺ, π₁ • N = π₂ • N) := by
constructor
· intro h
constructor
· rintro a ⟨i, ha⟩
have := congr_arg (·ᴬ.rel i (π₁ • a)) h
simp only [smul_atoms, Enumeration.smul_rel, inv_smul_smul, eq_iff_iff] at this
have := Sᴬ.rel_coinjective.coinjective ha (this.mp ha)
rw [eq_inv_smul_iff] at this
rw [this]
· rintro N ⟨i, hN⟩
have := congr_arg (·ᴺ.rel i (π₁ • N)) h
simp only [smul_nearLitters, Enumeration.smul_rel, inv_smul_smul, eq_iff_iff] at this
have := Sᴺ.rel_coinjective.coinjective hN (this.mp hN)
rw [eq_inv_smul_iff] at this
rw [this]
· intro h
ext : 2
· rfl
· ext i a : 3
rw [smul_atoms, smul_atoms, Enumeration.smul_rel, Enumeration.smul_rel]
constructor
· intro ha
have := h.1 _ ⟨i, ha⟩
rw [smul_inv_smul, ← inv_smul_eq_iff] at this
rwa [this]
· intro ha
have := h.1 _ ⟨i, ha⟩
rw [smul_inv_smul, smul_eq_iff_eq_inv_smul] at this
rwa [← this]
· rfl
· ext i a : 3
rw [smul_nearLitters, smul_nearLitters, Enumeration.smul_rel, Enumeration.smul_rel]
constructor
· intro hN
have := h.2 _ ⟨i, hN⟩
rw [smul_inv_smul, ← inv_smul_eq_iff] at this
rwa [this]
· intro hN
have := h.2 _ ⟨i, hN⟩
rw [smul_inv_smul, smul_eq_iff_eq_inv_smul] at this
rwa [← this]
theorem smul_eq_iff (π : BasePerm) (S : BaseSupport) :
π • S = S ↔ (∀ a ∈ Sᴬ, π • a = a) ∧ (∀ N ∈ Sᴺ, π • N = N) := by
have := smul_eq_smul_iff π 1 S
simp only [one_smul] at this
exact this
noncomputable instance : Add BaseSupport where
add S T := ⟨Sᴬ + Tᴬ, Sᴺ + Tᴺ⟩
@[simp]
theorem add_atoms (S T : BaseSupport) :
(S + T)ᴬ = Sᴬ + Tᴬ :=
rfl
@[simp]
theorem add_nearLitters (S T : BaseSupport) :
(S + T)ᴺ = Sᴺ + Tᴺ :=
rfl
end BaseSupport
def baseSupportEquiv : BaseSupport ≃ Enumeration Atom × Enumeration NearLitter where
toFun S := (Sᴬ, Sᴺ)
invFun S := ⟨S.1, S.2⟩
left_inv _ := rfl
right_inv _ := rfl
theorem card_baseSupport : #BaseSupport = #μ := by
rw [Cardinal.eq.mpr ⟨baseSupportEquiv⟩, mk_prod, lift_id, lift_id,
card_enumeration_eq card_atom, card_enumeration_eq card_nearLitter, mul_eq_self aleph0_lt_μ.le]
/-!
## Structural supports
-/
structure Support (α : TypeIndex) where
atoms : Enumeration (α ↝ ⊥ × Atom)
nearLitters : Enumeration (α ↝ ⊥ × NearLitter)
namespace Support
variable {α β : TypeIndex}
instance : SuperA (Support α) (Enumeration (α ↝ ⊥ × Atom)) where
superA := atoms
instance : SuperN (Support α) (Enumeration (α ↝ ⊥ × NearLitter)) where
superN := nearLitters
@[simp]
theorem mk_atoms (E : Enumeration (α ↝ ⊥ × Atom)) (F : Enumeration (α ↝ ⊥ × NearLitter)) :
(⟨E, F⟩ : Support α)ᴬ = E :=
rfl
@[simp]
theorem mk_nearLitters (E : Enumeration (α ↝ ⊥ × Atom)) (F : Enumeration (α ↝ ⊥ × NearLitter)) :
(⟨E, F⟩ : Support α)ᴺ = F :=
rfl
instance : Derivative (Support α) (Support β) α β where
deriv S A := ⟨Sᴬ ⇘ A, Sᴺ ⇘ A⟩
instance : Coderivative (Support β) (Support α) α β where
coderiv S A := ⟨Sᴬ ⇗ A, Sᴺ ⇗ A⟩
instance : BotDerivative (Support α) BaseSupport α where
botDeriv S A := ⟨Sᴬ ⇘. A, Sᴺ ⇘. A⟩
botSderiv S := ⟨Sᴬ ↘., Sᴺ ↘.⟩
botDeriv_single S h := by dsimp only; rw [botDeriv_single, botDeriv_single]
@[simp]
theorem deriv_atoms {α β : TypeIndex} (S : Support α) (A : α ↝ β) :
Sᴬ ⇘ A = (S ⇘ A)ᴬ :=
rfl
@[simp]
theorem deriv_nearLitters {α β : TypeIndex} (S : Support α) (A : α ↝ β) :
Sᴺ ⇘ A = (S ⇘ A)ᴺ :=
rfl
@[simp]
theorem sderiv_atoms {α β : TypeIndex} (S : Support α) (h : β < α) :
Sᴬ ↘ h = (S ↘ h)ᴬ :=
rfl
@[simp]
theorem sderiv_nearLitters {α β : TypeIndex} (S : Support α) (h : β < α) :
Sᴺ ↘ h = (S ↘ h)ᴺ :=
rfl
@[simp]
theorem coderiv_atoms {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
Sᴬ ⇗ A = (S ⇗ A)ᴬ :=
rfl
@[simp]
theorem coderiv_nearLitters {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
Sᴺ ⇗ A = (S ⇗ A)ᴺ :=
rfl
@[simp]
theorem scoderiv_atoms {α β : TypeIndex} (S : Support β) (h : β < α) :
Sᴬ ↗ h = (S ↗ h)ᴬ :=
rfl
@[simp]
theorem scoderiv_nearLitters {α β : TypeIndex} (S : Support β) (h : β < α) :
Sᴺ ↗ h = (S ↗ h)ᴺ :=
rfl
@[simp]
theorem derivBot_atoms {α : TypeIndex} (S : Support α) (A : α ↝ ⊥) :
Sᴬ ⇘. A = (S ⇘. A)ᴬ :=
rfl
@[simp]
theorem derivBot_nearLitters {α : TypeIndex} (S : Support α) (A : α ↝ ⊥) :
Sᴺ ⇘. A = (S ⇘. A)ᴺ :=
rfl
theorem ext' {S T : Support α} (h₁ : Sᴬ = Tᴬ) (h₂ : Sᴺ = Tᴺ) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
cases h₁
cases h₂
rfl
@[ext]
theorem ext {S T : Support α} (h : ∀ A, S ⇘. A = T ⇘. A) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
rw [mk.injEq]
constructor
· apply Enumeration.ext_path
intro A
exact BaseSupport.atoms_congr (h A)
· apply Enumeration.ext_path
intro A
exact BaseSupport.nearLitters_congr (h A)
@[simp]
theorem deriv_derivBot {α : TypeIndex} (S : Support α)
(A : α ↝ β) (B : β ↝ ⊥) :
S ⇘ A ⇘. B = S ⇘. (A ⇘ B) :=
rfl
@[simp]
theorem coderiv_deriv_eq {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
S ⇗ A ⇘ A = S :=
ext' (Sᴬ.coderiv_deriv_eq A) (Sᴺ.coderiv_deriv_eq A)
theorem eq_of_atom_mem_scoderiv_botDeriv {α β : TypeIndex} {S : Support β} {A : α ↝ ⊥}
{h : β < α} {a : Atom} (ha : a ∈ (S ↗ h ⇘. A)ᴬ) :
∃ B : β ↝ ⊥, A = B ↗ h :=
Enumeration.eq_of_mem_scoderiv_botDeriv ha
theorem eq_of_nearLitter_mem_scoderiv_botDeriv {α β : TypeIndex} {S : Support β} {A : α ↝ ⊥}
{h : β < α} {N : NearLitter} (hN : N ∈ (S ↗ h ⇘. A)ᴺ) :
∃ B : β ↝ ⊥, A = B ↗ h :=
Enumeration.eq_of_mem_scoderiv_botDeriv hN
@[simp]
theorem scoderiv_botDeriv_eq {α β : TypeIndex} (S : Support β) (A : β ↝ ⊥) (h : β < α) :
S ↗ h ⇘. (A ↗ h) = S ⇘. A :=
BaseSupport.ext (Enumeration.scoderiv_botDeriv_eq _ _ _) (Enumeration.scoderiv_botDeriv_eq _ _ _)
@[simp]
theorem scoderiv_deriv_eq {α β γ : TypeIndex} (S : Support β) (A : β ↝ γ) (h : β < α) :
S ↗ h ⇘ (A ↗ h) = S ⇘ A := by
apply ext
intro B
simp only [deriv_derivBot, ← scoderiv_botDeriv_eq S (A ⇘ B) h, Path.coderiv_deriv']
@[simp]
theorem coderiv_inj {α β : TypeIndex} (S T : Support β) (A : α ↝ β) :
S ⇗ A = T ⇗ A ↔ S = T := by
constructor
swap
· rintro rfl
rfl
intro h
ext B : 1
have : S ⇗ A ⇘ A ⇘. B = T ⇗ A ⇘ A ⇘. B := by rw [h]
rwa [coderiv_deriv_eq, coderiv_deriv_eq] at this
@[simp]
theorem scoderiv_inj {α β : TypeIndex} (S T : Support β) (h : β < α) :
S ↗ h = T ↗ h ↔ S = T :=
coderiv_inj S T (.single h)
instance {α : TypeIndex} : SMul (StrPerm α) (Support α) where
smul π S := ⟨π • Sᴬ, π • Sᴺ⟩
@[simp]
theorem smul_atoms {α : TypeIndex} (π : StrPerm α) (S : Support α) :
(π • S)ᴬ = π • Sᴬ :=
rfl
@[simp]
theorem smul_nearLitters {α : TypeIndex} (π : StrPerm α) (S : Support α) :
(π • S)ᴺ = π • Sᴺ :=
rfl
theorem smul_atoms_eq_of_smul_eq {α : TypeIndex} {π : StrPerm α} {S : Support α}
(h : π • S = S) :
π • Sᴬ = Sᴬ := by
rw [← smul_atoms, h]
theorem smul_nearLitters_eq_of_smul_eq {α : TypeIndex} {π : StrPerm α} {S : Support α}
(h : π • S = S) :
π • Sᴺ = Sᴺ := by
rw [← smul_nearLitters, h]
instance {α : TypeIndex} : MulAction (StrPerm α) (Support α) where
one_smul S := by
apply ext'
· rw [smul_atoms, one_smul]
· rw [smul_nearLitters, one_smul]
mul_smul π₁ π₂ S := by
apply ext'
· rw [smul_atoms, smul_atoms, smul_atoms, mul_smul]
· rw [smul_nearLitters, smul_nearLitters, smul_nearLitters, mul_smul]
@[simp]
theorem smul_derivBot {α : TypeIndex} (π : StrPerm α) (S : Support α) (A : α ↝ ⊥) :
(π • S) ⇘. A = π A • (S ⇘. A) :=
rfl
theorem smul_coderiv {α : TypeIndex} (π : StrPerm α) (S : Support β) (A : α ↝ β) :
π • S ⇗ A = (π ⇘ A • S) ⇗ A := by
ext B i x
· rfl
· constructor
· rintro ⟨⟨C, x⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, x⟩, hS, rfl⟩
· rintro ⟨⟨C, x⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, _⟩, hS, rfl⟩
· rfl
· constructor
· rintro ⟨⟨C, x⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, x⟩, hS, rfl⟩
· rintro ⟨⟨C, a⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, _⟩, hS, rfl⟩
theorem smul_scoderiv {α : TypeIndex} (π : StrPerm α) (S : Support β) (h : β < α) :
π • S ↗ h = (π ↘ h • S) ↗ h :=
smul_coderiv π S (Path.single h)
theorem smul_eq_smul_iff (π₁ π₂ : StrPerm β) (S : Support β) :
π₁ • S = π₂ • S ↔
∀ A, (∀ a ∈ (S ⇘. A)ᴬ, π₁ A • a = π₂ A • a) ∧ (∀ N ∈ (S ⇘. A)ᴺ, π₁ A • N = π₂ A • N) := by
constructor
· intro h A
have := congr_arg (· ⇘. A) h
simp only [smul_derivBot, BaseSupport.smul_eq_smul_iff] at this
exact this
· intro h
apply ext
intro A
simp only [smul_derivBot, BaseSupport.smul_eq_smul_iff]
exact h A
theorem smul_eq_iff (π : StrPerm β) (S : Support β) :
π • S = S ↔ ∀ A, (∀ a ∈ (S ⇘. A)ᴬ, π A • a = a) ∧ (∀ N ∈ (S ⇘. A)ᴺ, π A • N = N) := by
have := smul_eq_smul_iff π 1 S
simp only [one_smul, Tree.one_apply] at this
exact this
noncomputable instance : Add (Support α) where
add S T := ⟨Sᴬ + Tᴬ, Sᴺ + Tᴺ⟩
@[simp]
theorem add_derivBot (S T : Support α) (A : α ↝ ⊥) :
(S + T) ⇘. A = (S ⇘. A) + (T ⇘. A) :=
rfl
theorem smul_add (S T : Support α) (π : StrPerm α) :
π • (S + T) = π • S + π • T :=
rfl
theorem add_inj_of_bound_eq_bound {S T U V : Support α}
(ha : Sᴬ.bound = Tᴬ.bound) (hN : Sᴺ.bound = Tᴺ.bound)
(h' : S + U = T + V) : S = T ∧ U = V := by
have ha' := Enumeration.add_inj_of_bound_eq_bound ha (congr_arg (·ᴬ) h')
have hN' := Enumeration.add_inj_of_bound_eq_bound hN (congr_arg (·ᴺ) h')
constructor
· exact Support.ext' ha'.1 hN'.1
· exact Support.ext' ha'.2 hN'.2
end Support
def supportEquiv {α : TypeIndex} : Support α ≃
Enumeration (α ↝ ⊥ × Atom) × Enumeration (α ↝ ⊥ × NearLitter) where
toFun S := (Sᴬ, Sᴺ)
invFun S := ⟨S.1, S.2⟩
left_inv _ := rfl
right_inv _ := rfl
theorem card_support {α : TypeIndex} : #(Support α) = #μ := by
rw [Cardinal.eq.mpr ⟨supportEquiv⟩, mk_prod, lift_id, lift_id,
card_enumeration_eq, card_enumeration_eq, mul_eq_self aleph0_lt_μ.le]
· rw [mk_prod, lift_id, lift_id, card_nearLitter,
mul_eq_right aleph0_lt_μ.le (card_path_lt' α ⊥).le (card_path_ne_zero α)]
· rw [mk_prod, lift_id, lift_id, card_atom,
mul_eq_right aleph0_lt_μ.le (card_path_lt' α ⊥).le (card_path_ne_zero α)]
/-!
## Orders on supports
-/
-- TODO: Is this order used?
instance : LE BaseSupport where
le S T := (∀ a ∈ Sᴬ, a ∈ Tᴬ) ∧ (∀ N ∈ Sᴺ, N ∈ Tᴺ)
instance : Preorder BaseSupport where
le_refl S := ⟨λ _ ↦ id, λ _ ↦ id⟩
le_trans S T U h₁ h₂ := ⟨λ a h ↦ h₂.1 _ (h₁.1 a h), λ N h ↦ h₂.2 _ (h₁.2 N h)⟩
theorem BaseSupport.smul_le_smul {S T : BaseSupport} (h : S ≤ T) (π : BasePerm) :
π • S ≤ π • T := by
constructor
· intro a
exact h.1 (π⁻¹ • a)
· intro N
exact h.2 (π⁻¹ • N)
theorem BaseSupport.le_add_right {S T : BaseSupport} :
S ≤ S + T := by
constructor
· intro a ha
simp only [Support.add_derivBot, BaseSupport.add_atoms, Enumeration.mem_add_iff]
exact Or.inl ha
· intro N hN
simp only [Support.add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
exact Or.inl hN
| theorem BaseSupport.le_add_left {S T : BaseSupport} :
S ≤ T + S | ConNF.BaseSupport.le_add_left | {
"commit": "39c33b4a743bea62dbcc549548b712ffd38ca65c",
"date": "2024-12-05T00:00:00"
} | {
"commit": "251ac752f844dfde539ac2bd3ff112305ad59139",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/ModelData/Support.lean | ConNF.ModelData.Support | ConNF.ModelData.Support.jsonl | {
"lineInFile": 487,
"tokenPositionInFile": 13576,
"theoremPositionInFile": 51
} | {
"inFilePremises": true,
"numInFilePremises": 5,
"repositoryPremises": true,
"numRepositoryPremises": 14,
"numPremises": 25
} | {
"hasProof": true,
"proof": ":= by\n constructor\n · intro a ha\n simp only [add_atoms, Enumeration.mem_add_iff]\n exact Or.inr ha\n · intro N hN\n simp only [add_nearLitters, Enumeration.mem_add_iff]\n exact Or.inr hN",
"proofType": "tactic",
"proofLengthLines": 7,
"proofLengthTokens": 197
} |
import ConNF.ModelData.PathEnumeration
/-!
# Supports
In this file, we define the notion of a support.
## Main declarations
* `ConNF.BaseSupport`: The type of supports of atoms.
* `ConNF.Support`: The type of supports of objects of arbitrary type indices.
-/
universe u
open Cardinal
namespace ConNF
variable [Params.{u}]
/-!
## Base supports
-/
structure BaseSupport where
atoms : Enumeration Atom
nearLitters : Enumeration NearLitter
namespace BaseSupport
instance : SuperA BaseSupport (Enumeration Atom) where
superA := atoms
instance : SuperN BaseSupport (Enumeration NearLitter) where
superN := nearLitters
@[simp]
theorem mk_atoms {a : Enumeration Atom} {N : Enumeration NearLitter} :
(BaseSupport.mk a N)ᴬ = a :=
rfl
@[simp]
theorem mk_nearLitters {a : Enumeration Atom} {N : Enumeration NearLitter} :
(BaseSupport.mk a N)ᴺ = N :=
rfl
theorem atoms_congr {S T : BaseSupport} (h : S = T) :
Sᴬ = Tᴬ :=
h ▸ rfl
theorem nearLitters_congr {S T : BaseSupport} (h : S = T) :
Sᴺ = Tᴺ :=
h ▸ rfl
@[ext]
theorem ext {S T : BaseSupport} (h₁ : Sᴬ = Tᴬ) (h₂ : Sᴺ = Tᴺ) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
cases h₁
cases h₂
rfl
instance : SMul BasePerm BaseSupport where
smul π S := ⟨π • Sᴬ, π • Sᴺ⟩
@[simp]
theorem smul_atoms (π : BasePerm) (S : BaseSupport) :
(π • S)ᴬ = π • Sᴬ :=
rfl
@[simp]
theorem smul_nearLitters (π : BasePerm) (S : BaseSupport) :
(π • S)ᴺ = π • Sᴺ :=
rfl
@[simp]
theorem smul_atoms_eq_of_smul_eq {π : BasePerm} {S : BaseSupport}
(h : π • S = S) :
π • Sᴬ = Sᴬ := by
rw [← smul_atoms, h]
@[simp]
theorem smul_nearLitters_eq_of_smul_eq {π : BasePerm} {S : BaseSupport}
(h : π • S = S) :
π • Sᴺ = Sᴺ := by
rw [← smul_nearLitters, h]
instance : MulAction BasePerm BaseSupport where
one_smul S := by
apply ext
· rw [smul_atoms, one_smul]
· rw [smul_nearLitters, one_smul]
mul_smul π₁ π₂ S := by
apply ext
· rw [smul_atoms, smul_atoms, smul_atoms, mul_smul]
· rw [smul_nearLitters, smul_nearLitters, smul_nearLitters, mul_smul]
theorem smul_eq_smul_iff (π₁ π₂ : BasePerm) (S : BaseSupport) :
π₁ • S = π₂ • S ↔ (∀ a ∈ Sᴬ, π₁ • a = π₂ • a) ∧ (∀ N ∈ Sᴺ, π₁ • N = π₂ • N) := by
constructor
· intro h
constructor
· rintro a ⟨i, ha⟩
have := congr_arg (·ᴬ.rel i (π₁ • a)) h
simp only [smul_atoms, Enumeration.smul_rel, inv_smul_smul, eq_iff_iff] at this
have := Sᴬ.rel_coinjective.coinjective ha (this.mp ha)
rw [eq_inv_smul_iff] at this
rw [this]
· rintro N ⟨i, hN⟩
have := congr_arg (·ᴺ.rel i (π₁ • N)) h
simp only [smul_nearLitters, Enumeration.smul_rel, inv_smul_smul, eq_iff_iff] at this
have := Sᴺ.rel_coinjective.coinjective hN (this.mp hN)
rw [eq_inv_smul_iff] at this
rw [this]
· intro h
ext : 2
· rfl
· ext i a : 3
rw [smul_atoms, smul_atoms, Enumeration.smul_rel, Enumeration.smul_rel]
constructor
· intro ha
have := h.1 _ ⟨i, ha⟩
rw [smul_inv_smul, ← inv_smul_eq_iff] at this
rwa [this]
· intro ha
have := h.1 _ ⟨i, ha⟩
rw [smul_inv_smul, smul_eq_iff_eq_inv_smul] at this
rwa [← this]
· rfl
· ext i a : 3
rw [smul_nearLitters, smul_nearLitters, Enumeration.smul_rel, Enumeration.smul_rel]
constructor
· intro hN
have := h.2 _ ⟨i, hN⟩
rw [smul_inv_smul, ← inv_smul_eq_iff] at this
rwa [this]
· intro hN
have := h.2 _ ⟨i, hN⟩
rw [smul_inv_smul, smul_eq_iff_eq_inv_smul] at this
rwa [← this]
theorem smul_eq_iff (π : BasePerm) (S : BaseSupport) :
π • S = S ↔ (∀ a ∈ Sᴬ, π • a = a) ∧ (∀ N ∈ Sᴺ, π • N = N) := by
have := smul_eq_smul_iff π 1 S
simp only [one_smul] at this
exact this
noncomputable instance : Add BaseSupport where
add S T := ⟨Sᴬ + Tᴬ, Sᴺ + Tᴺ⟩
@[simp]
theorem add_atoms (S T : BaseSupport) :
(S + T)ᴬ = Sᴬ + Tᴬ :=
rfl
@[simp]
theorem add_nearLitters (S T : BaseSupport) :
(S + T)ᴺ = Sᴺ + Tᴺ :=
rfl
end BaseSupport
def baseSupportEquiv : BaseSupport ≃ Enumeration Atom × Enumeration NearLitter where
toFun S := (Sᴬ, Sᴺ)
invFun S := ⟨S.1, S.2⟩
left_inv _ := rfl
right_inv _ := rfl
theorem card_baseSupport : #BaseSupport = #μ := by
rw [Cardinal.eq.mpr ⟨baseSupportEquiv⟩, mk_prod, lift_id, lift_id,
card_enumeration_eq card_atom, card_enumeration_eq card_nearLitter, mul_eq_self aleph0_lt_μ.le]
/-!
## Structural supports
-/
structure Support (α : TypeIndex) where
atoms : Enumeration (α ↝ ⊥ × Atom)
nearLitters : Enumeration (α ↝ ⊥ × NearLitter)
namespace Support
variable {α β : TypeIndex}
instance : SuperA (Support α) (Enumeration (α ↝ ⊥ × Atom)) where
superA := atoms
instance : SuperN (Support α) (Enumeration (α ↝ ⊥ × NearLitter)) where
superN := nearLitters
@[simp]
theorem mk_atoms (E : Enumeration (α ↝ ⊥ × Atom)) (F : Enumeration (α ↝ ⊥ × NearLitter)) :
(⟨E, F⟩ : Support α)ᴬ = E :=
rfl
@[simp]
theorem mk_nearLitters (E : Enumeration (α ↝ ⊥ × Atom)) (F : Enumeration (α ↝ ⊥ × NearLitter)) :
(⟨E, F⟩ : Support α)ᴺ = F :=
rfl
instance : Derivative (Support α) (Support β) α β where
deriv S A := ⟨Sᴬ ⇘ A, Sᴺ ⇘ A⟩
instance : Coderivative (Support β) (Support α) α β where
coderiv S A := ⟨Sᴬ ⇗ A, Sᴺ ⇗ A⟩
instance : BotDerivative (Support α) BaseSupport α where
botDeriv S A := ⟨Sᴬ ⇘. A, Sᴺ ⇘. A⟩
botSderiv S := ⟨Sᴬ ↘., Sᴺ ↘.⟩
botDeriv_single S h := by dsimp only; rw [botDeriv_single, botDeriv_single]
@[simp]
theorem deriv_atoms {α β : TypeIndex} (S : Support α) (A : α ↝ β) :
Sᴬ ⇘ A = (S ⇘ A)ᴬ :=
rfl
@[simp]
theorem deriv_nearLitters {α β : TypeIndex} (S : Support α) (A : α ↝ β) :
Sᴺ ⇘ A = (S ⇘ A)ᴺ :=
rfl
@[simp]
theorem sderiv_atoms {α β : TypeIndex} (S : Support α) (h : β < α) :
Sᴬ ↘ h = (S ↘ h)ᴬ :=
rfl
@[simp]
theorem sderiv_nearLitters {α β : TypeIndex} (S : Support α) (h : β < α) :
Sᴺ ↘ h = (S ↘ h)ᴺ :=
rfl
@[simp]
theorem coderiv_atoms {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
Sᴬ ⇗ A = (S ⇗ A)ᴬ :=
rfl
@[simp]
theorem coderiv_nearLitters {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
Sᴺ ⇗ A = (S ⇗ A)ᴺ :=
rfl
@[simp]
theorem scoderiv_atoms {α β : TypeIndex} (S : Support β) (h : β < α) :
Sᴬ ↗ h = (S ↗ h)ᴬ :=
rfl
@[simp]
theorem scoderiv_nearLitters {α β : TypeIndex} (S : Support β) (h : β < α) :
Sᴺ ↗ h = (S ↗ h)ᴺ :=
rfl
@[simp]
theorem derivBot_atoms {α : TypeIndex} (S : Support α) (A : α ↝ ⊥) :
Sᴬ ⇘. A = (S ⇘. A)ᴬ :=
rfl
@[simp]
theorem derivBot_nearLitters {α : TypeIndex} (S : Support α) (A : α ↝ ⊥) :
Sᴺ ⇘. A = (S ⇘. A)ᴺ :=
rfl
theorem ext' {S T : Support α} (h₁ : Sᴬ = Tᴬ) (h₂ : Sᴺ = Tᴺ) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
cases h₁
cases h₂
rfl
@[ext]
theorem ext {S T : Support α} (h : ∀ A, S ⇘. A = T ⇘. A) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
rw [mk.injEq]
constructor
· apply Enumeration.ext_path
intro A
exact BaseSupport.atoms_congr (h A)
· apply Enumeration.ext_path
intro A
exact BaseSupport.nearLitters_congr (h A)
@[simp]
theorem deriv_derivBot {α : TypeIndex} (S : Support α)
(A : α ↝ β) (B : β ↝ ⊥) :
S ⇘ A ⇘. B = S ⇘. (A ⇘ B) :=
rfl
@[simp]
theorem coderiv_deriv_eq {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
S ⇗ A ⇘ A = S :=
ext' (Sᴬ.coderiv_deriv_eq A) (Sᴺ.coderiv_deriv_eq A)
theorem eq_of_atom_mem_scoderiv_botDeriv {α β : TypeIndex} {S : Support β} {A : α ↝ ⊥}
{h : β < α} {a : Atom} (ha : a ∈ (S ↗ h ⇘. A)ᴬ) :
∃ B : β ↝ ⊥, A = B ↗ h :=
Enumeration.eq_of_mem_scoderiv_botDeriv ha
theorem eq_of_nearLitter_mem_scoderiv_botDeriv {α β : TypeIndex} {S : Support β} {A : α ↝ ⊥}
{h : β < α} {N : NearLitter} (hN : N ∈ (S ↗ h ⇘. A)ᴺ) :
∃ B : β ↝ ⊥, A = B ↗ h :=
Enumeration.eq_of_mem_scoderiv_botDeriv hN
@[simp]
theorem scoderiv_botDeriv_eq {α β : TypeIndex} (S : Support β) (A : β ↝ ⊥) (h : β < α) :
S ↗ h ⇘. (A ↗ h) = S ⇘. A :=
BaseSupport.ext (Enumeration.scoderiv_botDeriv_eq _ _ _) (Enumeration.scoderiv_botDeriv_eq _ _ _)
@[simp]
theorem scoderiv_deriv_eq {α β γ : TypeIndex} (S : Support β) (A : β ↝ γ) (h : β < α) :
S ↗ h ⇘ (A ↗ h) = S ⇘ A := by
apply ext
intro B
simp only [deriv_derivBot, ← scoderiv_botDeriv_eq S (A ⇘ B) h, Path.coderiv_deriv']
@[simp]
theorem coderiv_inj {α β : TypeIndex} (S T : Support β) (A : α ↝ β) :
S ⇗ A = T ⇗ A ↔ S = T := by
constructor
swap
· rintro rfl
rfl
intro h
ext B : 1
have : S ⇗ A ⇘ A ⇘. B = T ⇗ A ⇘ A ⇘. B := by rw [h]
rwa [coderiv_deriv_eq, coderiv_deriv_eq] at this
@[simp]
theorem scoderiv_inj {α β : TypeIndex} (S T : Support β) (h : β < α) :
S ↗ h = T ↗ h ↔ S = T :=
coderiv_inj S T (.single h)
instance {α : TypeIndex} : SMul (StrPerm α) (Support α) where
smul π S := ⟨π • Sᴬ, π • Sᴺ⟩
@[simp]
theorem smul_atoms {α : TypeIndex} (π : StrPerm α) (S : Support α) :
(π • S)ᴬ = π • Sᴬ :=
rfl
@[simp]
theorem smul_nearLitters {α : TypeIndex} (π : StrPerm α) (S : Support α) :
(π • S)ᴺ = π • Sᴺ :=
rfl
theorem smul_atoms_eq_of_smul_eq {α : TypeIndex} {π : StrPerm α} {S : Support α}
(h : π • S = S) :
π • Sᴬ = Sᴬ := by
rw [← smul_atoms, h]
theorem smul_nearLitters_eq_of_smul_eq {α : TypeIndex} {π : StrPerm α} {S : Support α}
(h : π • S = S) :
π • Sᴺ = Sᴺ := by
rw [← smul_nearLitters, h]
instance {α : TypeIndex} : MulAction (StrPerm α) (Support α) where
one_smul S := by
apply ext'
· rw [smul_atoms, one_smul]
· rw [smul_nearLitters, one_smul]
mul_smul π₁ π₂ S := by
apply ext'
· rw [smul_atoms, smul_atoms, smul_atoms, mul_smul]
· rw [smul_nearLitters, smul_nearLitters, smul_nearLitters, mul_smul]
@[simp]
theorem smul_derivBot {α : TypeIndex} (π : StrPerm α) (S : Support α) (A : α ↝ ⊥) :
(π • S) ⇘. A = π A • (S ⇘. A) :=
rfl
theorem smul_coderiv {α : TypeIndex} (π : StrPerm α) (S : Support β) (A : α ↝ β) :
π • S ⇗ A = (π ⇘ A • S) ⇗ A := by
ext B i x
· rfl
· constructor
· rintro ⟨⟨C, x⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, x⟩, hS, rfl⟩
· rintro ⟨⟨C, x⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, _⟩, hS, rfl⟩
· rfl
· constructor
· rintro ⟨⟨C, x⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, x⟩, hS, rfl⟩
· rintro ⟨⟨C, a⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, _⟩, hS, rfl⟩
theorem smul_scoderiv {α : TypeIndex} (π : StrPerm α) (S : Support β) (h : β < α) :
π • S ↗ h = (π ↘ h • S) ↗ h :=
smul_coderiv π S (Path.single h)
theorem smul_eq_smul_iff (π₁ π₂ : StrPerm β) (S : Support β) :
π₁ • S = π₂ • S ↔
∀ A, (∀ a ∈ (S ⇘. A)ᴬ, π₁ A • a = π₂ A • a) ∧ (∀ N ∈ (S ⇘. A)ᴺ, π₁ A • N = π₂ A • N) := by
constructor
· intro h A
have := congr_arg (· ⇘. A) h
simp only [smul_derivBot, BaseSupport.smul_eq_smul_iff] at this
exact this
· intro h
apply ext
intro A
simp only [smul_derivBot, BaseSupport.smul_eq_smul_iff]
exact h A
theorem smul_eq_iff (π : StrPerm β) (S : Support β) :
π • S = S ↔ ∀ A, (∀ a ∈ (S ⇘. A)ᴬ, π A • a = a) ∧ (∀ N ∈ (S ⇘. A)ᴺ, π A • N = N) := by
have := smul_eq_smul_iff π 1 S
simp only [one_smul, Tree.one_apply] at this
exact this
noncomputable instance : Add (Support α) where
add S T := ⟨Sᴬ + Tᴬ, Sᴺ + Tᴺ⟩
@[simp]
theorem add_derivBot (S T : Support α) (A : α ↝ ⊥) :
(S + T) ⇘. A = (S ⇘. A) + (T ⇘. A) :=
rfl
theorem smul_add (S T : Support α) (π : StrPerm α) :
π • (S + T) = π • S + π • T :=
rfl
theorem add_inj_of_bound_eq_bound {S T U V : Support α}
(ha : Sᴬ.bound = Tᴬ.bound) (hN : Sᴺ.bound = Tᴺ.bound)
(h' : S + U = T + V) : S = T ∧ U = V := by
have ha' := Enumeration.add_inj_of_bound_eq_bound ha (congr_arg (·ᴬ) h')
have hN' := Enumeration.add_inj_of_bound_eq_bound hN (congr_arg (·ᴺ) h')
constructor
· exact Support.ext' ha'.1 hN'.1
· exact Support.ext' ha'.2 hN'.2
end Support
def supportEquiv {α : TypeIndex} : Support α ≃
Enumeration (α ↝ ⊥ × Atom) × Enumeration (α ↝ ⊥ × NearLitter) where
toFun S := (Sᴬ, Sᴺ)
invFun S := ⟨S.1, S.2⟩
left_inv _ := rfl
right_inv _ := rfl
theorem card_support {α : TypeIndex} : #(Support α) = #μ := by
rw [Cardinal.eq.mpr ⟨supportEquiv⟩, mk_prod, lift_id, lift_id,
card_enumeration_eq, card_enumeration_eq, mul_eq_self aleph0_lt_μ.le]
· rw [mk_prod, lift_id, lift_id, card_nearLitter,
mul_eq_right aleph0_lt_μ.le (card_path_lt' α ⊥).le (card_path_ne_zero α)]
· rw [mk_prod, lift_id, lift_id, card_atom,
mul_eq_right aleph0_lt_μ.le (card_path_lt' α ⊥).le (card_path_ne_zero α)]
/-!
## Orders on supports
-/
-- TODO: Is this order used?
instance : LE BaseSupport where
le S T := (∀ a ∈ Sᴬ, a ∈ Tᴬ) ∧ (∀ N ∈ Sᴺ, N ∈ Tᴺ)
instance : Preorder BaseSupport where
le_refl S := ⟨λ _ ↦ id, λ _ ↦ id⟩
le_trans S T U h₁ h₂ := ⟨λ a h ↦ h₂.1 _ (h₁.1 a h), λ N h ↦ h₂.2 _ (h₁.2 N h)⟩
theorem BaseSupport.smul_le_smul {S T : BaseSupport} (h : S ≤ T) (π : BasePerm) :
π • S ≤ π • T := by
constructor
· intro a
exact h.1 (π⁻¹ • a)
· intro N
exact h.2 (π⁻¹ • N)
| theorem BaseSupport.le_add_right {S T : BaseSupport} :
S ≤ S + T | ConNF.BaseSupport.le_add_right | {
"commit": "39c33b4a743bea62dbcc549548b712ffd38ca65c",
"date": "2024-12-05T00:00:00"
} | {
"commit": "251ac752f844dfde539ac2bd3ff112305ad59139",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/ModelData/Support.lean | ConNF.ModelData.Support | ConNF.ModelData.Support.jsonl | {
"lineInFile": 477,
"tokenPositionInFile": 13240,
"theoremPositionInFile": 50
} | {
"inFilePremises": true,
"numInFilePremises": 5,
"repositoryPremises": true,
"numRepositoryPremises": 14,
"numPremises": 25
} | {
"hasProof": true,
"proof": ":= by\n constructor\n · intro a ha\n simp only [Support.add_derivBot, BaseSupport.add_atoms, Enumeration.mem_add_iff]\n exact Or.inl ha\n · intro N hN\n simp only [Support.add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]\n exact Or.inl hN",
"proofType": "tactic",
"proofLengthLines": 7,
"proofLengthTokens": 265
} |
import ConNF.External.Basic
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
/-- A set in our model that is a well-order. Internal well-orders are exactly external well-orders,
so we externalise the definition for convenience. -/
def InternalWellOrder (r : TSet α) : Prop :=
IsWellOrder (ExternalRel hβ hγ hδ r).field
(InvImage (ExternalRel hβ hγ hδ r) Subtype.val)
def InternallyWellOrdered (x : TSet γ) : Prop :=
{y : TSet δ | y ∈' x}.Subsingleton ∨ (∃ r, InternalWellOrder hβ hγ hδ r ∧ x = field hβ hγ hδ r)
@[simp]
theorem externalRel_smul (r : TSet α) (ρ : AllPerm α) :
ExternalRel hβ hγ hδ (ρ • r) =
InvImage (ExternalRel hβ hγ hδ r) ((ρ ↘ hβ ↘ hγ ↘ hδ)⁻¹ • ·) := by
ext a b
simp only [ExternalRel, mem_smul_iff', allPerm_inv_sderiv', smul_op, InvImage]
omit [Params] in
/-- Well-orders are rigid. -/
theorem apply_eq_of_isWellOrder {X : Type _} {r : Rel X X} {f : X → X}
(hr : IsWellOrder X r) (hf : Function.Bijective f) (hf' : ∀ x y, r x y ↔ r (f x) (f y)) :
∀ x, f x = x := by
let emb : r ≼i r := ⟨⟨⟨f, hf.injective⟩, λ {a b} ↦ (hf' a b).symm⟩, ?_⟩
· have : emb = InitialSeg.refl r := Subsingleton.elim _ _
intro x
exact congr_arg (λ f ↦ f x) this
· intro a b h
exact hf.surjective _
omit [Params] in
theorem apply_eq_of_isWellOrder' {X : Type _} {r : Rel X X} {f : X → X}
(hr : IsWellOrder r.field (InvImage r Subtype.val)) (hf : Function.Bijective f)
(hf' : ∀ x y, r x y ↔ r (f x) (f y)) :
∀ x ∈ r.field, f x = x := by
have : ∀ x ∈ r.field, f x ∈ r.field := by
rintro x (⟨y, h⟩ | ⟨y, h⟩)
· exact Or.inl ⟨f y, (hf' x y).mp h⟩
· exact Or.inr ⟨f y, (hf' y x).mp h⟩
have := apply_eq_of_isWellOrder (f := λ x ↦ ⟨f x.val, this x.val x.prop⟩) hr ⟨?_, ?_⟩ ?_
· intro x hx
exact congr_arg Subtype.val (this ⟨x, hx⟩)
· intro x y h
rw [Subtype.mk.injEq] at h
exact Subtype.val_injective (hf.injective h)
· intro x
obtain ⟨y, hy⟩ := hf.surjective x.val
refine ⟨⟨y, ?_⟩, ?_⟩
· obtain (⟨z, h⟩ | ⟨z, h⟩) := x.prop <;>
rw [← hy] at h <;>
obtain ⟨z, rfl⟩ := hf.surjective z
· exact Or.inl ⟨z, (hf' y z).mpr h⟩
· exact Or.inr ⟨z, (hf' z y).mpr h⟩
· simp only [hy]
· intros
apply hf'
theorem exists_common_support_of_internallyWellOrdered' {x : TSet δ}
(h : InternallyWellOrdered hγ hδ hε x) :
∃ S : Support β, ∀ y, y ∈' x → S.Supports { { {y}' }' }[hγ] := by
obtain (h | ⟨r, h, rfl⟩) := h
· obtain (h | ⟨y, hy⟩) := h.eq_empty_or_singleton
· use ⟨Enumeration.empty, Enumeration.empty⟩
intro y hy
rw [Set.eq_empty_iff_forall_not_mem] at h
cases h y hy
· obtain ⟨S, hS⟩ := TSet.exists_support y
use S ↗ hε ↗ hδ ↗ hγ
intro z hz
rw [Set.eq_singleton_iff_unique_mem] at hy
cases hy.2 z hz
refine ⟨?_, λ h ↦ by cases h⟩
intro ρ hρ
simp only [Support.smul_scoderiv, ← allPermSderiv_forget', Support.scoderiv_inj] at hρ
simp only [smul_singleton, singleton_inj]
exact hS _ hρ
obtain ⟨S, hS⟩ := TSet.exists_support r
use S
intro a ha
refine ⟨?_, λ h ↦ by cases h⟩
intro ρ hρ
have := hS ρ hρ
simp only [smul_singleton, singleton_inj]
apply apply_eq_of_isWellOrder' (r := ExternalRel hγ hδ hε r)
· exact h
· exact MulAction.bijective (ρ ↘ hγ ↘ hδ ↘ hε)
· intro x y
conv_rhs => rw [← this]
simp only [externalRel_smul, InvImage, inv_smul_smul]
· rwa [mem_field_iff] at ha
include hγ in
| theorem Support.Supports.ofSingleton {S : Support α} {x : TSet β}
(h : S.Supports {x}') :
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
(S.strong ↘ hβ).Supports x | ConNF.Support.Supports.ofSingleton | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | {
"commit": "1c08486feb882444888c228ce1501e92bb85e0e2",
"date": "2025-01-07T00:00:00"
} | ConNF/ConNF/External/WellOrder.lean | ConNF.External.WellOrder | ConNF.External.WellOrder.jsonl | {
"lineInFile": 113,
"tokenPositionInFile": 3749,
"theoremPositionInFile": 6
} | {
"inFilePremises": false,
"numInFilePremises": 0,
"repositoryPremises": true,
"numRepositoryPremises": 43,
"numPremises": 114
} | {
"hasProof": true,
"proof": ":= by\n refine ⟨?_, λ h ↦ by cases h⟩\n intro ρ hρ\n open scoped Pointwise in\n have := sUnion_singleton_symmetric_aux hγ hβ {y | y ∈' x} S ?_ ρ hρ\n · apply ConNF.ext hγ\n intro z\n simp only [Set.ext_iff, Set.mem_setOf_eq, Set.mem_smul_set_iff_inv_smul_mem] at this\n rw [mem_smul_iff', allPerm_inv_sderiv', this]\n · intro ρ hρ\n ext z\n simp only [Set.mem_smul_set_iff_inv_smul_mem, Set.mem_image, Set.mem_setOf_eq]\n have := h.supports ρ hρ\n simp only [smul_singleton, singleton_inj] at this\n constructor\n · rintro ⟨y, h₁, h₂⟩\n rw [← smul_eq_iff_eq_inv_smul, smul_singleton] at h₂\n refine ⟨_, ?_, h₂⟩\n rw [← this]\n simp only [mem_smul_iff', allPerm_inv_sderiv', inv_smul_smul]\n exact h₁\n · rintro ⟨y, h, rfl⟩\n refine ⟨(ρ ↘ hβ ↘ hγ)⁻¹ • y, ?_, ?_⟩\n · rwa [← allPerm_inv_sderiv', ← mem_smul_iff', this]\n · simp only [smul_singleton, allPerm_inv_sderiv']",
"proofType": "tactic",
"proofLengthLines": 24,
"proofLengthTokens": 920
} |
import ConNF.ModelData.PathEnumeration
/-!
# Supports
In this file, we define the notion of a support.
## Main declarations
* `ConNF.BaseSupport`: The type of supports of atoms.
* `ConNF.Support`: The type of supports of objects of arbitrary type indices.
-/
universe u
open Cardinal
namespace ConNF
variable [Params.{u}]
/-!
## Base supports
-/
structure BaseSupport where
atoms : Enumeration Atom
nearLitters : Enumeration NearLitter
namespace BaseSupport
instance : SuperA BaseSupport (Enumeration Atom) where
superA := atoms
instance : SuperN BaseSupport (Enumeration NearLitter) where
superN := nearLitters
@[simp]
theorem mk_atoms {a : Enumeration Atom} {N : Enumeration NearLitter} :
(BaseSupport.mk a N)ᴬ = a :=
rfl
@[simp]
theorem mk_nearLitters {a : Enumeration Atom} {N : Enumeration NearLitter} :
(BaseSupport.mk a N)ᴺ = N :=
rfl
theorem atoms_congr {S T : BaseSupport} (h : S = T) :
Sᴬ = Tᴬ :=
h ▸ rfl
theorem nearLitters_congr {S T : BaseSupport} (h : S = T) :
Sᴺ = Tᴺ :=
h ▸ rfl
@[ext]
theorem ext {S T : BaseSupport} (h₁ : Sᴬ = Tᴬ) (h₂ : Sᴺ = Tᴺ) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
cases h₁
cases h₂
rfl
instance : SMul BasePerm BaseSupport where
smul π S := ⟨π • Sᴬ, π • Sᴺ⟩
@[simp]
theorem smul_atoms (π : BasePerm) (S : BaseSupport) :
(π • S)ᴬ = π • Sᴬ :=
rfl
@[simp]
theorem smul_nearLitters (π : BasePerm) (S : BaseSupport) :
(π • S)ᴺ = π • Sᴺ :=
rfl
@[simp]
theorem smul_atoms_eq_of_smul_eq {π : BasePerm} {S : BaseSupport}
(h : π • S = S) :
π • Sᴬ = Sᴬ := by
rw [← smul_atoms, h]
@[simp]
theorem smul_nearLitters_eq_of_smul_eq {π : BasePerm} {S : BaseSupport}
(h : π • S = S) :
π • Sᴺ = Sᴺ := by
rw [← smul_nearLitters, h]
instance : MulAction BasePerm BaseSupport where
one_smul S := by
apply ext
· rw [smul_atoms, one_smul]
· rw [smul_nearLitters, one_smul]
mul_smul π₁ π₂ S := by
apply ext
· rw [smul_atoms, smul_atoms, smul_atoms, mul_smul]
· rw [smul_nearLitters, smul_nearLitters, smul_nearLitters, mul_smul]
theorem smul_eq_smul_iff (π₁ π₂ : BasePerm) (S : BaseSupport) :
π₁ • S = π₂ • S ↔ (∀ a ∈ Sᴬ, π₁ • a = π₂ • a) ∧ (∀ N ∈ Sᴺ, π₁ • N = π₂ • N) := by
constructor
· intro h
constructor
· rintro a ⟨i, ha⟩
have := congr_arg (·ᴬ.rel i (π₁ • a)) h
simp only [smul_atoms, Enumeration.smul_rel, inv_smul_smul, eq_iff_iff] at this
have := Sᴬ.rel_coinjective.coinjective ha (this.mp ha)
rw [eq_inv_smul_iff] at this
rw [this]
· rintro N ⟨i, hN⟩
have := congr_arg (·ᴺ.rel i (π₁ • N)) h
simp only [smul_nearLitters, Enumeration.smul_rel, inv_smul_smul, eq_iff_iff] at this
have := Sᴺ.rel_coinjective.coinjective hN (this.mp hN)
rw [eq_inv_smul_iff] at this
rw [this]
· intro h
ext : 2
· rfl
· ext i a : 3
rw [smul_atoms, smul_atoms, Enumeration.smul_rel, Enumeration.smul_rel]
constructor
· intro ha
have := h.1 _ ⟨i, ha⟩
rw [smul_inv_smul, ← inv_smul_eq_iff] at this
rwa [this]
· intro ha
have := h.1 _ ⟨i, ha⟩
rw [smul_inv_smul, smul_eq_iff_eq_inv_smul] at this
rwa [← this]
· rfl
· ext i a : 3
rw [smul_nearLitters, smul_nearLitters, Enumeration.smul_rel, Enumeration.smul_rel]
constructor
· intro hN
have := h.2 _ ⟨i, hN⟩
rw [smul_inv_smul, ← inv_smul_eq_iff] at this
rwa [this]
· intro hN
have := h.2 _ ⟨i, hN⟩
rw [smul_inv_smul, smul_eq_iff_eq_inv_smul] at this
rwa [← this]
theorem smul_eq_iff (π : BasePerm) (S : BaseSupport) :
π • S = S ↔ (∀ a ∈ Sᴬ, π • a = a) ∧ (∀ N ∈ Sᴺ, π • N = N) := by
have := smul_eq_smul_iff π 1 S
simp only [one_smul] at this
exact this
noncomputable instance : Add BaseSupport where
add S T := ⟨Sᴬ + Tᴬ, Sᴺ + Tᴺ⟩
@[simp]
theorem add_atoms (S T : BaseSupport) :
(S + T)ᴬ = Sᴬ + Tᴬ :=
rfl
@[simp]
theorem add_nearLitters (S T : BaseSupport) :
(S + T)ᴺ = Sᴺ + Tᴺ :=
rfl
end BaseSupport
def baseSupportEquiv : BaseSupport ≃ Enumeration Atom × Enumeration NearLitter where
toFun S := (Sᴬ, Sᴺ)
invFun S := ⟨S.1, S.2⟩
left_inv _ := rfl
right_inv _ := rfl
theorem card_baseSupport : #BaseSupport = #μ := by
rw [Cardinal.eq.mpr ⟨baseSupportEquiv⟩, mk_prod, lift_id, lift_id,
card_enumeration_eq card_atom, card_enumeration_eq card_nearLitter, mul_eq_self aleph0_lt_μ.le]
/-!
## Structural supports
-/
structure Support (α : TypeIndex) where
atoms : Enumeration (α ↝ ⊥ × Atom)
nearLitters : Enumeration (α ↝ ⊥ × NearLitter)
namespace Support
variable {α β : TypeIndex}
instance : SuperA (Support α) (Enumeration (α ↝ ⊥ × Atom)) where
superA := atoms
instance : SuperN (Support α) (Enumeration (α ↝ ⊥ × NearLitter)) where
superN := nearLitters
@[simp]
theorem mk_atoms (E : Enumeration (α ↝ ⊥ × Atom)) (F : Enumeration (α ↝ ⊥ × NearLitter)) :
(⟨E, F⟩ : Support α)ᴬ = E :=
rfl
@[simp]
theorem mk_nearLitters (E : Enumeration (α ↝ ⊥ × Atom)) (F : Enumeration (α ↝ ⊥ × NearLitter)) :
(⟨E, F⟩ : Support α)ᴺ = F :=
rfl
instance : Derivative (Support α) (Support β) α β where
deriv S A := ⟨Sᴬ ⇘ A, Sᴺ ⇘ A⟩
instance : Coderivative (Support β) (Support α) α β where
coderiv S A := ⟨Sᴬ ⇗ A, Sᴺ ⇗ A⟩
instance : BotDerivative (Support α) BaseSupport α where
botDeriv S A := ⟨Sᴬ ⇘. A, Sᴺ ⇘. A⟩
botSderiv S := ⟨Sᴬ ↘., Sᴺ ↘.⟩
botDeriv_single S h := by dsimp only; rw [botDeriv_single, botDeriv_single]
@[simp]
theorem deriv_atoms {α β : TypeIndex} (S : Support α) (A : α ↝ β) :
Sᴬ ⇘ A = (S ⇘ A)ᴬ :=
rfl
@[simp]
theorem deriv_nearLitters {α β : TypeIndex} (S : Support α) (A : α ↝ β) :
Sᴺ ⇘ A = (S ⇘ A)ᴺ :=
rfl
@[simp]
theorem sderiv_atoms {α β : TypeIndex} (S : Support α) (h : β < α) :
Sᴬ ↘ h = (S ↘ h)ᴬ :=
rfl
@[simp]
theorem sderiv_nearLitters {α β : TypeIndex} (S : Support α) (h : β < α) :
Sᴺ ↘ h = (S ↘ h)ᴺ :=
rfl
@[simp]
theorem coderiv_atoms {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
Sᴬ ⇗ A = (S ⇗ A)ᴬ :=
rfl
@[simp]
theorem coderiv_nearLitters {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
Sᴺ ⇗ A = (S ⇗ A)ᴺ :=
rfl
@[simp]
theorem scoderiv_atoms {α β : TypeIndex} (S : Support β) (h : β < α) :
Sᴬ ↗ h = (S ↗ h)ᴬ :=
rfl
@[simp]
theorem scoderiv_nearLitters {α β : TypeIndex} (S : Support β) (h : β < α) :
Sᴺ ↗ h = (S ↗ h)ᴺ :=
rfl
@[simp]
theorem derivBot_atoms {α : TypeIndex} (S : Support α) (A : α ↝ ⊥) :
Sᴬ ⇘. A = (S ⇘. A)ᴬ :=
rfl
@[simp]
theorem derivBot_nearLitters {α : TypeIndex} (S : Support α) (A : α ↝ ⊥) :
Sᴺ ⇘. A = (S ⇘. A)ᴺ :=
rfl
theorem ext' {S T : Support α} (h₁ : Sᴬ = Tᴬ) (h₂ : Sᴺ = Tᴺ) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
cases h₁
cases h₂
rfl
@[ext]
theorem ext {S T : Support α} (h : ∀ A, S ⇘. A = T ⇘. A) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
rw [mk.injEq]
constructor
· apply Enumeration.ext_path
intro A
exact BaseSupport.atoms_congr (h A)
· apply Enumeration.ext_path
intro A
exact BaseSupport.nearLitters_congr (h A)
@[simp]
theorem deriv_derivBot {α : TypeIndex} (S : Support α)
(A : α ↝ β) (B : β ↝ ⊥) :
S ⇘ A ⇘. B = S ⇘. (A ⇘ B) :=
rfl
@[simp]
theorem coderiv_deriv_eq {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
S ⇗ A ⇘ A = S :=
ext' (Sᴬ.coderiv_deriv_eq A) (Sᴺ.coderiv_deriv_eq A)
theorem eq_of_atom_mem_scoderiv_botDeriv {α β : TypeIndex} {S : Support β} {A : α ↝ ⊥}
{h : β < α} {a : Atom} (ha : a ∈ (S ↗ h ⇘. A)ᴬ) :
∃ B : β ↝ ⊥, A = B ↗ h :=
Enumeration.eq_of_mem_scoderiv_botDeriv ha
theorem eq_of_nearLitter_mem_scoderiv_botDeriv {α β : TypeIndex} {S : Support β} {A : α ↝ ⊥}
{h : β < α} {N : NearLitter} (hN : N ∈ (S ↗ h ⇘. A)ᴺ) :
∃ B : β ↝ ⊥, A = B ↗ h :=
Enumeration.eq_of_mem_scoderiv_botDeriv hN
@[simp]
theorem scoderiv_botDeriv_eq {α β : TypeIndex} (S : Support β) (A : β ↝ ⊥) (h : β < α) :
S ↗ h ⇘. (A ↗ h) = S ⇘. A :=
BaseSupport.ext (Enumeration.scoderiv_botDeriv_eq _ _ _) (Enumeration.scoderiv_botDeriv_eq _ _ _)
@[simp]
theorem scoderiv_deriv_eq {α β γ : TypeIndex} (S : Support β) (A : β ↝ γ) (h : β < α) :
S ↗ h ⇘ (A ↗ h) = S ⇘ A := by
apply ext
intro B
simp only [deriv_derivBot, ← scoderiv_botDeriv_eq S (A ⇘ B) h, Path.coderiv_deriv']
@[simp]
theorem coderiv_inj {α β : TypeIndex} (S T : Support β) (A : α ↝ β) :
S ⇗ A = T ⇗ A ↔ S = T := by
constructor
swap
· rintro rfl
rfl
intro h
ext B : 1
have : S ⇗ A ⇘ A ⇘. B = T ⇗ A ⇘ A ⇘. B := by rw [h]
rwa [coderiv_deriv_eq, coderiv_deriv_eq] at this
@[simp]
theorem scoderiv_inj {α β : TypeIndex} (S T : Support β) (h : β < α) :
S ↗ h = T ↗ h ↔ S = T :=
coderiv_inj S T (.single h)
instance {α : TypeIndex} : SMul (StrPerm α) (Support α) where
smul π S := ⟨π • Sᴬ, π • Sᴺ⟩
@[simp]
theorem smul_atoms {α : TypeIndex} (π : StrPerm α) (S : Support α) :
(π • S)ᴬ = π • Sᴬ :=
rfl
@[simp]
theorem smul_nearLitters {α : TypeIndex} (π : StrPerm α) (S : Support α) :
(π • S)ᴺ = π • Sᴺ :=
rfl
theorem smul_atoms_eq_of_smul_eq {α : TypeIndex} {π : StrPerm α} {S : Support α}
(h : π • S = S) :
π • Sᴬ = Sᴬ := by
rw [← smul_atoms, h]
theorem smul_nearLitters_eq_of_smul_eq {α : TypeIndex} {π : StrPerm α} {S : Support α}
(h : π • S = S) :
π • Sᴺ = Sᴺ := by
rw [← smul_nearLitters, h]
instance {α : TypeIndex} : MulAction (StrPerm α) (Support α) where
one_smul S := by
apply ext'
· rw [smul_atoms, one_smul]
· rw [smul_nearLitters, one_smul]
mul_smul π₁ π₂ S := by
apply ext'
· rw [smul_atoms, smul_atoms, smul_atoms, mul_smul]
· rw [smul_nearLitters, smul_nearLitters, smul_nearLitters, mul_smul]
@[simp]
theorem smul_derivBot {α : TypeIndex} (π : StrPerm α) (S : Support α) (A : α ↝ ⊥) :
(π • S) ⇘. A = π A • (S ⇘. A) :=
rfl
theorem smul_coderiv {α : TypeIndex} (π : StrPerm α) (S : Support β) (A : α ↝ β) :
π • S ⇗ A = (π ⇘ A • S) ⇗ A := by
ext B i x
· rfl
· constructor
· rintro ⟨⟨C, x⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, x⟩, hS, rfl⟩
· rintro ⟨⟨C, x⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, _⟩, hS, rfl⟩
· rfl
· constructor
· rintro ⟨⟨C, x⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, x⟩, hS, rfl⟩
· rintro ⟨⟨C, a⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, _⟩, hS, rfl⟩
theorem smul_scoderiv {α : TypeIndex} (π : StrPerm α) (S : Support β) (h : β < α) :
π • S ↗ h = (π ↘ h • S) ↗ h :=
smul_coderiv π S (Path.single h)
theorem smul_eq_smul_iff (π₁ π₂ : StrPerm β) (S : Support β) :
π₁ • S = π₂ • S ↔
∀ A, (∀ a ∈ (S ⇘. A)ᴬ, π₁ A • a = π₂ A • a) ∧ (∀ N ∈ (S ⇘. A)ᴺ, π₁ A • N = π₂ A • N) := by
constructor
· intro h A
have := congr_arg (· ⇘. A) h
simp only [smul_derivBot, BaseSupport.smul_eq_smul_iff] at this
exact this
· intro h
apply ext
intro A
simp only [smul_derivBot, BaseSupport.smul_eq_smul_iff]
exact h A
theorem smul_eq_iff (π : StrPerm β) (S : Support β) :
π • S = S ↔ ∀ A, (∀ a ∈ (S ⇘. A)ᴬ, π A • a = a) ∧ (∀ N ∈ (S ⇘. A)ᴺ, π A • N = N) := by
have := smul_eq_smul_iff π 1 S
simp only [one_smul, Tree.one_apply] at this
exact this
noncomputable instance : Add (Support α) where
add S T := ⟨Sᴬ + Tᴬ, Sᴺ + Tᴺ⟩
@[simp]
theorem add_derivBot (S T : Support α) (A : α ↝ ⊥) :
(S + T) ⇘. A = (S ⇘. A) + (T ⇘. A) :=
rfl
theorem smul_add (S T : Support α) (π : StrPerm α) :
π • (S + T) = π • S + π • T :=
rfl
theorem add_inj_of_bound_eq_bound {S T U V : Support α}
(ha : Sᴬ.bound = Tᴬ.bound) (hN : Sᴺ.bound = Tᴺ.bound)
(h' : S + U = T + V) : S = T ∧ U = V := by
have ha' := Enumeration.add_inj_of_bound_eq_bound ha (congr_arg (·ᴬ) h')
have hN' := Enumeration.add_inj_of_bound_eq_bound hN (congr_arg (·ᴺ) h')
constructor
· exact Support.ext' ha'.1 hN'.1
· exact Support.ext' ha'.2 hN'.2
end Support
def supportEquiv {α : TypeIndex} : Support α ≃
Enumeration (α ↝ ⊥ × Atom) × Enumeration (α ↝ ⊥ × NearLitter) where
toFun S := (Sᴬ, Sᴺ)
invFun S := ⟨S.1, S.2⟩
left_inv _ := rfl
right_inv _ := rfl
theorem card_support {α : TypeIndex} : #(Support α) = #μ := by
rw [Cardinal.eq.mpr ⟨supportEquiv⟩, mk_prod, lift_id, lift_id,
card_enumeration_eq, card_enumeration_eq, mul_eq_self aleph0_lt_μ.le]
· rw [mk_prod, lift_id, lift_id, card_nearLitter,
mul_eq_right aleph0_lt_μ.le (card_path_lt' α ⊥).le (card_path_ne_zero α)]
· rw [mk_prod, lift_id, lift_id, card_atom,
mul_eq_right aleph0_lt_μ.le (card_path_lt' α ⊥).le (card_path_ne_zero α)]
/-!
## Orders on supports
-/
-- TODO: Is this order used?
instance : LE BaseSupport where
le S T := (∀ a ∈ Sᴬ, a ∈ Tᴬ) ∧ (∀ N ∈ Sᴺ, N ∈ Tᴺ)
instance : Preorder BaseSupport where
le_refl S := ⟨λ _ ↦ id, λ _ ↦ id⟩
le_trans S T U h₁ h₂ := ⟨λ a h ↦ h₂.1 _ (h₁.1 a h), λ N h ↦ h₂.2 _ (h₁.2 N h)⟩
theorem BaseSupport.smul_le_smul {S T : BaseSupport} (h : S ≤ T) (π : BasePerm) :
π • S ≤ π • T := by
constructor
· intro a
exact h.1 (π⁻¹ • a)
· intro N
exact h.2 (π⁻¹ • N)
theorem BaseSupport.le_add_right {S T : BaseSupport} :
S ≤ S + T := by
constructor
· intro a ha
simp only [Support.add_derivBot, BaseSupport.add_atoms, Enumeration.mem_add_iff]
exact Or.inl ha
· intro N hN
simp only [Support.add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
exact Or.inl hN
theorem BaseSupport.le_add_left {S T : BaseSupport} :
S ≤ T + S := by
constructor
· intro a ha
simp only [add_atoms, Enumeration.mem_add_iff]
exact Or.inr ha
· intro N hN
simp only [add_nearLitters, Enumeration.mem_add_iff]
exact Or.inr hN
def BaseSupport.Subsupport (S T : BaseSupport) : Prop :=
Sᴬ.rel ≤ Tᴬ.rel ∧ Sᴺ.rel ≤ Tᴺ.rel
theorem BaseSupport.Subsupport.le {S T : BaseSupport}
(h : S.Subsupport T) : S ≤ T := by
constructor
· rintro a ⟨i, hi⟩
exact ⟨i, h.1 i a hi⟩
· rintro N ⟨i, hi⟩
exact ⟨i, h.2 i N hi⟩
theorem BaseSupport.Subsupport.trans {S T U : BaseSupport}
(h₁ : S.Subsupport T) (h₂ : T.Subsupport U) :
S.Subsupport U :=
⟨h₁.1.trans h₂.1, h₁.2.trans h₂.2⟩
theorem BaseSupport.smul_subsupport_smul {S T : BaseSupport} (h : S.Subsupport T) (π : BasePerm) :
(π • S).Subsupport (π • T) := by
constructor
· intro i a ha
exact h.1 i _ ha
· intro i N hN
exact h.2 i _ hN
instance {α : TypeIndex} : LE (Support α) where
le S T := ∀ A, S ⇘. A ≤ T ⇘. A
instance {α : TypeIndex} : Preorder (Support α) where
le_refl S := λ A ↦ le_rfl
le_trans S T U h₁ h₂ := λ A ↦ (h₁ A).trans (h₂ A)
theorem Support.smul_le_smul {α : TypeIndex} {S T : Support α} (h : S ≤ T) (π : StrPerm α) :
π • S ≤ π • T :=
λ A ↦ BaseSupport.smul_le_smul (h A) (π A)
| theorem Support.le_add_right {α : TypeIndex} {S T : Support α} :
S ≤ S + T | ConNF.Support.le_add_right | {
"commit": "39c33b4a743bea62dbcc549548b712ffd38ca65c",
"date": "2024-12-05T00:00:00"
} | {
"commit": "251ac752f844dfde539ac2bd3ff112305ad59139",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/ModelData/Support.lean | ConNF.ModelData.Support | ConNF.ModelData.Support.jsonl | {
"lineInFile": 532,
"tokenPositionInFile": 14912,
"theoremPositionInFile": 57
} | {
"inFilePremises": true,
"numInFilePremises": 9,
"repositoryPremises": true,
"numRepositoryPremises": 14,
"numPremises": 23
} | {
"hasProof": true,
"proof": ":= by\n intro A\n rw [add_derivBot]\n exact BaseSupport.le_add_right",
"proofType": "tactic",
"proofLengthLines": 3,
"proofLengthTokens": 68
} |
import ConNF.Model.TTT
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
namespace TSet
theorem exists_inter (x y : TSet α) :
∃ w : TSet α, ∀ z : TSet β, z ∈[hβ] w ↔ z ∈[hβ] x ∧ z ∈[hβ] y := by
refine exists_of_symmetric {z | z ∈[hβ] x ∧ z ∈[hβ] y} hβ ?_
obtain ⟨S, hS⟩ := symmetric x hβ
obtain ⟨T, hT⟩ := symmetric y hβ
use S + T
intro ρ hρ
specialize hS ρ (smul_eq_of_le Support.le_add_right hρ)
specialize hT ρ (smul_eq_of_le Support.le_add_left hρ)
simp [Set.ext_iff, Set.mem_smul_set_iff_inv_smul_mem] at hS hT ⊢
aesop
theorem exists_compl (x : TSet α) :
∃ y : TSet α, ∀ z : TSet β, z ∈[hβ] y ↔ ¬z ∈[hβ] x := by
refine exists_of_symmetric {z | ¬z ∈[hβ] x} hβ ?_
obtain ⟨S, hS⟩ := symmetric x hβ
use S
intro ρ hρ
specialize hS ρ hρ
simp [Set.ext_iff, Set.mem_smul_set_iff_inv_smul_mem] at hS ⊢
aesop
theorem exists_up (x y : TSet β) :
∃ w : TSet α, ∀ z : TSet β, z ∈[hβ] w ↔ z = x ∨ z = y := by
refine exists_of_symmetric {x, y} hβ ?_
obtain ⟨S, hS⟩ := exists_support x
obtain ⟨T, hT⟩ := exists_support y
use (S + T) ↗ hβ
intro ρ hρ
rw [Support.smul_scoderiv, Support.scoderiv_inj, ← allPermSderiv_forget'] at hρ
specialize hS (ρ ↘ hβ) (smul_eq_of_le Support.le_add_right hρ)
specialize hT (ρ ↘ hβ) (smul_eq_of_le Support.le_add_left hρ)
simp only [Set.smul_set_def, Set.image, Set.mem_insert_iff, Set.mem_singleton_iff,
exists_eq_or_imp, hS, exists_eq_left, hT]
ext z
rw [Set.mem_insert_iff, Set.mem_singleton_iff, Set.mem_setOf_eq]
aesop
/-- The unordered pair. -/
def up (x y : TSet β) : TSet α :=
(exists_up hβ x y).choose
@[simp]
theorem mem_up_iff (x y z : TSet β) :
z ∈[hβ] up hβ x y ↔ z = x ∨ z = y :=
(exists_up hβ x y).choose_spec z
/-- The Kuratowski ordered pair. -/
def op (x y : TSet γ) : TSet α :=
up hβ (singleton hγ x) (up hγ x y)
theorem up_injective {x y z w : TSet β} (h : up hβ x y = up hβ z w) :
(x = z ∧ y = w) ∨ (x = w ∧ y = z) := by
have h₁ := mem_up_iff hβ x y z
have h₂ := mem_up_iff hβ x y w
have h₃ := mem_up_iff hβ z w x
have h₄ := mem_up_iff hβ z w y
rw [h, mem_up_iff] at h₁ h₂
rw [← h, mem_up_iff] at h₃ h₄
aesop
@[simp]
theorem up_inj (x y z w : TSet β) :
up hβ x y = up hβ z w ↔ (x = z ∧ y = w) ∨ (x = w ∧ y = z) := by
constructor
· exact up_injective hβ
· rintro (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)
· rfl
· apply tSet_ext' hβ
aesop
@[simp]
theorem up_self {x : TSet β} :
up hβ x x = singleton hβ x := by
apply tSet_ext' hβ
aesop
@[simp]
theorem up_eq_singleton_iff (x y z : TSet β) :
up hβ x y = singleton hβ z ↔ x = z ∧ y = z := by
constructor
· intro h
have h₁ := typedMem_singleton_iff' hβ z x
have h₂ := typedMem_singleton_iff' hβ z y
rw [← h, mem_up_iff] at h₁ h₂
aesop
· rintro ⟨rfl, rfl⟩
rw [up_self]
| @[simp]
theorem singleton_eq_up_iff (x y z : TSet β) :
singleton hβ z = up hβ x y ↔ x = z ∧ y = z | ConNF.TSet.singleton_eq_up_iff | {
"commit": "f804f5c71cfaa98223fc227dd822801e8bf77004",
"date": "2024-03-30T00:00:00"
} | {
"commit": "79d0b7460f1a514629674a45c428d31c1a50bb03",
"date": "2024-12-01T00:00:00"
} | ConNF/ConNF/Model/Hailperin.lean | ConNF.Model.Hailperin | ConNF.Model.Hailperin.jsonl | {
"lineInFile": 114,
"tokenPositionInFile": 3103,
"theoremPositionInFile": 10
} | {
"inFilePremises": true,
"numInFilePremises": 2,
"repositoryPremises": true,
"numRepositoryPremises": 10,
"numPremises": 30
} | {
"hasProof": true,
"proof": ":= by\n rw [← up_eq_singleton_iff hβ x y z, eq_comm]",
"proofType": "tactic",
"proofLengthLines": 1,
"proofLengthTokens": 52
} |
import ConNF.Model.RunInduction
/-!
# Externalisation
In this file, we convert many of our *internal* results (i.e. inside the induction) to *external*
ones (i.e. defined using the global `TSet`/`AllPerm` definitions).
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal WithBot
namespace ConNF
variable [Params.{u}]
instance globalModelData : {α : TypeIndex} → ModelData α
| (α : Λ) => (motive α).data
| ⊥ => botModelData
instance globalPosition : {α : TypeIndex} → Position (Tangle α)
| (α : Λ) => (motive α).pos
| ⊥ => botPosition
instance globalTypedNearLitters {α : Λ} : TypedNearLitters α :=
(motive α).typed
instance globalLtData [Level] : LtData where
instance globalLeData [Level] : LeData where
omit [Params] in
theorem heq_funext {α : Sort _} {β γ : α → Sort _} {f : (x : α) → β x} {g : (x : α) → γ x}
(h : ∀ x, HEq (f x) (g x)) : HEq f g := by
cases funext λ x ↦ type_eq_of_heq (h x)
simp only [heq_eq_eq] at h ⊢
exact funext h
theorem globalLtData_eq [Level] :
globalLtData = ltData (λ β _ ↦ motive β) := by
apply LtData.ext
· ext β hβ
induction β using recBotCoe
case bot => rfl
case coe β => rfl
· apply heq_funext
intro β
induction β using recBotCoe
case bot => rfl
case coe β => rfl
· rfl
theorem globalLeData_eq [Level] :
globalLeData = leData (λ β _ ↦ motive β) := by
apply LeData.ext
· ext β hβ
induction β using recBotCoe
case bot => rfl
case coe β =>
by_cases h : (β : TypeIndex) = α
· cases coe_injective h
rw [leData_data_eq]
unfold globalLeData globalModelData
dsimp only
rw [motive_eq]
rfl
· rw [leData_data_lt _ (hβ.elim.lt_of_ne h)]
rfl
· apply heq_funext
intro β
apply heq_funext
intro hβ
induction β using recBotCoe
case bot => rfl
case coe β =>
rw [leData]
simp only [coe_inj, id_eq, eq_mpr_eq_cast, recBotCoe_bot, recBotCoe_coe, LtLevel.elim.ne]
exact HEq.symm (cast_heq _ _)
instance globalPreCoherentData [Level] : PreCoherentData where
allPermSderiv h := cast (by rw [globalLeData_eq])
((preCoherentData (λ β _ ↦ motive β) (λ β _ ↦ hypothesis β)).allPermSderiv h)
singleton h := cast (by rw [globalLeData_eq])
((preCoherentData (λ β _ ↦ motive β) (λ β _ ↦ hypothesis β)).singleton h)
omit [Params] in
@[simp]
theorem heq_cast_eq_iff {α β γ : Type _} {x : α} {y : β} {h : α = γ} :
HEq (cast h x) y ↔ HEq x y := by
cases h
rw [cast_eq]
| theorem globalPreCoherentData_eq [Level] :
globalPreCoherentData = preCoherentData (λ β _ ↦ motive β) (λ β _ ↦ hypothesis β) | ConNF.globalPreCoherentData_eq | {
"commit": "6fdc87c6b30b73931407a372f1430ecf0fef7601",
"date": "2024-12-03T00:00:00"
} | {
"commit": "e409f3d0cd939e7218c3f39dcf3493c4b6e0b821",
"date": "2024-11-29T00:00:00"
} | ConNF/ConNF/Model/Externalise.lean | ConNF.Model.Externalise | ConNF.Model.Externalise.jsonl | {
"lineInFile": 99,
"tokenPositionInFile": 2555,
"theoremPositionInFile": 4
} | {
"inFilePremises": true,
"numInFilePremises": 5,
"repositoryPremises": true,
"numRepositoryPremises": 36,
"numPremises": 61
} | {
"hasProof": true,
"proof": ":= by\n have := globalLeData_eq\n rw [LeData.ext_iff] at this\n apply PreCoherentData.ext\n · exact this.1\n · exact this.2\n · unfold globalPreCoherentData\n apply heq_funext; intro β\n apply heq_funext; intro γ\n apply heq_funext; intro hβ\n apply heq_funext; intro hγ\n apply heq_funext; intro hβγ\n simp only [heq_cast_eq_iff]\n rfl\n · unfold globalPreCoherentData\n apply heq_funext; intro β\n apply heq_funext; intro γ\n apply heq_funext; intro hβ\n apply heq_funext; intro hγ\n apply heq_funext; intro hβγ\n simp only [heq_cast_eq_iff]\n rfl",
"proofType": "tactic",
"proofLengthLines": 21,
"proofLengthTokens": 577
} |
import ConNF.Model.Externalise
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal
namespace ConNF
variable [Params.{u}] {β γ : Λ} {hγ : (γ : TypeIndex) < β}
namespace Support
| theorem not_mem_scoderiv_botDeriv (S : Support γ) (N : NearLitter) :
N ∉ (S ↗ hγ ⇘. (Path.nil ↘.))ᴺ | ConNF.Support.not_mem_scoderiv_botDeriv | {
"commit": "abf71bc79c407ceb462cc2edd2d994cda9cdef05",
"date": "2024-04-04T00:00:00"
} | {
"commit": "251ac752f844dfde539ac2bd3ff112305ad59139",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/Model/RaiseStrong.lean | ConNF.Model.RaiseStrong | ConNF.Model.RaiseStrong.jsonl | {
"lineInFile": 24,
"tokenPositionInFile": 274,
"theoremPositionInFile": 0
} | {
"inFilePremises": false,
"numInFilePremises": 0,
"repositoryPremises": true,
"numRepositoryPremises": 32,
"numPremises": 71
} | {
"hasProof": true,
"proof": ":= by\n rintro ⟨i, ⟨A, N'⟩, h₁, h₂⟩\n simp only [Prod.mk.injEq] at h₂\n cases A\n case sderiv δ A hδ _ =>\n simp only [Path.deriv_sderiv] at h₂\n cases A\n case nil => cases h₂.1\n case sderiv ζ A hζ _ =>\n simp only [Path.deriv_sderiv] at h₂\n cases h₂.1",
"proofType": "tactic",
"proofLengthLines": 10,
"proofLengthTokens": 271
} |
import ConNF.Model.RaiseStrong
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal
open scoped Pointwise
namespace ConNF
variable [Params.{u}]
/-- A redefinition of the derivative of allowable permutations that is invariant of level,
but still has nice definitional properties. -/
@[default_instance 200]
instance {β γ : TypeIndex} : Derivative (AllPerm β) (AllPerm γ) β γ where
deriv ρ A :=
A.recSderiv
(motive := λ (δ : TypeIndex) (A : β ↝ δ) ↦
letI : Level := ⟨δ.recBotCoe (Nonempty.some inferInstance) id⟩
letI : LeLevel δ := ⟨δ.recBotCoe (λ _ ↦ bot_le) (λ _ h ↦ WithBot.coe_le_coe.mpr h.le)
(show δ.recBotCoe (Nonempty.some inferInstance) id = Level.α from rfl)⟩
AllPerm δ)
ρ (λ δ ε A h ρ ↦
letI : Level := ⟨δ.recBotCoe (Nonempty.some inferInstance) id⟩
letI : LeLevel δ := ⟨δ.recBotCoe (λ _ ↦ bot_le) (λ _ h ↦ WithBot.coe_le_coe.mpr h.le)
(show δ.recBotCoe (Nonempty.some inferInstance) id = Level.α from rfl)⟩
letI : LeLevel ε := ⟨h.le.trans LeLevel.elim⟩
PreCoherentData.allPermSderiv h ρ)
@[simp]
theorem allPerm_deriv_nil' {β : TypeIndex}
(ρ : AllPerm β) :
ρ ⇘ (.nil : β ↝ β) = ρ :=
rfl
@[simp]
theorem allPerm_deriv_sderiv' {β γ δ : TypeIndex}
(ρ : AllPerm β) (A : β ↝ γ) (h : δ < γ) :
ρ ⇘ (A ↘ h) = ρ ⇘ A ↘ h :=
rfl
@[simp]
theorem allPermSderiv_forget' {β γ : TypeIndex} (h : γ < β) (ρ : AllPerm β) :
(ρ ↘ h)ᵁ = ρᵁ ↘ h :=
letI : Level := ⟨β.recBotCoe (Nonempty.some inferInstance) id⟩
letI : LeLevel β := ⟨β.recBotCoe (λ _ ↦ bot_le) (λ _ h ↦ WithBot.coe_le_coe.mpr h.le)
(show β.recBotCoe (Nonempty.some inferInstance) id = Level.α from rfl)⟩
letI : LeLevel γ := ⟨h.le.trans LeLevel.elim⟩
allPermSderiv_forget h ρ
@[simp]
theorem allPerm_inv_sderiv' {β γ : TypeIndex} (h : γ < β) (ρ : AllPerm β) :
ρ⁻¹ ↘ h = (ρ ↘ h)⁻¹ := by
apply allPermForget_injective
rw [allPermSderiv_forget', allPermForget_inv, Tree.inv_sderiv, allPermForget_inv,
allPermSderiv_forget']
def Symmetric {α β : Λ} (s : Set (TSet β)) (hβ : (β : TypeIndex) < α) : Prop :=
∃ S : Support α, ∀ ρ : AllPerm α, ρᵁ • S = S → ρ ↘ hβ • s = s
def newSetEquiv {α : Λ} :
letI : Level := ⟨α⟩
@TSet _ α newModelData.toPreModelData ≃ TSet α :=
letI : Level := ⟨α⟩
castTSet (D₁ := newModelData) (D₂ := globalModelData) rfl
(by rw [globalModelData, motive_eq, constructMotive, globalLtData_eq])
@[simp]
theorem newSetEquiv_forget {α : Λ}
(x : letI : Level := ⟨α⟩; @TSet _ α newModelData.toPreModelData) :
(newSetEquiv x)ᵁ = xᵁ :=
letI : Level := ⟨α⟩
castTSet_forget (D₁ := newModelData) (D₂ := globalModelData) _ x
def allPermEquiv {α : Λ} :
letI : Level := ⟨α⟩
NewPerm ≃ AllPerm α :=
letI : Level := ⟨α⟩
castAllPerm (D₁ := newModelData) (D₂ := globalModelData) rfl
(by rw [globalModelData, motive_eq, constructMotive, globalLtData_eq])
@[simp]
theorem allPermEquiv_forget {α : Λ} (ρ : letI : Level := ⟨α⟩; NewPerm) :
(allPermEquiv ρ)ᵁ = ρᵁ :=
letI : Level := ⟨α⟩
castAllPerm_forget (D₁ := newModelData) (D₂ := globalModelData) _ ρ
theorem allPermEquiv_sderiv {α β : Λ}
(ρ : letI : Level := ⟨α⟩; NewPerm) (hβ : (β : TypeIndex) < α) :
letI : Level := ⟨α⟩
letI : LtLevel β := ⟨hβ⟩
allPermEquiv ρ ↘ hβ = ρ.sderiv β := by
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
letI : LtLevel β := ⟨hβ⟩
apply allPermForget_injective
rw [allPermSderiv_forget, allPermEquiv_forget, NewPerm.forget_sderiv]
theorem TSet.exists_of_symmetric {α β : Λ} (s : Set (TSet β)) (hβ : (β : TypeIndex) < α)
(hs : Symmetric s hβ) :
∃ x : TSet α, ∀ y : TSet β, y ∈[hβ] x ↔ y ∈ s := by
letI : Level := ⟨α⟩
letI : LtLevel β := ⟨hβ⟩
suffices ∃ x : (@TSet _ α newModelData.toPreModelData), ∀ y : TSet β, yᵁ ∈[hβ] xᵁ ↔ y ∈ s by
obtain ⟨x, hx⟩ := this
use newSetEquiv x
intro y
rw [← hx, ← TSet.forget_mem_forget, newSetEquiv_forget]
obtain rfl | hs' := s.eq_empty_or_nonempty
· use none
intro y
simp only [Set.mem_empty_iff_false, iff_false]
exact not_mem_none y
· use some (Code.toSet ⟨β, s, hs'⟩ ?_)
· intro y
erw [mem_some_iff]
exact Code.mem_toSet _
· obtain ⟨S, hS⟩ := hs
use S
intro ρ hρS
have := hS (allPermEquiv ρ) ?_
· simp only [NewPerm.smul_mk, Code.mk.injEq, heq_eq_eq, true_and]
rwa [allPermEquiv_sderiv] at this
· rwa [allPermEquiv_forget]
theorem TSet.exists_support {α : Λ} (x : TSet α) :
∃ S : Support α, ∀ ρ : AllPerm α, ρᵁ • S = S → ρ • x = x := by
letI : Level := ⟨α⟩
obtain ⟨S, hS⟩ := NewSet.exists_support (newSetEquiv.symm x)
use S
intro ρ hρ
have := @Support.Supports.supports _ _ _ newPreModelData _ _ _ hS (allPermEquiv.symm ρ) ?_
· apply tSetForget_injective
have := congr_arg (·ᵁ) this
simp only at this
erw [@smul_forget _ _ newModelData (allPermEquiv.symm ρ) (newSetEquiv.symm x),
← allPermEquiv_forget, ← newSetEquiv_forget, Equiv.apply_symm_apply,
Equiv.apply_symm_apply] at this
rwa [smul_forget]
· rwa [← allPermEquiv_forget, Equiv.apply_symm_apply]
theorem TSet.symmetric {α β : Λ} (x : TSet α) (hβ : (β : TypeIndex) < α) :
Symmetric {y : TSet β | y ∈[hβ] x} hβ := by
obtain ⟨S, hS⟩ := exists_support x
use S
intro ρ hρ
conv_rhs => rw [← hS ρ hρ]
simp only [← forget_mem_forget, smul_forget, StrSet.mem_smul_iff]
ext y
rw [Set.mem_smul_set_iff_inv_smul_mem, Set.mem_setOf_eq, Set.mem_setOf_eq,
smul_forget, allPermForget_inv, allPermSderiv_forget']
theorem tSet_ext' {α β : Λ} (hβ : (β : TypeIndex) < α) (x y : TSet α)
(h : ∀ z : TSet β, z ∈[hβ] x ↔ z ∈[hβ] y) : x = y :=
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
letI : LtLevel β := ⟨hβ⟩
tSet_ext hβ x y h
@[simp]
theorem TSet.mem_smul_iff' {α β : TypeIndex}
{x : TSet β} {y : TSet α} (h : β < α) (ρ : AllPerm α) :
x ∈[h] ρ • y ↔ ρ⁻¹ ↘ h • x ∈[h] y := by
letI : Level := ⟨α.recBotCoe (Nonempty.some inferInstance) id⟩
letI : LeLevel α := ⟨α.recBotCoe (λ _ ↦ bot_le) (λ _ h ↦ WithBot.coe_le_coe.mpr h.le)
(show α.recBotCoe (Nonempty.some inferInstance) id = Level.α from rfl)⟩
letI : LtLevel β := ⟨h.trans_le LeLevel.elim⟩
exact mem_smul_iff h ρ -- For some reason, using `exact` instead of term mode speeds this up!
def singleton {α β : Λ} (hβ : (β : TypeIndex) < α) (x : TSet β) : TSet α :=
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
letI : LtLevel β := ⟨hβ⟩
PreCoherentData.singleton hβ x
@[simp]
theorem typedMem_singleton_iff' {α β : Λ} (hβ : (β : TypeIndex) < α) (x y : TSet β) :
y ∈[hβ] singleton hβ x ↔ y = x :=
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
letI : LtLevel β := ⟨hβ⟩
typedMem_singleton_iff hβ x y
@[simp]
theorem smul_singleton {α β : Λ} (hβ : (β : TypeIndex) < α) (x : TSet β) (ρ : AllPerm α) :
ρ • singleton hβ x = singleton hβ (ρ ↘ hβ • x) := by
apply tSet_ext' hβ
intro z
rw [TSet.mem_smul_iff', allPerm_inv_sderiv', typedMem_singleton_iff', typedMem_singleton_iff',
inv_smul_eq_iff]
theorem singleton_injective {α β : Λ} (hβ : (β : TypeIndex) < α) :
Function.Injective (singleton hβ) := by
intro x y hxy
have := typedMem_singleton_iff' hβ x y
rw [hxy, typedMem_singleton_iff'] at this
exact (this.mp rfl).symm
@[simp]
theorem singleton_inj {α β : Λ} {hβ : (β : TypeIndex) < α} {x y : TSet β} :
singleton hβ x = singleton hβ y ↔ x = y :=
(singleton_injective hβ).eq_iff
| theorem sUnion_singleton_symmetric_aux' {α β γ : Λ}
(hγ : (γ : TypeIndex) < β) (hβ : (β : TypeIndex) < α) (s : Set (TSet γ)) (S : Support α)
(hS : ∀ ρ : AllPerm α, ρᵁ • S = S → ρ ↘ hβ • singleton hγ '' s = singleton hγ '' s) :
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
∀ (ρ : AllPerm β), ρᵁ • S.strong ↘ hβ = S.strong ↘ hβ → ρ ↘ hγ • s ⊆ s | ConNF.sUnion_singleton_symmetric_aux' | {
"commit": "6fdc87c6b30b73931407a372f1430ecf0fef7601",
"date": "2024-12-03T00:00:00"
} | {
"commit": "1c08486feb882444888c228ce1501e92bb85e0e2",
"date": "2025-01-07T00:00:00"
} | ConNF/ConNF/Model/TTT.lean | ConNF.Model.TTT | ConNF.Model.TTT.jsonl | {
"lineInFile": 216,
"tokenPositionInFile": 7508,
"theoremPositionInFile": 20
} | {
"inFilePremises": true,
"numInFilePremises": 5,
"repositoryPremises": true,
"numRepositoryPremises": 43,
"numPremises": 94
} | {
"hasProof": true,
"proof": ":= by\n letI : Level := ⟨α⟩\n letI : LeLevel α := ⟨le_rfl⟩\n letI : LtLevel β := ⟨hβ⟩\n rintro ρ hρ _ ⟨x, hx, rfl⟩\n obtain ⟨T, hT⟩ := exists_support x\n obtain ⟨ρ', hρ'₁, hρ'₂⟩ := Support.exists_allowable_of_fixes S.strong S.strong_strong T ρ hγ hρ\n have hρ's := hS ρ' (smul_eq_of_le (S.subsupport_strong.le) hρ'₁)\n have hρ'x : ρ' ↘ hβ ↘ hγ • x = ρ ↘ hγ • x := by\n apply hT.smul_eq_smul\n simp only [allPermSderiv_forget', allPermSderiv_forget, WithBot.recBotCoe_coe, id_eq, hρ'₂]\n dsimp only\n rw [← hρ'x]\n have := (Set.ext_iff.mp hρ's (ρ' ↘ hβ • singleton hγ x)).mp ⟨_, Set.mem_image_of_mem _ hx, rfl⟩\n rw [smul_singleton] at this\n rwa [(singleton_injective hγ).mem_set_image] at this",
"proofType": "tactic",
"proofLengthLines": 15,
"proofLengthTokens": 698
} |
import ConNF.Background.Rel
import ConNF.Base.Small
/-!
# Enumerations
In this file, we define enumerations of a type.
## Main declarations
* `ConNF.Enumeration`: The type family of enumerations.
-/
universe u
open Cardinal
namespace ConNF
variable [Params.{u}] {X Y : Type u}
@[ext]
structure Enumeration (X : Type u) where
bound : κ
rel : Rel κ X
lt_bound : ∀ i ∈ rel.dom, i < bound
rel_coinjective : rel.Coinjective
variable {E F G : Enumeration X}
namespace Enumeration
instance : CoeTC (Enumeration X) (Set X) where
coe E := E.rel.codom
instance : Membership X (Enumeration X) where
mem E x := x ∈ E.rel.codom
theorem mem_iff (x : X) (E : Enumeration X) :
x ∈ E ↔ x ∈ E.rel.codom :=
Iff.rfl
theorem mem_congr {E F : Enumeration X} (h : E = F) :
∀ x, x ∈ E ↔ x ∈ F := by
intro x
rw [h]
theorem dom_small (E : Enumeration X) :
Small E.rel.dom :=
(iio_small E.bound).mono E.lt_bound
theorem coe_small (E : Enumeration X) :
Small (E : Set X) :=
small_codom_of_small_dom E.rel_coinjective E.dom_small
theorem graph'_small (E : Enumeration X) :
Small E.rel.graph' :=
small_graph' E.dom_small E.coe_small
noncomputable def empty : Enumeration X where
bound := 0
rel _ _ := False
lt_bound _ h := by cases h; contradiction
rel_coinjective := by constructor; intros; contradiction
@[simp]
theorem not_mem_empty (x : X) : x ∉ Enumeration.empty := by
rintro ⟨i, h⟩
cases h
noncomputable def singleton (x : X) : Enumeration X where
bound := 1
rel i y := i = 0 ∧ y = x
lt_bound i h := by
have : i = 0 := by simpa only [Rel.dom, exists_eq_right, Set.setOf_eq_eq_singleton,
Set.mem_singleton_iff] using h
rw [this, κEquiv_lt, ← Subtype.coe_lt_coe, κEquiv_ofNat, κEquiv_ofNat, Nat.cast_zero,
Nat.cast_one]
exact zero_lt_one
rel_coinjective := by
constructor
cc
@[simp]
theorem mem_singleton_iff (x y : X) :
y ∈ singleton x ↔ y = x := by
constructor
· rintro ⟨_, _, h⟩
exact h
· intro h
exact ⟨0, rfl, h⟩
theorem singleton_injective : Function.Injective (singleton : X → Enumeration X) := by
intro x y h
have := mem_singleton_iff y x
rw [← h, mem_singleton_iff] at this
exact this.mp rfl
/-!
## Cardinality bounds on enumerations
-/
end Enumeration
theorem card_enumeration_ge (X : Type u) : #X ≤ #(Enumeration X) :=
mk_le_of_injective Enumeration.singleton_injective
def enumerationEmbedding (X : Type u) : Enumeration X ↪ κ × {s : Set (κ × X) | Small s} where
toFun E := (E.bound, ⟨E.rel.graph', E.graph'_small⟩)
inj' := by
intro E F h
rw [Prod.mk.injEq, Subtype.mk.injEq] at h
exact Enumeration.ext h.1 (Rel.graph'_injective h.2)
theorem card_enumeration_le (h : #X ≤ #μ) : #(Enumeration X) ≤ #μ := by
apply (mk_le_of_injective (enumerationEmbedding X).injective).trans
rw [mk_prod, lift_id, lift_id]
apply mul_le_of_le aleph0_lt_μ.le κ_le_μ
apply card_small_le
rw [mk_prod, lift_id, lift_id]
exact mul_le_of_le aleph0_lt_μ.le κ_le_μ h
theorem card_enumeration_lt (h : #X < #μ) : #(Enumeration X) < #μ := by
apply (mk_le_of_injective (enumerationEmbedding X).injective).trans_lt
rw [mk_prod, lift_id, lift_id]
apply mul_lt_of_lt aleph0_lt_μ.le κ_lt_μ
apply (mk_subtype_le _).trans_lt
rw [mk_set]
apply μ_isStrongLimit.2
rw [mk_prod, lift_id, lift_id]
exact mul_lt_of_lt aleph0_lt_μ.le κ_lt_μ h
theorem card_enumeration_eq (h : #X = #μ) : #(Enumeration X) = #μ :=
le_antisymm (card_enumeration_le h.le) (h.symm.le.trans (card_enumeration_ge X))
namespace Enumeration
/-!
## Enumerations from sets
-/
theorem exists_equiv (s : Set X) (hs : Small s) :
Nonempty ((i : κ) × (s ≃ Set.Iio i)) := by
rw [Small] at hs
refine ⟨κEquiv.symm ⟨(#s).ord, ?_⟩, Nonempty.some ?_⟩
· rwa [Set.mem_Iio, ord_lt_ord]
· rw [← Cardinal.eq, Set.Iio, κ_card_Iio_eq, Equiv.apply_symm_apply, card_ord]
noncomputable def ofSet (s : Set X) (hs : Small s) : Enumeration X where
bound := (exists_equiv s hs).some.1
rel i x := ∃ h, i = (exists_equiv s hs).some.2 ⟨x, h⟩
lt_bound := by
rintro _ ⟨x, h, rfl⟩
exact ((exists_equiv s hs).some.2 ⟨x, h⟩).prop
rel_coinjective := by
constructor
rintro x y i ⟨hx, hix⟩ ⟨hy, hiy⟩
rw [hix] at hiy
cases (exists_equiv s hs).some.2.injective (Subtype.coe_injective hiy)
rfl
@[simp]
theorem mem_ofSet_iff (s : Set X) (hs : Small s) (x : X) :
x ∈ ofSet s hs ↔ x ∈ s := by
constructor
· rintro ⟨i, hx, _⟩
exact hx
· intro h
exact ⟨(exists_equiv s hs).some.2 ⟨x, h⟩, h, rfl⟩
@[simp]
theorem ofSet_coe (s : Set X) (hs : Small s) :
(ofSet s hs : Set X) = s := by
ext x
rw [← mem_ofSet_iff s hs]
rfl
/-!
## Operations on enumerations
-/
def image (E : Enumeration X) (f : X → Y) : Enumeration Y where
bound := E.bound
rel i y := ∃ x, E.rel i x ∧ f x = y
lt_bound := by
rintro i ⟨_, x, hi, rfl⟩
exact E.lt_bound i ⟨x, hi⟩
rel_coinjective := by
constructor
rintro i _ _ ⟨x₁, hx₁, rfl⟩ ⟨x₂, hx₂, rfl⟩
rw [E.rel_coinjective.coinjective hx₁ hx₂]
@[simp]
theorem image_bound {f : X → Y} :
(E.image f).bound = E.bound :=
rfl
theorem image_rel {f : X → Y} (i : κ) (y : Y) :
(E.image f).rel i y ↔ ∃ x, E.rel i x ∧ f x = y :=
Iff.rfl
@[simp]
theorem mem_image {f : X → Y} (y : Y) :
y ∈ E.image f ↔ y ∈ f '' E := by
constructor
· rintro ⟨i, x, hx, rfl⟩
exact ⟨x, ⟨i, hx⟩, rfl⟩
· rintro ⟨x, ⟨i, hx⟩, rfl⟩
exact ⟨i, x, hx, rfl⟩
def invImage (E : Enumeration X) (f : Y → X) (hf : f.Injective) : Enumeration Y where
bound := E.bound
rel i y := E.rel i (f y)
lt_bound := by
rintro i ⟨y, hy⟩
exact E.lt_bound i ⟨f y, hy⟩
rel_coinjective := by
constructor
intro i y₁ y₂ h₁ h₂
exact hf <| E.rel_coinjective.coinjective h₁ h₂
theorem invImage_rel {f : Y → X} {hf : f.Injective} (i : κ) (y : Y) :
(E.invImage f hf).rel i y ↔ E.rel i (f y) :=
Iff.rfl
@[simp]
theorem mem_invImage {f : Y → X} {hf : f.Injective} (y : Y) :
y ∈ E.invImage f hf ↔ f y ∈ E :=
Iff.rfl
def comp (E : Enumeration X) (r : Rel X Y) (hr : r.Coinjective) : Enumeration Y where
bound := E.bound
rel := E.rel.comp r
lt_bound := by
rintro i ⟨y, x, hy⟩
exact E.lt_bound i ⟨x, hy.1⟩
rel_coinjective := E.rel_coinjective.comp hr
instance {G X : Type _} [Group G] [MulAction G X] :
SMul G (Enumeration X) where
smul π E := E.invImage (λ x ↦ π⁻¹ • x) (MulAction.injective π⁻¹)
@[simp]
theorem smul_rel {G X : Type _} [Group G] [MulAction G X]
(π : G) (E : Enumeration X) (i : κ) (x : X) :
(π • E).rel i x ↔ E.rel i (π⁻¹ • x) :=
Iff.rfl
@[simp]
theorem mem_smul {G X : Type _} [Group G] [MulAction G X]
(π : G) (E : Enumeration X) (x : X) :
x ∈ π • E ↔ π⁻¹ • x ∈ E :=
Iff.rfl
@[simp]
theorem smul_rel_dom {G X : Type _} [Group G] [MulAction G X]
(π : G) (E : Enumeration X) :
(π • E).rel.dom = E.rel.dom := by
ext i
constructor
· rintro ⟨x, h⟩
exact ⟨π⁻¹ • x, h⟩
· rintro ⟨x, h⟩
use π • x
rwa [smul_rel, inv_smul_smul]
open scoped Pointwise in
@[simp]
theorem smul_rel_codom {G X : Type _} [Group G] [MulAction G X]
(π : G) (E : Enumeration X) :
(π • E).rel.codom = π • E.rel.codom := by
ext x
constructor
· rintro ⟨i, h⟩
exact ⟨π⁻¹ • x, ⟨i, h⟩, smul_inv_smul π x⟩
· rintro ⟨x, ⟨i, h⟩, rfl⟩
use i
rwa [smul_rel, inv_smul_smul]
open scoped Pointwise in
@[simp]
theorem smul_coe {G X : Type _} [Group G] [MulAction G X]
(π : G) (E : Enumeration X) :
((π • E : Enumeration X) : Set X) = π • (E : Set X) :=
smul_rel_codom π E
instance {G X : Type _} [Group G] [MulAction G X] :
MulAction G (Enumeration X) where
one_smul E := by
ext i x
· rfl
· rw [smul_rel, inv_one, one_smul]
mul_smul π₁ π₂ E := by
ext i x
· rfl
· rw [smul_rel, smul_rel, smul_rel, mul_inv_rev, mul_smul]
theorem mem_smul_iff {G X : Type _} [Group G] [MulAction G X] (x : X) (g : G) (E : Enumeration X) :
x ∈ g • E ↔ g⁻¹ • x ∈ E :=
Iff.rfl
theorem eq_of_smul_eq_smul {G X : Type _} [Group G] [MulAction G X] {g₁ g₂ : G} {E : Enumeration X}
(h : g₁ • E = g₂ • E) (x : X) (hx : x ∈ E) : g₁ • x = g₂ • x := by
obtain ⟨i, hi⟩ := hx
have : (g₁ • E).rel i (g₁ • x) := by rwa [smul_rel, inv_smul_smul]
rw [h] at this
have := E.rel_coinjective.coinjective hi this
exact (eq_inv_smul_iff.mp this).symm
theorem eq_of_smul_eq {G X : Type _} [Group G] [MulAction G X] {g : G} {E : Enumeration X}
(h : g • E = E) (x : X) (hx : x ∈ E) : g • x = x := by
have := eq_of_smul_eq_smul (g₁ := g) (g₂ := 1) ?_ x hx
· rwa [one_smul] at this
· rwa [one_smul]
@[simp]
theorem smul_singleton {G X : Type _} [Group G] [MulAction G X] {g : G} {x : X} :
g • singleton x = singleton (g • x) := by
apply Enumeration.ext
· rfl
· ext i y
rw [smul_rel]
simp only [singleton, and_congr_right_iff, inv_smul_eq_iff]
/-!
## Concatenation of enumerations
-/
noncomputable instance : Add (Enumeration X) where
add E F := {
bound := E.bound + F.bound
rel := E.rel ⊔ Rel.comp (E.bound + ·).graph.inv F.rel
lt_bound := by
rintro i ⟨x, hi | ⟨j, rfl, hjx⟩⟩
· exact (E.lt_bound i ⟨x, hi⟩).trans_le (κ_le_add E.bound F.bound)
· rw [add_lt_add_iff_left]
exact F.lt_bound j ⟨x, hjx⟩
rel_coinjective := by
constructor
rintro x y i (hix | ⟨j, hj, hjx⟩) (hiy | ⟨k, hk, hky⟩)
· exact E.rel_coinjective.coinjective hix hiy
· cases hk
have := E.lt_bound _ ⟨x, hix⟩
rw [add_lt_iff_neg_left] at this
cases (κ_zero_le k).not_lt this
· cases hj
have := E.lt_bound _ ⟨y, hiy⟩
rw [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
· cases hj
simp only [Rel.inv, flip, Function.graph_def, add_right_inj] at hk
cases hk
exact F.rel_coinjective.coinjective hjx hky
}
@[simp]
theorem add_bound (E F : Enumeration X) :
(E + F).bound = E.bound + F.bound :=
rfl
theorem rel_add_iff {E F : Enumeration X} (i : κ) (x : X) :
(E + F).rel i x ↔ E.rel i x ∨ ∃ j, E.bound + j = i ∧ F.rel j x :=
Iff.rfl
| theorem add_rel_dom {X : Type _} (E F : Enumeration X) :
(E + F).rel.dom = E.rel.dom ∪ (E.bound + ·) '' F.rel.dom | ConNF.Enumeration.add_rel_dom | {
"commit": "39c33b4a743bea62dbcc549548b712ffd38ca65c",
"date": "2024-12-05T00:00:00"
} | {
"commit": "6709914ae7f5cd3e2bb24b413e09aa844554d234",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/ModelData/Enumeration.lean | ConNF.ModelData.Enumeration | ConNF.ModelData.Enumeration.jsonl | {
"lineInFile": 365,
"tokenPositionInFile": 10091,
"theoremPositionInFile": 31
} | {
"inFilePremises": true,
"numInFilePremises": 5,
"repositoryPremises": true,
"numRepositoryPremises": 9,
"numPremises": 49
} | {
"hasProof": true,
"proof": ":= by\n ext i\n simp only [Rel.dom, rel_add_iff, Set.mem_setOf_eq, Set.mem_union, Set.mem_image]\n aesop",
"proofType": "tactic",
"proofLengthLines": 3,
"proofLengthTokens": 104
} |
import ConNF.Model.Hailperin
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
theorem ext (x y : TSet α) :
(∀ z : TSet β, z ∈' x ↔ z ∈' y) → x = y :=
tSet_ext' hβ x y
def inter (x y : TSet α) : TSet α :=
(TSet.exists_inter hβ x y).choose
notation:69 x:69 " ⊓[" h "] " y:69 => _root_.ConNF.inter h x y
notation:69 x:69 " ⊓' " y:69 => x ⊓[by assumption] y
@[simp]
theorem mem_inter_iff (x y : TSet α) :
∀ z : TSet β, z ∈' x ⊓' y ↔ z ∈' x ∧ z ∈' y :=
(TSet.exists_inter hβ x y).choose_spec
def compl (x : TSet α) : TSet α :=
(TSet.exists_compl hβ x).choose
notation:1024 x:1024 " ᶜ[" h "]" => _root_.ConNF.compl h x
notation:1024 x:1024 " ᶜ'" => xᶜ[by assumption]
@[simp]
theorem mem_compl_iff (x : TSet α) :
∀ z : TSet β, z ∈' xᶜ' ↔ ¬z ∈' x :=
(TSet.exists_compl hβ x).choose_spec
notation:1024 "{" x "}[" h "]" => _root_.ConNF.singleton h x
notation:1024 "{" x "}'" => {x}[by assumption]
@[simp]
theorem mem_singleton_iff (x y : TSet β) :
y ∈' {x}' ↔ y = x :=
typedMem_singleton_iff' hβ x y
notation:1024 "{" x ", " y "}[" h "]" => _root_.ConNF.TSet.up h x y
notation:1024 "{" x ", " y "}'" => {x, y}[by assumption]
@[simp]
theorem mem_up_iff (x y z : TSet β) :
z ∈' {x, y}' ↔ z = x ∨ z = y :=
TSet.mem_up_iff hβ x y z
notation:1024 "⟨" x ", " y "⟩[" h ", " h' "]" => _root_.ConNF.TSet.op h h' x y
notation:1024 "⟨" x ", " y "⟩'" => ⟨x, y⟩[by assumption, by assumption]
theorem op_def (x y : TSet γ) :
(⟨x, y⟩' : TSet α) = { {x}', {x, y}' }' :=
rfl
def singletonImage' (x : TSet β) : TSet α :=
(TSet.exists_singletonImage hβ hγ hδ hε x).choose
@[simp]
theorem singletonImage'_spec (x : TSet β) :
∀ z w,
⟨ {z}', {w}' ⟩' ∈' singletonImage' hβ hγ hδ hε x ↔ ⟨z, w⟩' ∈' x :=
(TSet.exists_singletonImage hβ hγ hδ hε x).choose_spec
def insertion2' (x : TSet γ) : TSet α :=
(TSet.exists_insertion2 hβ hγ hδ hε hζ x).choose
@[simp]
theorem insertion2'_spec (x : TSet γ) :
∀ a b c, ⟨ { {a}' }', ⟨b, c⟩' ⟩' ∈' insertion2' hβ hγ hδ hε hζ x ↔
⟨a, c⟩' ∈' x :=
(TSet.exists_insertion2 hβ hγ hδ hε hζ x).choose_spec
def insertion3' (x : TSet γ) : TSet α :=
(TSet.exists_insertion3 hβ hγ hδ hε hζ x).choose
theorem insertion3'_spec (x : TSet γ) :
∀ a b c, ⟨ { {a}' }', ⟨b, c⟩' ⟩' ∈' insertion3' hβ hγ hδ hε hζ x ↔
⟨a, b⟩' ∈' x :=
(TSet.exists_insertion3 hβ hγ hδ hε hζ x).choose_spec
def vCross (x : TSet γ) : TSet α :=
(TSet.exists_cross hβ hγ hδ x).choose
@[simp]
theorem vCross_spec (x : TSet γ) :
∀ a, a ∈' vCross hβ hγ hδ x ↔ ∃ b c, a = ⟨b, c⟩' ∧ c ∈' x :=
(TSet.exists_cross hβ hγ hδ x).choose_spec
def typeLower (x : TSet α) : TSet δ :=
(TSet.exists_typeLower hβ hγ hδ hε x).choose
| @[simp]
theorem mem_typeLower_iff (x : TSet α) :
∀ a, a ∈' typeLower hβ hγ hδ hε x ↔ ∀ b, ⟨ b, {a}' ⟩' ∈' x | ConNF.mem_typeLower_iff | {
"commit": "b12701769822aaf5451982e26d7b7d1c2f21b137",
"date": "2024-04-11T00:00:00"
} | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | ConNF/ConNF/Model/Result.lean | ConNF.Model.Result | ConNF.Model.Result.jsonl | {
"lineInFile": 109,
"tokenPositionInFile": 2983,
"theoremPositionInFile": 27
} | {
"inFilePremises": true,
"numInFilePremises": 1,
"repositoryPremises": true,
"numRepositoryPremises": 13,
"numPremises": 25
} | {
"hasProof": true,
"proof": ":=\n (TSet.exists_typeLower hβ hγ hδ hε x).choose_spec",
"proofType": "term",
"proofLengthLines": 1,
"proofLengthTokens": 54
} |
import ConNF.Base.TypeIndex
/-!
# Paths of type indices
In this file, we define the notion of a *path*, and the derivative and coderivative operations.
## Main declarations
* `ConNF.Path`: A path of type indices.
* `ConNF.Path.recSderiv`, `ConNF.Path.recSderivLe`, `ConNF.Path.recSderivGlobal`:
Downwards induction principles for paths.
* `ConNF.Path.recScoderiv`: An upwards induction principle for paths.
-/
universe u
open Cardinal WithBot
namespace ConNF
variable [Params.{u}] {α β γ δ : TypeIndex}
/-- A path of type indices starting at `α` and ending at `β` is a finite sequence of type indices
`α > ... > β`. -/
inductive Path (α : TypeIndex) : TypeIndex → Type u
| nil : Path α α
| cons {β γ : TypeIndex} : Path α β → γ < β → Path α γ
@[inherit_doc] infix:70 " ↝ " => Path
def Path.single {α β : TypeIndex} (h : β < α) : α ↝ β :=
.cons .nil h
/-- Typeclass for the `↘` notation. -/
class SingleDerivative (X : Type _) (Y : outParam <| Type _)
(β : outParam TypeIndex) (γ : TypeIndex) where
sderiv : X → γ < β → Y
/-- Typeclass for the `⇘` notation. -/
class Derivative (X : Type _) (Y : outParam <| Type _)
(β : outParam TypeIndex) (γ : TypeIndex) extends SingleDerivative X Y β γ where
deriv : X → β ↝ γ → Y
sderiv x h := deriv x (.single h)
deriv_single : ∀ x : X, ∀ h : γ < β, deriv x (.single h) = sderiv x h := by intros; rfl
/-- Typeclass for the `↘.` notation. -/
class BotSingleDerivative (X : Type _) (Y : outParam <| Type _) where
botSderiv : X → Y
/-- Typeclass for the `⇘.` notation. -/
class BotDerivative (X : Type _) (Y : outParam <| Type _) (β : outParam TypeIndex)
extends BotSingleDerivative X Y where
botDeriv : X → β ↝ ⊥ → Y
/-- We often need to do case analysis on `β` to show that it's a proper type index here.
This case check doesn't need to be done in most actual use cases of the notation. -/
botDeriv_single : ∀ x : X, ∀ h : ⊥ < β, botDeriv x (.single h) = botSderiv x
/-- Typeclass for the `↗` notation. -/
class SingleCoderivative (X : Type _) (Y : outParam <| Type _)
(β : TypeIndex) (γ : outParam TypeIndex) where
scoderiv : X → γ < β → Y
/-- Typeclass for the `⇗` notation. -/
class Coderivative (X : Type _) (Y : outParam <| Type _)
(β : TypeIndex) (γ : outParam TypeIndex) extends SingleCoderivative X Y β γ where
coderiv : X → β ↝ γ → Y
scoderiv x h := coderiv x (.single h)
coderiv_single : ∀ x : X, ∀ h : γ < β, coderiv x (.single h) = scoderiv x h := by intros; rfl
infixl:75 " ↘ " => SingleDerivative.sderiv
infixl:75 " ⇘ " => Derivative.deriv
postfix:75 " ↘." => BotSingleDerivative.botSderiv
infixl:75 " ⇘. " => BotDerivative.botDeriv
infixl:75 " ↗ " => SingleCoderivative.scoderiv
infixl:75 " ⇗ " => Coderivative.coderiv
@[simp]
theorem deriv_single {X Y : Type _} [Derivative X Y β γ] (x : X) (h : γ < β) :
x ⇘ .single h = x ↘ h :=
Derivative.deriv_single x h
@[simp]
theorem coderiv_single {X Y : Type _} [Coderivative X Y β γ] (x : X) (h : γ < β) :
x ⇗ .single h = x ↗ h :=
Coderivative.coderiv_single x h
@[simp]
theorem botDeriv_single {X Y : Type _} [BotDerivative X Y β] (x : X) (h : ⊥ < β) :
x ⇘. .single h = x ↘. :=
BotDerivative.botDeriv_single x h
/-!
## Downwards recursion along paths
-/
instance : SingleDerivative (α ↝ β) (α ↝ γ) β γ where
sderiv := .cons
/-- The downwards recursion principle for paths. -/
@[elab_as_elim, induction_eliminator, cases_eliminator]
def Path.recSderiv {motive : ∀ β, α ↝ β → Sort _}
(nil : motive α .nil)
(sderiv : ∀ β γ (A : α ↝ β) (h : γ < β), motive β A → motive γ (A ↘ h)) :
{β : TypeIndex} → (A : α ↝ β) → motive β A
| _, .nil => nil
| _, .cons A h => sderiv _ _ A h (recSderiv nil sderiv A)
@[simp]
theorem Path.recSderiv_nil {motive : ∀ β, α ↝ β → Sort _}
(nil : motive α .nil)
(sderiv : ∀ β γ (A : α ↝ β) (h : γ < β), motive β A → motive γ (A ↘ h)) :
recSderiv (motive := motive) nil sderiv .nil = nil :=
rfl
@[simp]
theorem Path.recSderiv_sderiv {motive : ∀ β, α ↝ β → Sort _}
(nil : motive α .nil)
(sderiv : ∀ β γ (A : α ↝ β) (h : γ < β), motive β A → motive γ (A ↘ h))
{β γ : TypeIndex} (A : α ↝ β) (h : γ < β) :
recSderiv (motive := motive) nil sderiv (A ↘ h) = sderiv β γ A h (recSderiv nil sderiv A) :=
rfl
theorem Path.le (A : α ↝ β) : β ≤ α := by
induction A with
| nil => exact le_rfl
| sderiv β γ _A h h' => exact h.le.trans h'
/-- The downwards recursion principle for paths, specialised to the case where the motive at `β`
only depends on the fact that `β ≤ α`. -/
def Path.recSderivLe {motive : ∀ β ≤ α, Sort _}
(nil : motive α le_rfl)
(sderiv : ∀ β γ, ∀ (A : α ↝ β) (h : γ < β), motive β A.le → motive γ (h.le.trans A.le)) :
{β : TypeIndex} → (A : α ↝ β) → motive β A.le :=
Path.recSderiv (motive := λ β A ↦ motive β A.le) nil sderiv
@[simp]
theorem Path.recSderivLe_nil {motive : ∀ β ≤ α, Sort _}
(nil : motive α le_rfl)
(sderiv : ∀ β γ (A : α ↝ β) (h : γ < β), motive β A.le → motive γ (h.le.trans A.le)) :
recSderivLe (motive := motive) nil sderiv .nil = nil :=
rfl
@[simp]
theorem Path.recSderivLe_sderiv {motive : ∀ β ≤ α, Sort _}
(nil : motive α le_rfl)
(sderiv : ∀ β γ (A : α ↝ β) (h : γ < β), motive β A.le → motive γ (h.le.trans A.le))
{β γ : TypeIndex} (A : α ↝ β) (h : γ < β) :
recSderivLe (motive := motive) nil sderiv (A ↘ h) = sderiv β γ A h (recSderiv nil sderiv A) :=
rfl
/-- The downwards recursion principle for paths, specialised to the case where the motive is not
dependent on the relation of `β` to `α`. -/
@[elab_as_elim]
def Path.recSderivGlobal {motive : TypeIndex → Sort _}
(nil : motive α)
(sderiv : ∀ β γ, α ↝ β → γ < β → motive β → motive γ) :
{β : TypeIndex} → α ↝ β → motive β :=
Path.recSderiv (motive := λ β _ ↦ motive β) nil sderiv
@[simp]
theorem Path.recSderivGlobal_nil {motive : TypeIndex → Sort _}
(nil : motive α)
(sderiv : ∀ β γ, α ↝ β → γ < β → motive β → motive γ) :
recSderivGlobal (motive := motive) nil sderiv .nil = nil :=
rfl
@[simp]
theorem Path.recSderivGlobal_sderiv {motive : TypeIndex → Sort _}
(nil : motive α)
(sderiv : ∀ β γ, α ↝ β → γ < β → motive β → motive γ)
{β γ : TypeIndex} (A : α ↝ β) (h : γ < β) :
recSderivGlobal (motive := motive) nil sderiv (A ↘ h) =
sderiv β γ A h (recSderiv nil sderiv A) :=
rfl
/-!
## Derivatives of paths
-/
instance : Derivative (α ↝ β) (α ↝ γ) β γ where
deriv A := Path.recSderivGlobal A (λ _ _ _ h B ↦ B ↘ h)
instance : BotDerivative (α ↝ β) (α ↝ ⊥) β where
botDeriv A B := A ⇘ B
botSderiv A :=
match β with
| ⊥ => A
| (β : Λ) => A ↘ bot_lt_coe β
botDeriv_single A h := by
cases β using WithBot.recBotCoe with
| bot => cases lt_irrefl ⊥ h
| coe => rfl
instance : Coderivative (β ↝ γ) (α ↝ γ) α β where
coderiv A B := B ⇘ A
@[simp]
theorem Path.deriv_nil (A : α ↝ β) :
A ⇘ .nil = A :=
rfl
@[simp]
theorem Path.deriv_sderiv (A : α ↝ β) (B : β ↝ γ) (h : δ < γ) :
A ⇘ (B ↘ h) = A ⇘ B ↘ h :=
rfl
@[simp]
theorem Path.nil_deriv (A : α ↝ β) :
(.nil : α ↝ α) ⇘ A = A := by
induction A with
| nil => rfl
| sderiv γ δ A h ih => rw [deriv_sderiv, ih]
@[simp]
theorem Path.deriv_sderivBot (A : α ↝ β) (B : β ↝ γ) :
A ⇘ (B ↘.) = A ⇘ B ↘. := by
cases γ using WithBot.recBotCoe with
| bot => rfl
| coe => rfl
@[simp]
theorem Path.botSderiv_bot_eq (A : α ↝ ⊥) :
A ↘. = A :=
rfl
@[simp]
theorem Path.botSderiv_coe_eq {β : Λ} (A : α ↝ β) :
A ↘ bot_lt_coe β = A ↘. :=
rfl
@[simp]
theorem Path.deriv_assoc (A : α ↝ β) (B : β ↝ γ) (C : γ ↝ δ) :
A ⇘ (B ⇘ C) = A ⇘ B ⇘ C := by
induction C with
| nil => rfl
| sderiv ε ζ C h ih => simp only [deriv_sderiv, ih]
@[simp]
theorem Path.deriv_sderiv_assoc (A : α ↝ β) (B : β ↝ γ) (h : δ < γ) :
A ⇘ (B ↘ h) = A ⇘ B ↘ h :=
rfl
@[simp]
theorem Path.deriv_scoderiv (A : α ↝ β) (B : γ ↝ δ) (h : γ < β) :
A ⇘ (B ↗ h) = A ↘ h ⇘ B := by
induction B with
| nil => rfl
| sderiv ε ζ B h' ih =>
rw [deriv_sderiv, ← ih]
rfl
@[simp]
theorem Path.botDeriv_scoderiv (A : α ↝ β) (B : γ ↝ ⊥) (h : γ < β) :
A ⇘. (B ↗ h) = A ↘ h ⇘. B :=
deriv_scoderiv A B h
theorem Path.coderiv_eq_deriv (A : α ↝ β) (B : β ↝ γ) :
B ⇗ A = A ⇘ B :=
rfl
theorem Path.coderiv_deriv (A : β ↝ γ) (h₁ : β < α) (h₂ : δ < γ) :
A ↗ h₁ ↘ h₂ = A ↘ h₂ ↗ h₁ :=
rfl
theorem Path.coderiv_deriv' (A : β ↝ γ) (h : β < α) (B : γ ↝ δ) :
A ↗ h ⇘ B = A ⇘ B ↗ h := by
induction B with
| nil => rfl
| sderiv ε ζ B h' ih =>
rw [deriv_sderiv, ih]
rfl
theorem Path.eq_nil (A : β ↝ β) :
A = .nil := by
cases A with
| nil => rfl
| sderiv γ _ A h => cases A.le.not_lt h
theorem Path.sderiv_index_injective {A : α ↝ β} {B : α ↝ γ} {hδβ : δ < β} {hδγ : δ < γ}
(h : A ↘ hδβ = B ↘ hδγ) :
β = γ := by
cases h
rfl
theorem Path.sderivBot_index_injective {β γ : Λ} {A : α ↝ β} {B : α ↝ γ}
(h : A ↘. = B ↘.) :
β = γ := by
cases h
rfl
theorem Path.sderiv_path_injective {A B : α ↝ β} {hγ : γ < β} (h : A ↘ hγ = B ↘ hγ) :
A = B := by
cases h
rfl
theorem Path.sderivBot_path_injective {β : Λ} {A B : α ↝ β} (h : A ↘. = B ↘.) :
A = B := by
cases h
rfl
theorem Path.deriv_left_injective {A B : α ↝ β} {C : β ↝ γ} (h : A ⇘ C = B ⇘ C) :
A = B := by
induction C with
| nil => exact h
| sderiv δ ε C hε ih =>
rw [deriv_sderiv_assoc, deriv_sderiv_assoc] at h
exact ih (Path.sderiv_path_injective h)
theorem Path.deriv_right_injective {A : α ↝ β} {B C : β ↝ γ} (h : A ⇘ B = A ⇘ C) :
B = C := by
induction C with
| nil => exact B.eq_nil
| sderiv δ ε C hε ih =>
cases B with
| nil => cases C.le.not_lt hε
| sderiv ζ η B hε' =>
cases Path.sderiv_index_injective h
rw [deriv_sderiv_assoc, deriv_sderiv_assoc] at h
rw [ih (Path.sderiv_path_injective h)]
@[simp]
theorem Path.sderiv_left_inj {A B : α ↝ β} {h : γ < β} :
A ↘ h = B ↘ h ↔ A = B :=
⟨Path.sderiv_path_injective, λ h ↦ h ▸ rfl⟩
@[simp]
theorem Path.deriv_left_inj {A B : α ↝ β} {C : β ↝ γ} :
A ⇘ C = B ⇘ C ↔ A = B :=
⟨deriv_left_injective, λ h ↦ h ▸ rfl⟩
@[simp]
theorem Path.deriv_right_inj {A : α ↝ β} {B C : β ↝ γ} :
A ⇘ B = A ⇘ C ↔ B = C :=
⟨deriv_right_injective, λ h ↦ h ▸ rfl⟩
| @[simp]
theorem Path.scoderiv_left_inj {A B : β ↝ γ} {h : β < α} :
A ↗ h = B ↗ h ↔ A = B | ConNF.Path.scoderiv_left_inj | {
"commit": "8896e416a16c39e1fe487b5fc7c78bc20c4e182b",
"date": "2024-12-03T00:00:00"
} | {
"commit": "ce890707e37ede74a2fcd66134d3f403335c5cc1",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/Levels/Path.lean | ConNF.Levels.Path | ConNF.Levels.Path.jsonl | {
"lineInFile": 337,
"tokenPositionInFile": 10251,
"theoremPositionInFile": 43
} | {
"inFilePremises": true,
"numInFilePremises": 6,
"repositoryPremises": true,
"numRepositoryPremises": 11,
"numPremises": 21
} | {
"hasProof": true,
"proof": ":=\n deriv_right_inj",
"proofType": "term",
"proofLengthLines": 1,
"proofLengthTokens": 20
} |
import ConNF.Model.Externalise
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal
namespace ConNF
variable [Params.{u}] {β γ : Λ} {hγ : (γ : TypeIndex) < β}
namespace Support
theorem not_mem_scoderiv_botDeriv (S : Support γ) (N : NearLitter) :
N ∉ (S ↗ hγ ⇘. (Path.nil ↘.))ᴺ := by
rintro ⟨i, ⟨A, N'⟩, h₁, h₂⟩
simp only [Prod.mk.injEq] at h₂
cases A
case sderiv δ A hδ _ =>
simp only [Path.deriv_sderiv] at h₂
cases A
case nil => cases h₂.1
case sderiv ζ A hζ _ =>
simp only [Path.deriv_sderiv] at h₂
cases h₂.1
variable [Level] [LtLevel β]
theorem not_mem_strong_botDeriv (S : Support γ) (N : NearLitter) :
N ∉ ((S ↗ hγ).strong ⇘. (Path.nil ↘.))ᴺ := by
rintro h
rw [strong, close_nearLitters, preStrong_nearLitters, Enumeration.mem_add_iff] at h
obtain h | h := h
· exact not_mem_scoderiv_botDeriv S N h
· rw [mem_constrainsNearLitters_nearLitters] at h
obtain ⟨B, N', hN', h⟩ := h
cases h using Relation.ReflTransGen.head_induction_on
case refl => exact not_mem_scoderiv_botDeriv S N hN'
case head x hx₁ hx₂ _ =>
obtain ⟨⟨γ, δ, ε, hδ, hε, hδε, A⟩, t, B, hB, hN, ht⟩ := hx₂
simp only at hB
cases B
case nil =>
cases hB
obtain ⟨C, N''⟩ := x
simp only at ht
cases ht.1
change _ ∈ t.supportᴺ at hN
rw [t.support_supports.2 rfl] at hN
obtain ⟨i, hN⟩ := hN
cases hN
case sderiv δ B hδ _ _ =>
cases B
case nil => cases hB
case sderiv ζ B hζ _ _ => cases hB
theorem raise_preStrong' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).PreStrong := by
apply hS.toPreStrong.add
constructor
intro A N hN P t hA ht
obtain ⟨A, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN
simp only [scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, interferenceSupport_nearLitters,
Enumeration.mem_add_iff, Enumeration.mem_smul, Enumeration.not_mem_empty, or_false] at hN
obtain ⟨δ, ε, ζ, hε, hζ, hεζ, B⟩ := P
dsimp only at *
cases A
case sderiv ζ' A hζ' _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_left_inj.mp at hA
cases A
case nil =>
cases hA
cases not_mem_strong_botDeriv T _ hN
case sderiv ι A hι _ _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
cases hA
haveI : LtLevel δ := ⟨A.le.trans_lt LtLevel.elim⟩
haveI : LtLevel ε := ⟨hε.trans LtLevel.elim⟩
haveI : LtLevel ζ := ⟨hζ.trans LtLevel.elim⟩
have := (T ↗ hγ).strong_strong.support_le hN ⟨δ, ε, ζ, hε, hζ, hεζ, A⟩
(ρ⁻¹ ⇘ A ↘ hε • t) rfl ?_
· simp only [Tangle.smul_support, allPermSderiv_forget, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv] at this
have := smul_le_smul this (ρᵁ ⇘ A ↘ hε)
simp only [smul_inv_smul] at this
apply le_trans this
intro B
constructor
· intro a ha
simp only [smul_derivBot, Tree.sderiv_apply, Tree.deriv_apply, Path.deriv_scoderiv,
deriv_derivBot, Enumeration.mem_smul] at ha
rw [deriv_derivBot, ← Path.deriv_scoderiv, Path.coderiv_deriv', scoderiv_botDeriv_eq,]
simp only [Path.deriv_scoderiv, add_derivBot, smul_derivBot,
BaseSupport.add_atoms, BaseSupport.smul_atoms, Enumeration.mem_add_iff,
Enumeration.mem_smul]
exact Or.inl ha
· intro N hN
simp only [smul_derivBot, Tree.sderiv_apply, Tree.deriv_apply, Path.deriv_scoderiv,
deriv_derivBot, Enumeration.mem_smul] at hN
rw [deriv_derivBot, ← Path.deriv_scoderiv, Path.coderiv_deriv', scoderiv_botDeriv_eq,]
simp only [Path.deriv_scoderiv, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul]
exact Or.inl hN
· rw [← smul_fuzz hε hζ hεζ, ← ht]
simp only [Path.botSderiv_coe_eq, BasePerm.smul_nearLitter_litter, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.inv_sderivBot]
rfl
theorem raise_closed' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β)
(hρ : ρᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).Closed := by
constructor
intro A
constructor
intro N₁ N₂ hN₁ hN₂ a ha
simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff,
BaseSupport.add_atoms] at hN₁ hN₂ ⊢
obtain hN₁ | hN₁ := hN₁
· obtain hN₂ | hN₂ := hN₂
· exact Or.inl ((hS.closed A).interference_subset hN₁ hN₂ a ha)
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN₂
simp only [smul_add, scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul, BaseSupport.add_atoms, BaseSupport.smul_atoms] at hN₁ hN₂ ⊢
refine Or.inr (Or.inr ?_)
rw [mem_interferenceSupport_atoms]
refine ⟨(ρᵁ B)⁻¹ • N₁, ?_, (ρᵁ B)⁻¹ • N₂, ?_, ?_⟩
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
rw [← Enumeration.mem_smul, ← BaseSupport.smul_nearLitters, ← smul_derivBot, hρ]
exact Or.inl hN₁
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₂
exact Or.inr hN₂
· rw [← BasePerm.smul_interference]
exact Set.smul_mem_smul_set ha
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN₁
simp only [smul_add, scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul, BaseSupport.add_atoms, BaseSupport.smul_atoms] at hN₁ hN₂ ⊢
refine Or.inr (Or.inr ?_)
rw [mem_interferenceSupport_atoms]
refine ⟨(ρᵁ B)⁻¹ • N₁, ?_, (ρᵁ B)⁻¹ • N₂, ?_, ?_⟩
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₁
exact Or.inr hN₁
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₂
obtain hN₂ | hN₂ := hN₂
· rw [← Enumeration.mem_smul, ← BaseSupport.smul_nearLitters, ← smul_derivBot, hρ]
exact Or.inl hN₂
· exact Or.inr hN₂
· rw [← BasePerm.smul_interference]
exact Set.smul_mem_smul_set ha
theorem raise_strong' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β)
(hρ : ρᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).Strong :=
⟨raise_preStrong' S hS T ρ hγ, raise_closed' S hS T ρ hγ hρ⟩
theorem convAtoms_injective_of_fixes {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(A : ↑α ↝ ⊥) :
(convAtoms
(S + (ρ₁ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim) A).Injective := by
rw [Support.smul_eq_iff] at hρ₁ hρ₂
constructor
rintro a₁ a₂ a₃ ⟨i, hi₁, hi₂⟩ ⟨j, hj₁, hj₂⟩
simp only [add_derivBot, BaseSupport.add_atoms, Rel.inv_apply,
Enumeration.rel_add_iff] at hi₁ hi₂ hj₁ hj₂
obtain hi₁ | ⟨i, rfl, hi₁⟩ := hi₁
· obtain hi₂ | ⟨i', rfl, _⟩ := hi₂
swap
· have := Enumeration.lt_bound _ _ ⟨_, hi₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i').not_lt this
cases (Enumeration.rel_coinjective _).coinjective hi₁ hi₂
obtain hj₁ | ⟨j, rfl, hj₁⟩ := hj₁
· obtain hj₂ | ⟨j', rfl, _⟩ := hj₂
· exact (Enumeration.rel_coinjective _).coinjective hj₂ hj₁
· have := Enumeration.lt_bound _ _ ⟨_, hj₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j').not_lt this
· obtain hj₂ | hj₂ := hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
· simp only [add_right_inj, exists_eq_left] at hj₂
obtain ⟨B, rfl⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨j, hj₁⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,
BaseSupport.add_atoms, Enumeration.smul_rel, add_right_inj, exists_eq_left] at hj₁ hj₂
have := (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
rw [← (hρ₂ B).1 a₁ ⟨_, hi₁⟩, inv_smul_smul, inv_smul_eq_iff, (hρ₁ B).1 a₁ ⟨_, hi₁⟩] at this
exact this.symm
· obtain ⟨B, rfl⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨i, hi₁⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,
BaseSupport.add_atoms, Enumeration.smul_rel, add_right_inj, exists_eq_left] at hi₁ hi₂ hj₁ hj₂
obtain hi₂ | hi₂ := hi₂
· have := Enumeration.lt_bound _ _ ⟨_, hi₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i).not_lt this
have hi := (Enumeration.rel_coinjective _).coinjective hi₁ hi₂
suffices hj : (ρ₁ᵁ B)⁻¹ • a₂ = (ρ₂ᵁ B)⁻¹ • a₃ by
rwa [← hj, smul_left_cancel_iff] at hi
obtain hj₁ | ⟨j, rfl, hj₁⟩ := hj₁
· obtain hj₂ | ⟨j', rfl, _⟩ := hj₂
· rw [← (hρ₁ B).1 a₂ ⟨_, hj₁⟩, ← (hρ₂ B).1 a₃ ⟨_, hj₂⟩, inv_smul_smul, inv_smul_smul]
exact (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j').not_lt this
· obtain hj₂ | hj₂ := hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
· simp only [add_right_inj, exists_eq_left] at hj₂
exact (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
theorem atomMemRel_le_of_fixes {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(A : ↑α ↝ ⊥) :
atomMemRel (S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A ≤
atomMemRel (S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A := by
rw [Support.smul_eq_iff] at hρ₁ hρ₂
rintro i j ⟨N, hN, a, haN, ha⟩
simp only [add_derivBot, BaseSupport.add_atoms, Rel.inv_apply, Enumeration.rel_add_iff,
BaseSupport.add_nearLitters] at ha hN
obtain hN | ⟨i, rfl, hi⟩ := hN
· obtain ha | ⟨j, rfl, hj⟩ := ha
· exact ⟨N, Or.inl hN, a, haN, Or.inl ha⟩
· obtain ⟨B, rfl⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨j, hj⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,
BaseSupport.add_atoms, Enumeration.smul_rel] at hj hN
refine ⟨N, Or.inl hN, ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • a, ?_, ?_⟩
· dsimp only
rw [← (hρ₂ B).2 N ⟨_, hN⟩, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]
have := (hρ₁ B).2 N ⟨_, hN⟩
rw [smul_eq_iff_eq_inv_smul] at this
rwa [this, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]
· rw [Rel.inv_apply, add_derivBot, BaseSupport.add_atoms, Enumeration.rel_add_iff]
simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,
BaseSupport.smul_atoms, BaseSupport.add_atoms, Enumeration.smul_rel, inv_smul_smul,
exists_eq_left]
exact Or.inr hj
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv ⟨i, hi⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,
BaseSupport.add_atoms, Enumeration.smul_rel] at hi ha
obtain ha | ⟨j, rfl, hj⟩ := ha
· refine ⟨ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • N, ?_, a, ?_, Or.inl ha⟩
· rw [add_derivBot, BaseSupport.add_nearLitters, Enumeration.rel_add_iff]
simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,
BaseSupport.smul_nearLitters, BaseSupport.add_nearLitters, Enumeration.smul_rel,
inv_smul_smul, exists_eq_left]
exact Or.inr hi
· dsimp only
rw [← (hρ₂ B).1 a ⟨_, ha⟩, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]
have := (hρ₁ B).1 a ⟨_, ha⟩
rw [smul_eq_iff_eq_inv_smul] at this
rwa [this, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]
· refine ⟨ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • N, ?_, ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • a, ?_, ?_⟩
· rw [add_derivBot, BaseSupport.add_nearLitters, Enumeration.rel_add_iff]
simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,
BaseSupport.smul_nearLitters, BaseSupport.add_nearLitters, Enumeration.smul_rel,
inv_smul_smul, exists_eq_left]
exact Or.inr hi
· simp only [BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]
exact haN
· rw [Rel.inv_apply, add_derivBot, BaseSupport.add_atoms, Enumeration.rel_add_iff]
simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,
BaseSupport.smul_atoms, BaseSupport.add_atoms, Enumeration.smul_rel, inv_smul_smul,
exists_eq_left]
exact Or.inr hj
theorem convNearLitters_cases {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
{A : α ↝ ⊥} {N₁ N₂ : NearLitter} :
convNearLitters
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A N₁ N₂ →
N₁ = N₂ ∧ N₁ ∈ (S ⇘. A)ᴺ ∨
∃ B : β ↝ ⊥, A = B ↗ LtLevel.elim ∧ (ρ₁ᵁ B)⁻¹ • N₁ = (ρ₂ᵁ B)⁻¹ • N₂ ∧
(ρ₁ᵁ B)⁻¹ • N₁ ∈ (((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport) ⇘. B)ᴺ := by
rintro ⟨i, hN₁, hN₂⟩
simp only [add_derivBot, BaseSupport.add_nearLitters, Rel.inv_apply,
Enumeration.rel_add_iff] at hN₁ hN₂
obtain hN₁ | ⟨i, rfl, hN₁⟩ := hN₁
· obtain hN₂ | ⟨i, rfl, hN₂⟩ := hN₂
swap
· have := Enumeration.lt_bound _ _ ⟨_, hN₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i).not_lt this
exact Or.inl ⟨(Enumeration.rel_coinjective _).coinjective hN₁ hN₂, _, hN₁⟩
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv ⟨i, hN₁⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_nearLitters,
BaseSupport.add_nearLitters, Enumeration.smul_rel, add_right_inj, exists_eq_left] at hN₁ hN₂
obtain hN₂ | hN₂ := hN₂
· have := Enumeration.lt_bound _ _ ⟨_, hN₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i).not_lt this
exact Or.inr ⟨B, rfl, (Enumeration.rel_coinjective _).coinjective hN₁ hN₂, _, hN₁⟩
theorem inflexible_of_inflexible_of_fixes {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
{A : α ↝ ⊥} {N₁ N₂ : NearLitter} :
convNearLitters
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A N₁ N₂ →
∀ (P : InflexiblePath ↑α) (t : Tangle P.δ), A = P.A ↘ P.hε ↘. → N₁ᴸ = fuzz P.hδε t →
∃ ρ : AllPerm P.δ, N₂ᴸ = fuzz P.hδε (ρ • t) := by
rintro hN ⟨γ, δ, ε, hδ, hε, hδε, A⟩ t hA ht
haveI : LeLevel γ := ⟨A.le⟩
haveI : LtLevel δ := ⟨hδ.trans_le LeLevel.elim⟩
haveI : LtLevel ε := ⟨hε.trans_le LeLevel.elim⟩
obtain ⟨rfl, _⟩ | ⟨B, rfl, hN'⟩ := convNearLitters_cases hN
· use 1
rw [one_smul, ht]
· clear hN
cases B
case sderiv ε B hε' _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_path_injective at hA
cases B
case nil =>
simp only [Path.botSderiv_coe_eq, add_derivBot, BaseSupport.add_nearLitters,
interferenceSupport_nearLitters, Enumeration.add_empty] at hN'
cases not_mem_strong_botDeriv _ _ hN'.2
case sderiv ζ B hζ _ _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_path_injective at hA
dsimp only at hA hζ hε' B t
cases hA
use (ρ₂ * ρ₁⁻¹) ⇘ B ↘ hδ
rw [inv_smul_eq_iff] at hN'
rw [← smul_fuzz hδ hε hδε, ← ht, hN'.1]
simp only [allPermDeriv_forget, allPermForget_mul, allPermForget_inv, Tree.mul_deriv,
Tree.inv_deriv, Tree.mul_sderiv, Tree.inv_sderiv, Tree.mul_sderivBot, Tree.inv_sderivBot,
Path.botSderiv_coe_eq, BasePerm.smul_nearLitter_litter, mul_smul]
erw [inv_smul_smul, smul_inv_smul]
theorem atoms_of_inflexible_of_fixes {S : Support α} (hS : S.Strong) {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(A : α ↝ ⊥) (N₁ N₂ : NearLitter) (P : InflexiblePath ↑α) (t : Tangle P.δ) (ρ : AllPerm P.δ) :
A = P.A ↘ P.hε ↘. → N₁ᴸ = fuzz P.hδε t → N₂ᴸ = fuzz P.hδε (ρ • t) →
convNearLitters
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A N₁ N₂ →
∀ (B : P.δ ↝ ⊥), ∀ a ∈ (t.support ⇘. B)ᴬ, ∀ (i : κ),
((S + (ρ₁ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim) ⇘. (P.A ↘ P.hδ ⇘ B))ᴬ.rel i a →
((S + (ρ₂ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim) ⇘. (P.A ↘ P.hδ ⇘ B))ᴬ.rel i (ρᵁ B • a) := by
rw [Support.smul_eq_iff] at hρ₁ hρ₂
obtain ⟨γ, δ, ε, hδ, hε, hδε, B⟩ := P
haveI : LeLevel γ := ⟨B.le⟩
haveI : LtLevel δ := ⟨hδ.trans_le LeLevel.elim⟩
haveI : LtLevel ε := ⟨hε.trans_le LeLevel.elim⟩
dsimp only at t ρ ⊢
intro hA hN₁ hN₂ hN C a ha i hi
obtain ⟨rfl, hN'⟩ | ⟨A, rfl, hN₁', hN₂'⟩ := convNearLitters_cases hN
· have haS := (hS.support_le hN' ⟨γ, δ, ε, hδ, hε, hδε, _⟩ t hA hN₁ _).1 a ha
rw [hN₂] at hN₁
have hρt := congr_arg Tangle.support (fuzz_injective hN₁)
rw [Tangle.smul_support, Support.smul_eq_iff] at hρt
simp only [add_derivBot, BaseSupport.add_atoms, Enumeration.rel_add_iff] at hi ⊢
rw [(hρt C).1 a ha]
obtain hi | ⟨i, rfl, hi⟩ := hi
· exact Or.inl hi
· simp only [add_right_inj, exists_eq_left]
obtain ⟨D, hD⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨i, hi⟩
cases B using Path.recScoderiv
case nil =>
cases Path.scoderiv_index_injective hD
cases Path.scoderiv_left_inj.mp hD
simp only [hD, Path.coderiv_deriv, Path.coderiv_deriv', scoderiv_botDeriv_eq, smul_derivBot,
add_derivBot, BaseSupport.smul_atoms, BaseSupport.add_atoms, Enumeration.smul_rel] at hi ⊢
rw [deriv_derivBot, hD] at haS
rw [← (hρ₂ _).1 a haS, inv_smul_smul]
rw [← (hρ₁ _).1 a haS, inv_smul_smul] at hi
exact Or.inr hi
case scoderiv ζ B hζ' _ =>
rw [Path.coderiv_deriv, Path.coderiv_deriv'] at hD
cases Path.scoderiv_index_injective hD
rw [Path.scoderiv_left_inj] at hD
cases hD
simp only [Path.coderiv_deriv, Path.coderiv_deriv', scoderiv_botDeriv_eq, smul_derivBot,
add_derivBot, BaseSupport.smul_atoms, BaseSupport.add_atoms, Enumeration.smul_rel] at hi ⊢
rw [deriv_derivBot, Path.coderiv_deriv, Path.coderiv_deriv'] at haS
rw [← (hρ₂ _).1 a haS, inv_smul_smul]
rw [← (hρ₁ _).1 a haS, inv_smul_smul] at hi
exact Or.inr hi
· simp only [add_derivBot, BaseSupport.add_nearLitters, interferenceSupport_nearLitters,
Enumeration.add_empty] at hN₂'
cases A
case sderiv ζ A hζ' _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_path_injective at hA
cases A
case nil =>
cases hA
cases not_mem_strong_botDeriv _ _ hN₂'
case sderiv ζ A hζ _ _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_path_injective at hA
cases hA
simp only [Path.coderiv_deriv, Path.coderiv_deriv', add_derivBot, scoderiv_botDeriv_eq,
smul_derivBot, BaseSupport.add_atoms, BaseSupport.smul_atoms] at hi ⊢
have : N₂ᴸ = (ρ₂ ⇘ A)ᵁ ↘ hζ ↘. • (ρ₁⁻¹ ⇘ A)ᵁ ↘ hζ ↘. • fuzz hδε t := by
rw [inv_smul_eq_iff] at hN₁'
rw [hN₁', Path.botSderiv_coe_eq, BasePerm.smul_nearLitter_litter,
BasePerm.smul_nearLitter_litter, smul_smul, smul_eq_iff_eq_inv_smul,
mul_inv_rev, inv_inv, mul_smul, ← Tree.inv_apply, ← allPermForget_inv] at hN₁
rw [hN₁]
simp only [allPermForget_inv, Tree.inv_apply, allPermDeriv_forget, Tree.inv_deriv,
Tree.inv_sderiv, Tree.inv_sderivBot]
rfl
rw [smul_fuzz hδ hε hδε, smul_fuzz hδ hε hδε] at this
have := fuzz_injective (hN₂.symm.trans this)
rw [smul_smul] at this
rw [t.smul_atom_eq_of_mem_support this ha]
rw [Enumeration.rel_add_iff] at hi ⊢
obtain hi | ⟨i, rfl, hi⟩ := hi
· left
simp only [allPermForget_mul, allPermSderiv_forget, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.mul_apply, Tree.sderiv_apply,
Tree.deriv_apply, Path.deriv_scoderiv, Tree.inv_apply, mul_smul]
rwa [← (hρ₁ _).1 a ⟨i, hi⟩, inv_smul_smul, (hρ₂ _).1 a ⟨i, hi⟩]
· refine Or.inr ⟨i, rfl, ?_⟩
simp only [allPermForget_mul, allPermSderiv_forget, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.mul_apply, Tree.sderiv_apply,
Tree.deriv_apply, Path.deriv_scoderiv, Tree.inv_apply, mul_smul, Enumeration.smul_rel,
inv_smul_smul]
exact hi
theorem nearLitters_of_inflexible_of_fixes {S : Support α} (hS : S.Strong) {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(A : α ↝ ⊥) (N₁ N₂ : NearLitter) (P : InflexiblePath ↑α) (t : Tangle P.δ) (ρ : AllPerm P.δ) :
A = P.A ↘ P.hε ↘. → N₁ᴸ = fuzz P.hδε t → N₂ᴸ = fuzz P.hδε (ρ • t) →
convNearLitters
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A N₁ N₂ →
∀ (B : P.δ ↝ ⊥), ∀ N ∈ (t.support ⇘. B)ᴺ, ∀ (i : κ),
((S + (ρ₁ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim) ⇘. (P.A ↘ P.hδ ⇘ B))ᴺ.rel i N →
((S + (ρ₂ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim) ⇘. (P.A ↘ P.hδ ⇘ B))ᴺ.rel i (ρᵁ B • N) := by
rw [Support.smul_eq_iff] at hρ₁ hρ₂
obtain ⟨γ, δ, ε, hδ, hε, hδε, B⟩ := P
haveI : LeLevel γ := ⟨B.le⟩
haveI : LtLevel δ := ⟨hδ.trans_le LeLevel.elim⟩
haveI : LtLevel ε := ⟨hε.trans_le LeLevel.elim⟩
dsimp only at t ρ ⊢
intro hA hN₁ hN₂ hN C N₀ hN₀ i hi
obtain ⟨rfl, hN'⟩ | ⟨A, rfl, hN₁', hN₂'⟩ := convNearLitters_cases hN
· have haS := (hS.support_le hN' ⟨γ, δ, ε, hδ, hε, hδε, _⟩ t hA hN₁ _).2 N₀ hN₀
rw [hN₂] at hN₁
have hρt := congr_arg Tangle.support (fuzz_injective hN₁)
rw [Tangle.smul_support, Support.smul_eq_iff] at hρt
simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.rel_add_iff] at hi ⊢
rw [(hρt C).2 N₀ hN₀]
obtain hi | ⟨i, rfl, hi⟩ := hi
· exact Or.inl hi
· simp only [add_right_inj, exists_eq_left]
obtain ⟨D, hD⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv ⟨i, hi⟩
cases B using Path.recScoderiv
case nil =>
cases Path.scoderiv_index_injective hD
cases Path.scoderiv_left_inj.mp hD
simp only [hD, Path.coderiv_deriv, Path.coderiv_deriv', scoderiv_botDeriv_eq, smul_derivBot,
add_derivBot, BaseSupport.smul_nearLitters, BaseSupport.add_nearLitters, Enumeration.smul_rel] at hi ⊢
rw [deriv_derivBot, hD] at haS
rw [← (hρ₂ _).2 N₀ haS, inv_smul_smul]
rw [← (hρ₁ _).2 N₀ haS, inv_smul_smul] at hi
exact Or.inr hi
case scoderiv ζ B hζ' _ =>
rw [Path.coderiv_deriv, Path.coderiv_deriv'] at hD
cases Path.scoderiv_index_injective hD
rw [Path.scoderiv_left_inj] at hD
cases hD
simp only [Path.coderiv_deriv, Path.coderiv_deriv', scoderiv_botDeriv_eq, smul_derivBot,
add_derivBot, BaseSupport.smul_nearLitters, BaseSupport.add_nearLitters, Enumeration.smul_rel] at hi ⊢
rw [deriv_derivBot, Path.coderiv_deriv, Path.coderiv_deriv'] at haS
rw [← (hρ₂ _).2 N₀ haS, inv_smul_smul]
rw [← (hρ₁ _).2 N₀ haS, inv_smul_smul] at hi
exact Or.inr hi
· simp only [add_derivBot, BaseSupport.add_nearLitters, interferenceSupport_nearLitters,
Enumeration.add_empty] at hN₂'
cases A
case sderiv ζ A hζ' _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_path_injective at hA
cases A
case nil =>
cases hA
cases not_mem_strong_botDeriv _ _ hN₂'
case sderiv ζ A hζ _ _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_path_injective at hA
cases hA
simp only [Path.coderiv_deriv, Path.coderiv_deriv', add_derivBot, scoderiv_botDeriv_eq,
smul_derivBot, BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters] at hi ⊢
have : N₂ᴸ = (ρ₂ ⇘ A)ᵁ ↘ hζ ↘. • (ρ₁⁻¹ ⇘ A)ᵁ ↘ hζ ↘. • fuzz hδε t := by
rw [inv_smul_eq_iff] at hN₁'
rw [hN₁', Path.botSderiv_coe_eq, BasePerm.smul_nearLitter_litter,
BasePerm.smul_nearLitter_litter, smul_smul, smul_eq_iff_eq_inv_smul,
mul_inv_rev, inv_inv, mul_smul, ← Tree.inv_apply, ← allPermForget_inv] at hN₁
rw [hN₁]
simp only [allPermForget_inv, Tree.inv_apply, allPermDeriv_forget, Tree.inv_deriv,
Tree.inv_sderiv, Tree.inv_sderivBot]
rfl
rw [smul_fuzz hδ hε hδε, smul_fuzz hδ hε hδε] at this
have := fuzz_injective (hN₂.symm.trans this)
rw [smul_smul] at this
rw [t.smul_nearLitter_eq_of_mem_support this hN₀]
rw [Enumeration.rel_add_iff] at hi ⊢
obtain hi | ⟨i, rfl, hi⟩ := hi
· left
simp only [allPermForget_mul, allPermSderiv_forget, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.mul_apply, Tree.sderiv_apply,
Tree.deriv_apply, Path.deriv_scoderiv, Tree.inv_apply, mul_smul]
rwa [← (hρ₁ _).2 N₀ ⟨i, hi⟩, inv_smul_smul, (hρ₂ _).2 N₀ ⟨i, hi⟩]
· refine Or.inr ⟨i, rfl, ?_⟩
simp only [allPermForget_mul, allPermSderiv_forget, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.mul_apply, Tree.sderiv_apply,
Tree.deriv_apply, Path.deriv_scoderiv, Tree.inv_apply, mul_smul, Enumeration.smul_rel,
inv_smul_smul]
exact hi
theorem litter_eq_of_flexible_of_fixes {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
{A : ↑α ↝ ⊥} {N₁ N₂ N₃ N₄ : NearLitter} :
convNearLitters
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A N₁ N₂ →
convNearLitters
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A N₃ N₄ →
¬Inflexible A N₁ᴸ → ¬Inflexible A N₂ᴸ → ¬Inflexible A N₃ᴸ → ¬Inflexible A N₄ᴸ →
N₁ᴸ = N₃ᴸ → N₂ᴸ = N₄ᴸ := by
rw [Support.smul_eq_iff] at hρ₁ hρ₂
rintro ⟨i, hi₁, hi₂⟩ ⟨j, hj₁, hj₂⟩ hN₁ hN₂ hN₃ hN₄ hN₁₃
simp only [add_derivBot, BaseSupport.add_nearLitters, Rel.inv_apply,
Enumeration.rel_add_iff] at hi₁ hi₂ hj₁ hj₂
obtain hi₁ | ⟨i, rfl, hi₁⟩ := hi₁
· obtain hi₂ | ⟨i, rfl, hi₂⟩ := hi₂
swap
· have := Enumeration.lt_bound _ _ ⟨_, hi₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i).not_lt this
cases (Enumeration.rel_coinjective _).coinjective hi₁ hi₂
obtain hj₁ | ⟨j, rfl, hj₁⟩ := hj₁
· obtain hj₂ | ⟨j, rfl, hj₂⟩ := hj₂
swap
· have := Enumeration.lt_bound _ _ ⟨_, hj₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
cases (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
exact hN₁₃
· simp only [add_right_inj, exists_eq_left] at hj₂
obtain hj₂ | hj₂ := hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
obtain ⟨A, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv ⟨j, hj₁⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_nearLitters,
BaseSupport.add_nearLitters, Enumeration.smul_rel] at hj₁ hj₂
have := congr_arg (·ᴸ) ((Enumeration.rel_coinjective _).coinjective hj₁ hj₂)
simp only [BasePerm.smul_nearLitter_litter] at this
rw [← hN₁₃, ← (hρ₁ A).2 N₁ ⟨i, hi₁⟩, BasePerm.smul_nearLitter_litter, inv_smul_smul] at this
have hN₁' := (hρ₂ A).2 N₁ ⟨i, hi₁⟩
rw [smul_eq_iff_eq_inv_smul] at hN₁'
rwa [hN₁', BasePerm.smul_nearLitter_litter, smul_left_cancel_iff] at this
· obtain hi₂ | hi₂ := hi₂
· have := Enumeration.lt_bound _ _ ⟨_, hi₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i).not_lt this
simp only [add_right_inj, exists_eq_left] at hi₂
obtain ⟨A, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv ⟨i, hi₁⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_nearLitters,
BaseSupport.add_nearLitters, Enumeration.smul_rel] at hi₁ hi₂ hj₁ hj₂
have hN₁₂ := congr_arg (·ᴸ) ((Enumeration.rel_coinjective _).coinjective hi₁ hi₂)
obtain hj₁ | ⟨j, rfl, hj₁⟩ := hj₁
· obtain hj₂ | ⟨j, rfl, hj₂⟩ := hj₂
swap
· have := Enumeration.lt_bound _ _ ⟨_, hj₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
cases (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
simp only [BasePerm.smul_nearLitter_litter] at hN₁₂
rw [hN₁₃, ← (hρ₁ A).2 N₃ ⟨j, hj₁⟩, BasePerm.smul_nearLitter_litter, inv_smul_smul,
eq_inv_smul_iff, ← BasePerm.smul_nearLitter_litter, (hρ₂ A).2 N₃ ⟨j, hj₁⟩] at hN₁₂
rw [hN₁₂]
· simp only [add_right_inj, exists_eq_left] at hj₂
obtain hj₂ | hj₂ := hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
have hN₃₄ := congr_arg (·ᴸ) ((Enumeration.rel_coinjective _).coinjective hj₁ hj₂)
simp only [BasePerm.smul_nearLitter_litter] at hN₁₂ hN₃₄
rw [hN₁₃] at hN₁₂
rwa [hN₁₂, smul_left_cancel_iff] at hN₃₄
theorem sameSpecLe_of_fixes (S : Support α) (hS : S.Strong) (T : Support γ) (ρ₁ ρ₂ : AllPerm β)
(hγ : (γ : TypeIndex) < β)
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
SameSpecLE
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) := by
constructor
case atoms_bound_eq => intro; rfl
case nearLitters_bound_eq => intro; rfl
case atoms_dom_subset =>
simp only [add_derivBot, BaseSupport.add_atoms, Enumeration.add_rel_dom,
Set.union_subset_iff, Set.subset_union_left, true_and]
rintro A _ ⟨i, ⟨a, ⟨A, a⟩, h₁, h₂⟩, rfl⟩
cases h₂
right
apply Set.mem_image_of_mem
refine ⟨ρ₂ᵁ A • (ρ₁ᵁ A)⁻¹ • a, ⟨A, ρ₂ᵁ A • (ρ₁ᵁ A)⁻¹ • a⟩, ?_, rfl⟩
rw [smul_atoms, Enumeration.smulPath_rel] at h₁ ⊢
simp only [inv_smul_smul]
exact h₁
case nearLitters_dom_subset =>
simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.add_rel_dom,
Set.union_subset_iff, Set.subset_union_left, true_and]
rintro A _ ⟨i, ⟨N, ⟨A, N⟩, h₁, h₂⟩, rfl⟩
cases h₂
right
apply Set.mem_image_of_mem
refine ⟨ρ₂ᵁ A • (ρ₁ᵁ A)⁻¹ • N, ⟨A, ρ₂ᵁ A • (ρ₁ᵁ A)⁻¹ • N⟩, ?_, rfl⟩
rw [smul_nearLitters, Enumeration.smulPath_rel] at h₁ ⊢
simp only [inv_smul_smul]
exact h₁
case convAtoms_injective => exact convAtoms_injective_of_fixes hρ₁ hρ₂
case atomMemRel_le => exact atomMemRel_le_of_fixes hρ₁ hρ₂
case inflexible_of_inflexible => exact inflexible_of_inflexible_of_fixes hρ₁ hρ₂
case atoms_of_inflexible => exact atoms_of_inflexible_of_fixes hS hρ₁ hρ₂
case nearLitters_of_inflexible => exact nearLitters_of_inflexible_of_fixes hS hρ₁ hρ₂
case litter_eq_of_flexible => exact litter_eq_of_flexible_of_fixes hρ₁ hρ₂
| theorem spec_same_of_fixes (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hρ : ρᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
(S + ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport) ↗ LtLevel.elim).spec =
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).spec | ConNF.Support.spec_same_of_fixes | {
"commit": "abf71bc79c407ceb462cc2edd2d994cda9cdef05",
"date": "2024-04-04T00:00:00"
} | {
"commit": "6709914ae7f5cd3e2bb24b413e09aa844554d234",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/Model/RaiseStrong.lean | ConNF.Model.RaiseStrong | ConNF.Model.RaiseStrong.jsonl | {
"lineInFile": 699,
"tokenPositionInFile": 34619,
"theoremPositionInFile": 13
} | {
"inFilePremises": true,
"numInFilePremises": 1,
"repositoryPremises": true,
"numRepositoryPremises": 46,
"numPremises": 83
} | {
"hasProof": true,
"proof": ":= by\n rw [Support.spec_eq_spec_iff]\n apply sameSpec_antisymm\n · have := sameSpecLe_of_fixes S hS T 1 ρ hγ ?_ hρ\n · simp only [allPermForget_one, one_smul, smul_add] at this\n exact this\n · simp only [allPermForget_one, one_smul]\n · have := sameSpecLe_of_fixes S hS T ρ 1 hγ hρ ?_\n · simp only [allPermForget_one, one_smul, smul_add] at this\n exact this\n · simp only [allPermForget_one, one_smul]",
"proofType": "tactic",
"proofLengthLines": 10,
"proofLengthTokens": 421
} |
import ConNF.Model.Hailperin
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
theorem ext (x y : TSet α) :
(∀ z : TSet β, z ∈' x ↔ z ∈' y) → x = y :=
tSet_ext' hβ x y
def inter (x y : TSet α) : TSet α :=
(TSet.exists_inter hβ x y).choose
notation:69 x:69 " ⊓[" h "] " y:69 => _root_.ConNF.inter h x y
notation:69 x:69 " ⊓' " y:69 => x ⊓[by assumption] y
@[simp]
theorem mem_inter_iff (x y : TSet α) :
∀ z : TSet β, z ∈' x ⊓' y ↔ z ∈' x ∧ z ∈' y :=
(TSet.exists_inter hβ x y).choose_spec
def compl (x : TSet α) : TSet α :=
(TSet.exists_compl hβ x).choose
notation:1024 x:1024 " ᶜ[" h "]" => _root_.ConNF.compl h x
notation:1024 x:1024 " ᶜ'" => xᶜ[by assumption]
@[simp]
theorem mem_compl_iff (x : TSet α) :
∀ z : TSet β, z ∈' xᶜ' ↔ ¬z ∈' x :=
(TSet.exists_compl hβ x).choose_spec
notation:1024 "{" x "}[" h "]" => _root_.ConNF.singleton h x
notation:1024 "{" x "}'" => {x}[by assumption]
@[simp]
theorem mem_singleton_iff (x y : TSet β) :
y ∈' {x}' ↔ y = x :=
typedMem_singleton_iff' hβ x y
notation:1024 "{" x ", " y "}[" h "]" => _root_.ConNF.TSet.up h x y
notation:1024 "{" x ", " y "}'" => {x, y}[by assumption]
@[simp]
theorem mem_up_iff (x y z : TSet β) :
z ∈' {x, y}' ↔ z = x ∨ z = y :=
TSet.mem_up_iff hβ x y z
notation:1024 "⟨" x ", " y "⟩[" h ", " h' "]" => _root_.ConNF.TSet.op h h' x y
notation:1024 "⟨" x ", " y "⟩'" => ⟨x, y⟩[by assumption, by assumption]
theorem op_def (x y : TSet γ) :
(⟨x, y⟩' : TSet α) = { {x}', {x, y}' }' :=
rfl
def singletonImage' (x : TSet β) : TSet α :=
(TSet.exists_singletonImage hβ hγ hδ hε x).choose
@[simp]
theorem singletonImage'_spec (x : TSet β) :
∀ z w,
⟨ {z}', {w}' ⟩' ∈' singletonImage' hβ hγ hδ hε x ↔ ⟨z, w⟩' ∈' x :=
(TSet.exists_singletonImage hβ hγ hδ hε x).choose_spec
def insertion2' (x : TSet γ) : TSet α :=
(TSet.exists_insertion2 hβ hγ hδ hε hζ x).choose
@[simp]
theorem insertion2'_spec (x : TSet γ) :
∀ a b c, ⟨ { {a}' }', ⟨b, c⟩' ⟩' ∈' insertion2' hβ hγ hδ hε hζ x ↔
⟨a, c⟩' ∈' x :=
(TSet.exists_insertion2 hβ hγ hδ hε hζ x).choose_spec
def insertion3' (x : TSet γ) : TSet α :=
(TSet.exists_insertion3 hβ hγ hδ hε hζ x).choose
theorem insertion3'_spec (x : TSet γ) :
∀ a b c, ⟨ { {a}' }', ⟨b, c⟩' ⟩' ∈' insertion3' hβ hγ hδ hε hζ x ↔
⟨a, b⟩' ∈' x :=
(TSet.exists_insertion3 hβ hγ hδ hε hζ x).choose_spec
def vCross (x : TSet γ) : TSet α :=
(TSet.exists_cross hβ hγ hδ x).choose
| @[simp]
theorem vCross_spec (x : TSet γ) :
∀ a, a ∈' vCross hβ hγ hδ x ↔ ∃ b c, a = ⟨b, c⟩' ∧ c ∈' x | ConNF.vCross_spec | {
"commit": "b12701769822aaf5451982e26d7b7d1c2f21b137",
"date": "2024-04-11T00:00:00"
} | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | ConNF/ConNF/Model/Result.lean | ConNF.Model.Result | ConNF.Model.Result.jsonl | {
"lineInFile": 101,
"tokenPositionInFile": 2742,
"theoremPositionInFile": 25
} | {
"inFilePremises": true,
"numInFilePremises": 1,
"repositoryPremises": true,
"numRepositoryPremises": 12,
"numPremises": 27
} | {
"hasProof": true,
"proof": ":=\n (TSet.exists_cross hβ hγ hδ x).choose_spec",
"proofType": "term",
"proofLengthLines": 1,
"proofLengthTokens": 47
} |
import ConNF.Model.Result
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
def union (x y : TSet α) : TSet α :=
(xᶜ' ⊓' yᶜ')ᶜ'
notation:68 x:68 " ⊔[" h "] " y:68 => _root_.ConNF.union h x y
notation:68 x:68 " ⊔' " y:68 => x ⊔[by assumption] y
@[simp]
theorem mem_union_iff (x y : TSet α) :
∀ z : TSet β, z ∈' x ⊔' y ↔ z ∈' x ∨ z ∈' y := by
rw [union]
intro z
rw [mem_compl_iff, mem_inter_iff, mem_compl_iff, mem_compl_iff, or_iff_not_and_not]
def higherIndex (α : Λ) : Λ :=
(exists_gt α).choose
theorem lt_higherIndex {α : Λ} :
(α : TypeIndex) < higherIndex α :=
WithBot.coe_lt_coe.mpr (exists_gt α).choose_spec
theorem tSet_nonempty (h : ∃ β : Λ, (β : TypeIndex) < α) : Nonempty (TSet α) := by
obtain ⟨α', hα⟩ := h
constructor
apply typeLower lt_higherIndex lt_higherIndex lt_higherIndex hα
apply cardinalOne lt_higherIndex lt_higherIndex
def empty : TSet α :=
(tSet_nonempty ⟨β, hβ⟩).some ⊓' (tSet_nonempty ⟨β, hβ⟩).someᶜ'
@[simp]
theorem mem_empty_iff :
∀ x : TSet β, ¬x ∈' empty hβ := by
intro x
rw [empty, mem_inter_iff, mem_compl_iff]
exact and_not_self
def univ : TSet α :=
(empty hβ)ᶜ'
@[simp]
theorem mem_univ_iff :
∀ x : TSet β, x ∈' univ hβ := by
intro x
simp only [univ, mem_compl_iff, mem_empty_iff, not_false_eq_true]
/-- The set of all ordered pairs. -/
def orderedPairs : TSet α :=
vCross hβ hγ hδ (univ hδ)
@[simp]
theorem mem_orderedPairs_iff (x : TSet β) :
x ∈' orderedPairs hβ hγ hδ ↔ ∃ a b, x = ⟨a, b⟩' := by
simp only [orderedPairs, vCross_spec, mem_univ_iff, and_true]
def converse (x : TSet α) : TSet α :=
converse' hβ hγ hδ x ⊓' orderedPairs hβ hγ hδ
@[simp]
theorem op_mem_converse_iff (x : TSet α) :
∀ a b, ⟨a, b⟩' ∈' converse hβ hγ hδ x ↔ ⟨b, a⟩' ∈' x := by
intro a b
simp only [converse, mem_inter_iff, converse'_spec, mem_orderedPairs_iff, op_inj, exists_and_left,
exists_eq', and_true]
def cross (x y : TSet γ) : TSet α :=
converse hβ hγ hδ (vCross hβ hγ hδ x) ⊓' vCross hβ hγ hδ y
@[simp]
theorem mem_cross_iff (x y : TSet γ) :
∀ a, a ∈' cross hβ hγ hδ x y ↔ ∃ b c, a = ⟨b, c⟩' ∧ b ∈' x ∧ c ∈' y := by
intro a
rw [cross, mem_inter_iff, vCross_spec]
constructor
· rintro ⟨h₁, b, c, rfl, h₂⟩
simp only [op_mem_converse_iff, vCross_spec, op_inj] at h₁
obtain ⟨b', c', ⟨rfl, rfl⟩, h₁⟩ := h₁
exact ⟨b, c, rfl, h₁, h₂⟩
· rintro ⟨b, c, rfl, h₁, h₂⟩
simp only [op_mem_converse_iff, vCross_spec, op_inj]
exact ⟨⟨c, b, ⟨rfl, rfl⟩, h₁⟩, ⟨b, c, ⟨rfl, rfl⟩, h₂⟩⟩
def singletonImage (x : TSet β) : TSet α :=
singletonImage' hβ hγ hδ hε x ⊓' (cross hβ hγ hδ (cardinalOne hδ hε) (cardinalOne hδ hε))
@[simp]
theorem singletonImage_spec (x : TSet β) :
∀ z w,
⟨ {z}', {w}' ⟩' ∈' singletonImage hβ hγ hδ hε x ↔ ⟨z, w⟩' ∈' x := by
intro z w
rw [singletonImage, mem_inter_iff, singletonImage'_spec, and_iff_left_iff_imp]
intro hzw
rw [mem_cross_iff]
refine ⟨{z}', {w}', rfl, ?_⟩
simp only [mem_cardinalOne_iff, singleton_inj, exists_eq', and_self]
theorem exists_of_mem_singletonImage {x : TSet β} {z w : TSet δ}
(h : ⟨z, w⟩' ∈' singletonImage hβ hγ hδ hε x) :
∃ a b, z = {a}' ∧ w = {b}' := by
simp only [singletonImage, mem_inter_iff, mem_cross_iff, op_inj, mem_cardinalOne_iff] at h
obtain ⟨-, _, _, ⟨rfl, rfl⟩, ⟨a, rfl⟩, ⟨b, rfl⟩⟩ := h
exact ⟨a, b, rfl, rfl⟩
/-- Turn a model element encoding a relation into an actual relation. -/
def ExternalRel (r : TSet α) : Rel (TSet δ) (TSet δ) :=
λ x y ↦ ⟨x, y⟩' ∈' r
@[simp]
theorem externalRel_converse (r : TSet α) :
ExternalRel hβ hγ hδ (converse hβ hγ hδ r) = (ExternalRel hβ hγ hδ r).inv := by
ext
simp only [ExternalRel, op_mem_converse_iff, Rel.inv_apply]
/-- The codomain of a relation. -/
def codom (r : TSet α) : TSet γ :=
(typeLower lt_higherIndex hβ hγ hδ (singletonImage lt_higherIndex hβ hγ hδ r)ᶜ[lt_higherIndex])ᶜ'
@[simp]
theorem mem_codom_iff (r : TSet α) (x : TSet δ) :
x ∈' codom hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).codom := by
simp only [codom, mem_compl_iff, mem_typeLower_iff, not_forall, not_not]
constructor
· rintro ⟨y, hy⟩
obtain ⟨a, b, rfl, hb⟩ := exists_of_mem_singletonImage lt_higherIndex hβ hγ hδ hy
rw [singleton_inj] at hb
subst hb
rw [singletonImage_spec] at hy
exact ⟨a, hy⟩
· rintro ⟨a, ha⟩
use {a}'
rw [singletonImage_spec]
exact ha
/-- The domain of a relation. -/
def dom (r : TSet α) : TSet γ :=
codom hβ hγ hδ (converse hβ hγ hδ r)
@[simp]
theorem mem_dom_iff (r : TSet α) (x : TSet δ) :
x ∈' dom hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).dom := by
rw [dom, mem_codom_iff, externalRel_converse, Rel.inv_codom]
/-- The field of a relation. -/
def field (r : TSet α) : TSet γ :=
dom hβ hγ hδ r ⊔' codom hβ hγ hδ r
@[simp]
theorem mem_field_iff (r : TSet α) (x : TSet δ) :
x ∈' field hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).field := by
rw [field, mem_union_iff, mem_dom_iff, mem_codom_iff, Rel.field, Set.mem_union]
def subset : TSet α :=
subset' hβ hγ hδ hε ⊓' orderedPairs hβ hγ hδ
@[simp]
theorem subset_spec :
∀ a b, ⟨a, b⟩' ∈' subset hβ hγ hδ hε ↔ a ⊆[TSet ε] b := by
intro a b
simp only [subset, mem_inter_iff, subset'_spec, mem_orderedPairs_iff, op_inj, exists_and_left,
exists_eq', and_true]
def membership : TSet α :=
subset hβ hγ hδ hε ⊓' cross hβ hγ hδ (cardinalOne hδ hε) (univ hδ)
| @[simp]
theorem membership_spec :
∀ a b, ⟨{a}', b⟩' ∈' membership hβ hγ hδ hε ↔ a ∈' b | ConNF.membership_spec | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | {
"commit": "6dd8406a01cc28b071bb26965294469664a1b592",
"date": "2025-01-07T00:00:00"
} | ConNF/ConNF/External/Basic.lean | ConNF.External.Basic | ConNF.External.Basic.jsonl | {
"lineInFile": 186,
"tokenPositionInFile": 5663,
"theoremPositionInFile": 31
} | {
"inFilePremises": true,
"numInFilePremises": 7,
"repositoryPremises": true,
"numRepositoryPremises": 26,
"numPremises": 64
} | {
"hasProof": true,
"proof": ":= by\n intro a b\n rw [membership, mem_inter_iff, subset_spec]\n simp only [mem_cross_iff, op_inj, mem_cardinalOne_iff, mem_univ_iff, and_true, exists_and_right,\n exists_and_left, exists_eq', exists_eq_left', singleton_inj]\n constructor\n · intro h\n exact h a ((typedMem_singleton_iff' hε a a).mpr rfl)\n · intro h c hc\n simp only [typedMem_singleton_iff'] at hc\n cases hc\n exact h",
"proofType": "tactic",
"proofLengthLines": 11,
"proofLengthTokens": 398
} |
import ConNF.ModelData.PathEnumeration
/-!
# Supports
In this file, we define the notion of a support.
## Main declarations
* `ConNF.BaseSupport`: The type of supports of atoms.
* `ConNF.Support`: The type of supports of objects of arbitrary type indices.
-/
universe u
open Cardinal
namespace ConNF
variable [Params.{u}]
/-!
## Base supports
-/
structure BaseSupport where
atoms : Enumeration Atom
nearLitters : Enumeration NearLitter
namespace BaseSupport
instance : SuperA BaseSupport (Enumeration Atom) where
superA := atoms
instance : SuperN BaseSupport (Enumeration NearLitter) where
superN := nearLitters
@[simp]
theorem mk_atoms {a : Enumeration Atom} {N : Enumeration NearLitter} :
(BaseSupport.mk a N)ᴬ = a :=
rfl
@[simp]
theorem mk_nearLitters {a : Enumeration Atom} {N : Enumeration NearLitter} :
(BaseSupport.mk a N)ᴺ = N :=
rfl
theorem atoms_congr {S T : BaseSupport} (h : S = T) :
Sᴬ = Tᴬ :=
h ▸ rfl
theorem nearLitters_congr {S T : BaseSupport} (h : S = T) :
Sᴺ = Tᴺ :=
h ▸ rfl
@[ext]
theorem ext {S T : BaseSupport} (h₁ : Sᴬ = Tᴬ) (h₂ : Sᴺ = Tᴺ) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
cases h₁
cases h₂
rfl
instance : SMul BasePerm BaseSupport where
smul π S := ⟨π • Sᴬ, π • Sᴺ⟩
@[simp]
theorem smul_atoms (π : BasePerm) (S : BaseSupport) :
(π • S)ᴬ = π • Sᴬ :=
rfl
@[simp]
theorem smul_nearLitters (π : BasePerm) (S : BaseSupport) :
(π • S)ᴺ = π • Sᴺ :=
rfl
@[simp]
theorem smul_atoms_eq_of_smul_eq {π : BasePerm} {S : BaseSupport}
(h : π • S = S) :
π • Sᴬ = Sᴬ := by
rw [← smul_atoms, h]
@[simp]
theorem smul_nearLitters_eq_of_smul_eq {π : BasePerm} {S : BaseSupport}
(h : π • S = S) :
π • Sᴺ = Sᴺ := by
rw [← smul_nearLitters, h]
instance : MulAction BasePerm BaseSupport where
one_smul S := by
apply ext
· rw [smul_atoms, one_smul]
· rw [smul_nearLitters, one_smul]
mul_smul π₁ π₂ S := by
apply ext
· rw [smul_atoms, smul_atoms, smul_atoms, mul_smul]
· rw [smul_nearLitters, smul_nearLitters, smul_nearLitters, mul_smul]
theorem smul_eq_smul_iff (π₁ π₂ : BasePerm) (S : BaseSupport) :
π₁ • S = π₂ • S ↔ (∀ a ∈ Sᴬ, π₁ • a = π₂ • a) ∧ (∀ N ∈ Sᴺ, π₁ • N = π₂ • N) := by
constructor
· intro h
constructor
· rintro a ⟨i, ha⟩
have := congr_arg (·ᴬ.rel i (π₁ • a)) h
simp only [smul_atoms, Enumeration.smul_rel, inv_smul_smul, eq_iff_iff] at this
have := Sᴬ.rel_coinjective.coinjective ha (this.mp ha)
rw [eq_inv_smul_iff] at this
rw [this]
· rintro N ⟨i, hN⟩
have := congr_arg (·ᴺ.rel i (π₁ • N)) h
simp only [smul_nearLitters, Enumeration.smul_rel, inv_smul_smul, eq_iff_iff] at this
have := Sᴺ.rel_coinjective.coinjective hN (this.mp hN)
rw [eq_inv_smul_iff] at this
rw [this]
· intro h
ext : 2
· rfl
· ext i a : 3
rw [smul_atoms, smul_atoms, Enumeration.smul_rel, Enumeration.smul_rel]
constructor
· intro ha
have := h.1 _ ⟨i, ha⟩
rw [smul_inv_smul, ← inv_smul_eq_iff] at this
rwa [this]
· intro ha
have := h.1 _ ⟨i, ha⟩
rw [smul_inv_smul, smul_eq_iff_eq_inv_smul] at this
rwa [← this]
· rfl
· ext i a : 3
rw [smul_nearLitters, smul_nearLitters, Enumeration.smul_rel, Enumeration.smul_rel]
constructor
· intro hN
have := h.2 _ ⟨i, hN⟩
rw [smul_inv_smul, ← inv_smul_eq_iff] at this
rwa [this]
· intro hN
have := h.2 _ ⟨i, hN⟩
rw [smul_inv_smul, smul_eq_iff_eq_inv_smul] at this
rwa [← this]
theorem smul_eq_iff (π : BasePerm) (S : BaseSupport) :
π • S = S ↔ (∀ a ∈ Sᴬ, π • a = a) ∧ (∀ N ∈ Sᴺ, π • N = N) := by
have := smul_eq_smul_iff π 1 S
simp only [one_smul] at this
exact this
noncomputable instance : Add BaseSupport where
add S T := ⟨Sᴬ + Tᴬ, Sᴺ + Tᴺ⟩
@[simp]
theorem add_atoms (S T : BaseSupport) :
(S + T)ᴬ = Sᴬ + Tᴬ :=
rfl
@[simp]
theorem add_nearLitters (S T : BaseSupport) :
(S + T)ᴺ = Sᴺ + Tᴺ :=
rfl
end BaseSupport
def baseSupportEquiv : BaseSupport ≃ Enumeration Atom × Enumeration NearLitter where
toFun S := (Sᴬ, Sᴺ)
invFun S := ⟨S.1, S.2⟩
left_inv _ := rfl
right_inv _ := rfl
theorem card_baseSupport : #BaseSupport = #μ := by
rw [Cardinal.eq.mpr ⟨baseSupportEquiv⟩, mk_prod, lift_id, lift_id,
card_enumeration_eq card_atom, card_enumeration_eq card_nearLitter, mul_eq_self aleph0_lt_μ.le]
/-!
## Structural supports
-/
structure Support (α : TypeIndex) where
atoms : Enumeration (α ↝ ⊥ × Atom)
nearLitters : Enumeration (α ↝ ⊥ × NearLitter)
namespace Support
variable {α β : TypeIndex}
instance : SuperA (Support α) (Enumeration (α ↝ ⊥ × Atom)) where
superA := atoms
instance : SuperN (Support α) (Enumeration (α ↝ ⊥ × NearLitter)) where
superN := nearLitters
@[simp]
theorem mk_atoms (E : Enumeration (α ↝ ⊥ × Atom)) (F : Enumeration (α ↝ ⊥ × NearLitter)) :
(⟨E, F⟩ : Support α)ᴬ = E :=
rfl
@[simp]
theorem mk_nearLitters (E : Enumeration (α ↝ ⊥ × Atom)) (F : Enumeration (α ↝ ⊥ × NearLitter)) :
(⟨E, F⟩ : Support α)ᴺ = F :=
rfl
instance : Derivative (Support α) (Support β) α β where
deriv S A := ⟨Sᴬ ⇘ A, Sᴺ ⇘ A⟩
instance : Coderivative (Support β) (Support α) α β where
coderiv S A := ⟨Sᴬ ⇗ A, Sᴺ ⇗ A⟩
instance : BotDerivative (Support α) BaseSupport α where
botDeriv S A := ⟨Sᴬ ⇘. A, Sᴺ ⇘. A⟩
botSderiv S := ⟨Sᴬ ↘., Sᴺ ↘.⟩
botDeriv_single S h := by dsimp only; rw [botDeriv_single, botDeriv_single]
@[simp]
theorem deriv_atoms {α β : TypeIndex} (S : Support α) (A : α ↝ β) :
Sᴬ ⇘ A = (S ⇘ A)ᴬ :=
rfl
@[simp]
theorem deriv_nearLitters {α β : TypeIndex} (S : Support α) (A : α ↝ β) :
Sᴺ ⇘ A = (S ⇘ A)ᴺ :=
rfl
@[simp]
theorem sderiv_atoms {α β : TypeIndex} (S : Support α) (h : β < α) :
Sᴬ ↘ h = (S ↘ h)ᴬ :=
rfl
@[simp]
theorem sderiv_nearLitters {α β : TypeIndex} (S : Support α) (h : β < α) :
Sᴺ ↘ h = (S ↘ h)ᴺ :=
rfl
@[simp]
theorem coderiv_atoms {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
Sᴬ ⇗ A = (S ⇗ A)ᴬ :=
rfl
@[simp]
theorem coderiv_nearLitters {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
Sᴺ ⇗ A = (S ⇗ A)ᴺ :=
rfl
@[simp]
theorem scoderiv_atoms {α β : TypeIndex} (S : Support β) (h : β < α) :
Sᴬ ↗ h = (S ↗ h)ᴬ :=
rfl
@[simp]
theorem scoderiv_nearLitters {α β : TypeIndex} (S : Support β) (h : β < α) :
Sᴺ ↗ h = (S ↗ h)ᴺ :=
rfl
@[simp]
theorem derivBot_atoms {α : TypeIndex} (S : Support α) (A : α ↝ ⊥) :
Sᴬ ⇘. A = (S ⇘. A)ᴬ :=
rfl
| @[simp]
theorem derivBot_nearLitters {α : TypeIndex} (S : Support α) (A : α ↝ ⊥) :
Sᴺ ⇘. A = (S ⇘. A)ᴺ | ConNF.Support.derivBot_nearLitters | {
"commit": "39c33b4a743bea62dbcc549548b712ffd38ca65c",
"date": "2024-12-05T00:00:00"
} | {
"commit": "d9f28df240ac4df047c3af0d236aed2e437e571f",
"date": "2025-01-07T00:00:00"
} | ConNF/ConNF/ModelData/Support.lean | ConNF.ModelData.Support | ConNF.ModelData.Support.jsonl | {
"lineInFile": 258,
"tokenPositionInFile": 6529,
"theoremPositionInFile": 25
} | {
"inFilePremises": true,
"numInFilePremises": 5,
"repositoryPremises": true,
"numRepositoryPremises": 14,
"numPremises": 19
} | {
"hasProof": true,
"proof": ":=\n rfl",
"proofType": "term",
"proofLengthLines": 1,
"proofLengthTokens": 8
} |
import ConNF.ModelData.Enumeration
import ConNF.Levels.StrPerm
/-!
# Enumerations over paths
In this file, we provide extra features to `Enumeration`s that take values of the form `α ↝ ⊥ × X`.
## Main declarations
* `ConNF.Enumeration.ext_path`: An extensionality principle for such `Enumeration`s.
-/
noncomputable section
universe u
open Cardinal Ordinal
namespace ConNF
variable [Params.{u}]
namespace Enumeration
/-- A helper function for making relations with domain and codomain of the form `α ↝ ⊥ × X`
by defining it on each branch. -/
def relWithPath {X Y : Type u} {α : TypeIndex} (f : α ↝ ⊥ → Rel X Y) :
Rel (α ↝ ⊥ × X) (α ↝ ⊥ × Y) :=
λ x y ↦ x.1 = y.1 ∧ f x.1 x.2 y.2
theorem relWithPath_coinjective {X Y : Type u} {α : TypeIndex} {f : α ↝ ⊥ → Rel X Y}
(hf : ∀ A, (f A).Coinjective) :
(relWithPath f).Coinjective := by
constructor
rintro ⟨_, y₁⟩ ⟨_, y₂⟩ ⟨A, x⟩ ⟨rfl, h₁⟩ ⟨rfl, h₂⟩
cases (hf A).coinjective h₁ h₂
rfl
instance (X : Type u) (α β : TypeIndex) :
Derivative (Enumeration (α ↝ ⊥ × X)) (Enumeration (β ↝ ⊥ × X)) α β where
deriv E A := E.invImage (λ x ↦ (x.1 ⇗ A, x.2))
(λ x y h ↦ Prod.ext (Path.deriv_right_injective
((Prod.mk.injEq _ _ _ _).mp h).1) ((Prod.mk.injEq _ _ _ _).mp h).2)
theorem deriv_rel {X : Type _} {α β : TypeIndex} (E : Enumeration (α ↝ ⊥ × X)) (A : α ↝ β)
(i : κ) (x : β ↝ ⊥ × X) :
(E ⇘ A).rel i x ↔ E.rel i (x.1 ⇗ A, x.2) :=
Iff.rfl
instance (X : Type u) (α β : TypeIndex) :
Coderivative (Enumeration (β ↝ ⊥ × X)) (Enumeration (α ↝ ⊥ × X)) α β where
coderiv E A := E.image (λ x ↦ (x.1 ⇗ A, x.2))
theorem coderiv_rel {X : Type _} {α β : TypeIndex} (E : Enumeration (β ↝ ⊥ × X)) (A : α ↝ β)
(i : κ) (x : α ↝ ⊥ × X) :
(E ⇗ A).rel i x ↔ ∃ B, x.1 = A ⇘ B ∧ E.rel i (B, x.2) := by
constructor
· rintro ⟨x, h, rfl⟩
exact ⟨_, rfl, h⟩
· rintro ⟨B, h₁, h₂⟩
refine ⟨(B, x.2), h₂, ?_⟩
apply Prod.ext
· dsimp only
exact h₁.symm
· rfl
theorem scoderiv_rel {X : Type _} {α β : TypeIndex} (E : Enumeration (β ↝ ⊥ × X)) (h : β < α)
(i : κ) (x : α ↝ ⊥ × X) :
(E ↗ h).rel i x ↔ ∃ B, x.1 = B ↗ h ∧ E.rel i (B, x.2) :=
coderiv_rel E (.single h) i x
theorem eq_of_scoderiv_mem {X : Type _} {α β γ : TypeIndex} (E : Enumeration (β ↝ ⊥ × X))
(h : β < α) (h' : γ < α)
(i : κ) (A : γ ↝ ⊥) (x : X) (h : (E ↗ h).rel i ⟨A ↗ h', x⟩) :
β = γ := by
rw [scoderiv_rel] at h
obtain ⟨B, h₁, h₂⟩ := h
exact Path.scoderiv_index_injective h₁.symm
instance (X : Type u) (α : TypeIndex) :
BotDerivative (Enumeration (α ↝ ⊥ × X)) (Enumeration X) α where
botDeriv E A := E.invImage (λ x ↦ (A, x)) (Prod.mk.inj_left A)
botSderiv E := E.invImage (λ x ↦ (Path.nil ↘., x)) (Prod.mk.inj_left (Path.nil ↘.))
botDeriv_single E h := by
cases α using WithBot.recBotCoe with
| bot => cases lt_irrefl ⊥ h
| coe => rfl
theorem derivBot_rel {X : Type _} {α : TypeIndex} (E : Enumeration (α ↝ ⊥ × X)) (A : α ↝ ⊥)
(i : κ) (x : X) :
(E ⇘. A).rel i x ↔ E.rel i (A, x) :=
Iff.rfl
@[simp]
theorem mem_path_iff {X : Type _} {α : TypeIndex} (E : Enumeration (α ↝ ⊥ × X))
(A : α ↝ ⊥) (x : X) :
(A, x) ∈ E ↔ x ∈ E ⇘. A :=
Iff.rfl
theorem ext_path {X : Type u} {α : TypeIndex} {E F : Enumeration (α ↝ ⊥ × X)}
(h : ∀ A, E ⇘. A = F ⇘. A) :
E = F := by
ext i x
· have := congr_arg bound (h (Path.nil ↘.))
exact this
· have := congr_arg rel (h x.1)
exact iff_of_eq (congr_fun₂ this i x.2)
theorem deriv_derivBot {X : Type _} {α β : TypeIndex} (E : Enumeration (α ↝ ⊥ × X))
(A : α ↝ β) (B : β ↝ ⊥) :
E ⇘ A ⇘. B = E ⇘. (A ⇘ B) :=
rfl
@[simp]
theorem coderiv_deriv_eq {X : Type _} {α β : TypeIndex} (E : Enumeration (β ↝ ⊥ × X)) (A : α ↝ β) :
E ⇗ A ⇘ A = E := by
apply ext_path
intro B
ext i x
· rfl
· simp only [derivBot_rel, deriv_rel, coderiv_rel,
Path.coderiv_eq_deriv, Path.deriv_right_inj, exists_eq_left']
theorem eq_of_mem_scoderiv_botDeriv {X : Type _} {α β : TypeIndex} {S : Enumeration (β ↝ ⊥ × X)}
{A : α ↝ ⊥} {h : β < α} {x : X} (hx : x ∈ S ↗ h ⇘. A) :
∃ B : β ↝ ⊥, A = B ↗ h := by
obtain ⟨i, ⟨B, y⟩, hi₁, hi₂⟩ := hx
cases hi₂
exact ⟨B, rfl⟩
| @[simp]
theorem scoderiv_botDeriv_eq {X : Type _} {α β : TypeIndex} (S : Enumeration (β ↝ ⊥ × X))
(A : β ↝ ⊥) (h : β < α) :
S ↗ h ⇘. (A ↗ h) = S ⇘. A | ConNF.Enumeration.scoderiv_botDeriv_eq | {
"commit": "39c33b4a743bea62dbcc549548b712ffd38ca65c",
"date": "2024-12-05T00:00:00"
} | {
"commit": "ce890707e37ede74a2fcd66134d3f403335c5cc1",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/ModelData/PathEnumeration.lean | ConNF.ModelData.PathEnumeration | ConNF.ModelData.PathEnumeration.jsonl | {
"lineInFile": 131,
"tokenPositionInFile": 4177,
"theoremPositionInFile": 12
} | {
"inFilePremises": true,
"numInFilePremises": 4,
"repositoryPremises": true,
"numRepositoryPremises": 20,
"numPremises": 49
} | {
"hasProof": true,
"proof": ":= by\n ext i x\n · rfl\n · simp only [derivBot_rel, scoderiv_rel, Path.scoderiv_left_inj, exists_eq_left']",
"proofType": "tactic",
"proofLengthLines": 3,
"proofLengthTokens": 107
} |
import ConNF.Model.Hailperin
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
theorem ext (x y : TSet α) :
(∀ z : TSet β, z ∈' x ↔ z ∈' y) → x = y :=
tSet_ext' hβ x y
def inter (x y : TSet α) : TSet α :=
(TSet.exists_inter hβ x y).choose
notation:69 x:69 " ⊓[" h "] " y:69 => _root_.ConNF.inter h x y
notation:69 x:69 " ⊓' " y:69 => x ⊓[by assumption] y
@[simp]
theorem mem_inter_iff (x y : TSet α) :
∀ z : TSet β, z ∈' x ⊓' y ↔ z ∈' x ∧ z ∈' y :=
(TSet.exists_inter hβ x y).choose_spec
def compl (x : TSet α) : TSet α :=
(TSet.exists_compl hβ x).choose
notation:1024 x:1024 " ᶜ[" h "]" => _root_.ConNF.compl h x
notation:1024 x:1024 " ᶜ'" => xᶜ[by assumption]
@[simp]
theorem mem_compl_iff (x : TSet α) :
∀ z : TSet β, z ∈' xᶜ' ↔ ¬z ∈' x :=
(TSet.exists_compl hβ x).choose_spec
notation:1024 "{" x "}[" h "]" => _root_.ConNF.singleton h x
notation:1024 "{" x "}'" => {x}[by assumption]
@[simp]
theorem mem_singleton_iff (x y : TSet β) :
y ∈' {x}' ↔ y = x :=
typedMem_singleton_iff' hβ x y
notation:1024 "{" x ", " y "}[" h "]" => _root_.ConNF.TSet.up h x y
notation:1024 "{" x ", " y "}'" => {x, y}[by assumption]
@[simp]
theorem mem_up_iff (x y z : TSet β) :
z ∈' {x, y}' ↔ z = x ∨ z = y :=
TSet.mem_up_iff hβ x y z
notation:1024 "⟨" x ", " y "⟩[" h ", " h' "]" => _root_.ConNF.TSet.op h h' x y
notation:1024 "⟨" x ", " y "⟩'" => ⟨x, y⟩[by assumption, by assumption]
theorem op_def (x y : TSet γ) :
(⟨x, y⟩' : TSet α) = { {x}', {x, y}' }' :=
rfl
def singletonImage' (x : TSet β) : TSet α :=
(TSet.exists_singletonImage hβ hγ hδ hε x).choose
@[simp]
theorem singletonImage'_spec (x : TSet β) :
∀ z w,
⟨ {z}', {w}' ⟩' ∈' singletonImage' hβ hγ hδ hε x ↔ ⟨z, w⟩' ∈' x :=
(TSet.exists_singletonImage hβ hγ hδ hε x).choose_spec
def insertion2' (x : TSet γ) : TSet α :=
(TSet.exists_insertion2 hβ hγ hδ hε hζ x).choose
| @[simp]
theorem insertion2'_spec (x : TSet γ) :
∀ a b c, ⟨ { {a}' }', ⟨b, c⟩' ⟩' ∈' insertion2' hβ hγ hδ hε hζ x ↔
⟨a, c⟩' ∈' x | ConNF.insertion2'_spec | {
"commit": "b12701769822aaf5451982e26d7b7d1c2f21b137",
"date": "2024-04-11T00:00:00"
} | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | ConNF/ConNF/Model/Result.lean | ConNF.Model.Result | ConNF.Model.Result.jsonl | {
"lineInFile": 84,
"tokenPositionInFile": 2188,
"theoremPositionInFile": 21
} | {
"inFilePremises": true,
"numInFilePremises": 1,
"repositoryPremises": true,
"numRepositoryPremises": 13,
"numPremises": 25
} | {
"hasProof": true,
"proof": ":=\n (TSet.exists_insertion2 hβ hγ hδ hε hζ x).choose_spec",
"proofType": "term",
"proofLengthLines": 1,
"proofLengthTokens": 58
} |
import ConNF.External.Basic
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
/-- A set in our model that is a well-order. Internal well-orders are exactly external well-orders,
so we externalise the definition for convenience. -/
def InternalWellOrder (r : TSet α) : Prop :=
IsWellOrder (ExternalRel hβ hγ hδ r).field
(InvImage (ExternalRel hβ hγ hδ r) Subtype.val)
def InternallyWellOrdered (x : TSet γ) : Prop :=
{y : TSet δ | y ∈' x}.Subsingleton ∨ (∃ r, InternalWellOrder hβ hγ hδ r ∧ x = field hβ hγ hδ r)
@[simp]
theorem externalRel_smul (r : TSet α) (ρ : AllPerm α) :
ExternalRel hβ hγ hδ (ρ • r) =
InvImage (ExternalRel hβ hγ hδ r) ((ρ ↘ hβ ↘ hγ ↘ hδ)⁻¹ • ·) := by
ext a b
simp only [ExternalRel, mem_smul_iff', allPerm_inv_sderiv', smul_op, InvImage]
omit [Params] in
/-- Well-orders are rigid. -/
theorem apply_eq_of_isWellOrder {X : Type _} {r : Rel X X} {f : X → X}
(hr : IsWellOrder X r) (hf : Function.Bijective f) (hf' : ∀ x y, r x y ↔ r (f x) (f y)) :
∀ x, f x = x := by
let emb : r ≼i r := ⟨⟨⟨f, hf.injective⟩, λ {a b} ↦ (hf' a b).symm⟩, ?_⟩
· have : emb = InitialSeg.refl r := Subsingleton.elim _ _
intro x
exact congr_arg (λ f ↦ f x) this
· intro a b h
exact hf.surjective _
omit [Params] in
theorem apply_eq_of_isWellOrder' {X : Type _} {r : Rel X X} {f : X → X}
(hr : IsWellOrder r.field (InvImage r Subtype.val)) (hf : Function.Bijective f)
(hf' : ∀ x y, r x y ↔ r (f x) (f y)) :
∀ x ∈ r.field, f x = x := by
have : ∀ x ∈ r.field, f x ∈ r.field := by
rintro x (⟨y, h⟩ | ⟨y, h⟩)
· exact Or.inl ⟨f y, (hf' x y).mp h⟩
· exact Or.inr ⟨f y, (hf' y x).mp h⟩
have := apply_eq_of_isWellOrder (f := λ x ↦ ⟨f x.val, this x.val x.prop⟩) hr ⟨?_, ?_⟩ ?_
· intro x hx
exact congr_arg Subtype.val (this ⟨x, hx⟩)
· intro x y h
rw [Subtype.mk.injEq] at h
exact Subtype.val_injective (hf.injective h)
· intro x
obtain ⟨y, hy⟩ := hf.surjective x.val
refine ⟨⟨y, ?_⟩, ?_⟩
· obtain (⟨z, h⟩ | ⟨z, h⟩) := x.prop <;>
rw [← hy] at h <;>
obtain ⟨z, rfl⟩ := hf.surjective z
· exact Or.inl ⟨z, (hf' y z).mpr h⟩
· exact Or.inr ⟨z, (hf' z y).mpr h⟩
· simp only [hy]
· intros
apply hf'
theorem exists_common_support_of_internallyWellOrdered' {x : TSet δ}
(h : InternallyWellOrdered hγ hδ hε x) :
∃ S : Support β, ∀ y, y ∈' x → S.Supports { { {y}' }' }[hγ] := by
obtain (h | ⟨r, h, rfl⟩) := h
· obtain (h | ⟨y, hy⟩) := h.eq_empty_or_singleton
· use ⟨Enumeration.empty, Enumeration.empty⟩
intro y hy
rw [Set.eq_empty_iff_forall_not_mem] at h
cases h y hy
· obtain ⟨S, hS⟩ := TSet.exists_support y
use S ↗ hε ↗ hδ ↗ hγ
intro z hz
rw [Set.eq_singleton_iff_unique_mem] at hy
cases hy.2 z hz
refine ⟨?_, λ h ↦ by cases h⟩
intro ρ hρ
simp only [Support.smul_scoderiv, ← allPermSderiv_forget', Support.scoderiv_inj] at hρ
simp only [smul_singleton, singleton_inj]
exact hS _ hρ
obtain ⟨S, hS⟩ := TSet.exists_support r
use S
intro a ha
refine ⟨?_, λ h ↦ by cases h⟩
intro ρ hρ
have := hS ρ hρ
simp only [smul_singleton, singleton_inj]
apply apply_eq_of_isWellOrder' (r := ExternalRel hγ hδ hε r)
· exact h
· exact MulAction.bijective (ρ ↘ hγ ↘ hδ ↘ hε)
· intro x y
conv_rhs => rw [← this]
simp only [externalRel_smul, InvImage, inv_smul_smul]
· rwa [mem_field_iff] at ha
include hγ in
theorem Support.Supports.ofSingleton {S : Support α} {x : TSet β}
(h : S.Supports {x}') :
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
(S.strong ↘ hβ).Supports x := by
refine ⟨?_, λ h ↦ by cases h⟩
intro ρ hρ
open scoped Pointwise in
have := sUnion_singleton_symmetric_aux hγ hβ {y | y ∈' x} S ?_ ρ hρ
· apply ConNF.ext hγ
intro z
simp only [Set.ext_iff, Set.mem_setOf_eq, Set.mem_smul_set_iff_inv_smul_mem] at this
rw [mem_smul_iff', allPerm_inv_sderiv', this]
· intro ρ hρ
ext z
simp only [Set.mem_smul_set_iff_inv_smul_mem, Set.mem_image, Set.mem_setOf_eq]
have := h.supports ρ hρ
simp only [smul_singleton, singleton_inj] at this
constructor
· rintro ⟨y, h₁, h₂⟩
rw [← smul_eq_iff_eq_inv_smul, smul_singleton] at h₂
refine ⟨_, ?_, h₂⟩
rw [← this]
simp only [mem_smul_iff', allPerm_inv_sderiv', inv_smul_smul]
exact h₁
· rintro ⟨y, h, rfl⟩
refine ⟨(ρ ↘ hβ ↘ hγ)⁻¹ • y, ?_, ?_⟩
· rwa [← allPerm_inv_sderiv', ← mem_smul_iff', this]
· simp only [smul_singleton, allPerm_inv_sderiv']
include hγ in
theorem supports_of_supports_singletons {S : Support α} {s : Set (TSet β)}
(h : ∀ x ∈ s, S.Supports {x}') :
∃ S : Support β, ∀ x ∈ s, S.Supports x :=
⟨_, λ x hx ↦ (h x hx).ofSingleton hβ hγ⟩
| theorem exists_common_support_of_internallyWellOrdered {x : TSet δ}
(h : InternallyWellOrdered hγ hδ hε x) :
∃ S : Support δ, ∀ y, y ∈' x → S.Supports {y}' | ConNF.exists_common_support_of_internallyWellOrdered | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | {
"commit": "1c08486feb882444888c228ce1501e92bb85e0e2",
"date": "2025-01-07T00:00:00"
} | ConNF/ConNF/External/WellOrder.lean | ConNF.External.WellOrder | ConNF.External.WellOrder.jsonl | {
"lineInFile": 149,
"tokenPositionInFile": 5069,
"theoremPositionInFile": 8
} | {
"inFilePremises": true,
"numInFilePremises": 3,
"repositoryPremises": true,
"numRepositoryPremises": 16,
"numPremises": 52
} | {
"hasProof": true,
"proof": ":= by\n obtain ⟨S, hS⟩ := exists_common_support_of_internallyWellOrdered' hγ hδ hε h\n have := supports_of_supports_singletons (S := S)\n (s := singleton hδ '' (singleton hε '' {y | y ∈' x})) hγ hδ ?_\n swap\n · simp only [Set.mem_image, Set.mem_setOf_eq, exists_exists_and_eq_and, forall_exists_index,\n and_imp, forall_apply_eq_imp_iff₂]\n exact hS\n obtain ⟨T, hT⟩ := this\n have := supports_of_supports_singletons (S := T)\n (s := singleton hε '' {y | y ∈' x}) hδ hε ?_\n swap\n · simp only [Set.mem_image, Set.mem_setOf_eq, forall_exists_index, and_imp,\n forall_apply_eq_imp_iff₂] at hT ⊢\n exact hT\n simp only [Set.mem_image, Set.mem_setOf_eq, forall_exists_index, and_imp,\n forall_apply_eq_imp_iff₂] at this\n exact this",
"proofType": "tactic",
"proofLengthLines": 17,
"proofLengthTokens": 752
} |
import ConNF.Model.Externalise
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal
namespace ConNF
variable [Params.{u}] {β γ : Λ} {hγ : (γ : TypeIndex) < β}
namespace Support
theorem not_mem_scoderiv_botDeriv (S : Support γ) (N : NearLitter) :
N ∉ (S ↗ hγ ⇘. (Path.nil ↘.))ᴺ := by
rintro ⟨i, ⟨A, N'⟩, h₁, h₂⟩
simp only [Prod.mk.injEq] at h₂
cases A
case sderiv δ A hδ _ =>
simp only [Path.deriv_sderiv] at h₂
cases A
case nil => cases h₂.1
case sderiv ζ A hζ _ =>
simp only [Path.deriv_sderiv] at h₂
cases h₂.1
variable [Level] [LtLevel β]
theorem not_mem_strong_botDeriv (S : Support γ) (N : NearLitter) :
N ∉ ((S ↗ hγ).strong ⇘. (Path.nil ↘.))ᴺ := by
rintro h
rw [strong, close_nearLitters, preStrong_nearLitters, Enumeration.mem_add_iff] at h
obtain h | h := h
· exact not_mem_scoderiv_botDeriv S N h
· rw [mem_constrainsNearLitters_nearLitters] at h
obtain ⟨B, N', hN', h⟩ := h
cases h using Relation.ReflTransGen.head_induction_on
case refl => exact not_mem_scoderiv_botDeriv S N hN'
case head x hx₁ hx₂ _ =>
obtain ⟨⟨γ, δ, ε, hδ, hε, hδε, A⟩, t, B, hB, hN, ht⟩ := hx₂
simp only at hB
cases B
case nil =>
cases hB
obtain ⟨C, N''⟩ := x
simp only at ht
cases ht.1
change _ ∈ t.supportᴺ at hN
rw [t.support_supports.2 rfl] at hN
obtain ⟨i, hN⟩ := hN
cases hN
case sderiv δ B hδ _ _ =>
cases B
case nil => cases hB
case sderiv ζ B hζ _ _ => cases hB
theorem raise_preStrong' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).PreStrong := by
apply hS.toPreStrong.add
constructor
intro A N hN P t hA ht
obtain ⟨A, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN
simp only [scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, interferenceSupport_nearLitters,
Enumeration.mem_add_iff, Enumeration.mem_smul, Enumeration.not_mem_empty, or_false] at hN
obtain ⟨δ, ε, ζ, hε, hζ, hεζ, B⟩ := P
dsimp only at *
cases A
case sderiv ζ' A hζ' _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_left_inj.mp at hA
cases A
case nil =>
cases hA
cases not_mem_strong_botDeriv T _ hN
case sderiv ι A hι _ _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
cases hA
haveI : LtLevel δ := ⟨A.le.trans_lt LtLevel.elim⟩
haveI : LtLevel ε := ⟨hε.trans LtLevel.elim⟩
haveI : LtLevel ζ := ⟨hζ.trans LtLevel.elim⟩
have := (T ↗ hγ).strong_strong.support_le hN ⟨δ, ε, ζ, hε, hζ, hεζ, A⟩
(ρ⁻¹ ⇘ A ↘ hε • t) rfl ?_
· simp only [Tangle.smul_support, allPermSderiv_forget, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv] at this
have := smul_le_smul this (ρᵁ ⇘ A ↘ hε)
simp only [smul_inv_smul] at this
apply le_trans this
intro B
constructor
· intro a ha
simp only [smul_derivBot, Tree.sderiv_apply, Tree.deriv_apply, Path.deriv_scoderiv,
deriv_derivBot, Enumeration.mem_smul] at ha
rw [deriv_derivBot, ← Path.deriv_scoderiv, Path.coderiv_deriv', scoderiv_botDeriv_eq,]
simp only [Path.deriv_scoderiv, add_derivBot, smul_derivBot,
BaseSupport.add_atoms, BaseSupport.smul_atoms, Enumeration.mem_add_iff,
Enumeration.mem_smul]
exact Or.inl ha
· intro N hN
simp only [smul_derivBot, Tree.sderiv_apply, Tree.deriv_apply, Path.deriv_scoderiv,
deriv_derivBot, Enumeration.mem_smul] at hN
rw [deriv_derivBot, ← Path.deriv_scoderiv, Path.coderiv_deriv', scoderiv_botDeriv_eq,]
simp only [Path.deriv_scoderiv, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul]
exact Or.inl hN
· rw [← smul_fuzz hε hζ hεζ, ← ht]
simp only [Path.botSderiv_coe_eq, BasePerm.smul_nearLitter_litter, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.inv_sderivBot]
rfl
theorem raise_closed' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β)
(hρ : ρᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).Closed := by
constructor
intro A
constructor
intro N₁ N₂ hN₁ hN₂ a ha
simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff,
BaseSupport.add_atoms] at hN₁ hN₂ ⊢
obtain hN₁ | hN₁ := hN₁
· obtain hN₂ | hN₂ := hN₂
· exact Or.inl ((hS.closed A).interference_subset hN₁ hN₂ a ha)
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN₂
simp only [smul_add, scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul, BaseSupport.add_atoms, BaseSupport.smul_atoms] at hN₁ hN₂ ⊢
refine Or.inr (Or.inr ?_)
rw [mem_interferenceSupport_atoms]
refine ⟨(ρᵁ B)⁻¹ • N₁, ?_, (ρᵁ B)⁻¹ • N₂, ?_, ?_⟩
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
rw [← Enumeration.mem_smul, ← BaseSupport.smul_nearLitters, ← smul_derivBot, hρ]
exact Or.inl hN₁
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₂
exact Or.inr hN₂
· rw [← BasePerm.smul_interference]
exact Set.smul_mem_smul_set ha
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN₁
simp only [smul_add, scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul, BaseSupport.add_atoms, BaseSupport.smul_atoms] at hN₁ hN₂ ⊢
refine Or.inr (Or.inr ?_)
rw [mem_interferenceSupport_atoms]
refine ⟨(ρᵁ B)⁻¹ • N₁, ?_, (ρᵁ B)⁻¹ • N₂, ?_, ?_⟩
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₁
exact Or.inr hN₁
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₂
obtain hN₂ | hN₂ := hN₂
· rw [← Enumeration.mem_smul, ← BaseSupport.smul_nearLitters, ← smul_derivBot, hρ]
exact Or.inl hN₂
· exact Or.inr hN₂
· rw [← BasePerm.smul_interference]
exact Set.smul_mem_smul_set ha
| theorem raise_strong' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β)
(hρ : ρᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).Strong | ConNF.Support.raise_strong' | {
"commit": "abf71bc79c407ceb462cc2edd2d994cda9cdef05",
"date": "2024-04-04T00:00:00"
} | {
"commit": "6709914ae7f5cd3e2bb24b413e09aa844554d234",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/Model/RaiseStrong.lean | ConNF.Model.RaiseStrong | ConNF.Model.RaiseStrong.jsonl | {
"lineInFile": 174,
"tokenPositionInFile": 7129,
"theoremPositionInFile": 4
} | {
"inFilePremises": true,
"numInFilePremises": 2,
"repositoryPremises": true,
"numRepositoryPremises": 32,
"numPremises": 47
} | {
"hasProof": true,
"proof": ":=\n ⟨raise_preStrong' S hS T ρ hγ, raise_closed' S hS T ρ hγ hρ⟩",
"proofType": "term",
"proofLengthLines": 1,
"proofLengthTokens": 65
} |
import ConNF.Base.TypeIndex
/-!
# Paths of type indices
In this file, we define the notion of a *path*, and the derivative and coderivative operations.
## Main declarations
* `ConNF.Path`: A path of type indices.
* `ConNF.Path.recSderiv`, `ConNF.Path.recSderivLe`, `ConNF.Path.recSderivGlobal`:
Downwards induction principles for paths.
* `ConNF.Path.recScoderiv`: An upwards induction principle for paths.
-/
universe u
open Cardinal WithBot
namespace ConNF
variable [Params.{u}] {α β γ δ : TypeIndex}
/-- A path of type indices starting at `α` and ending at `β` is a finite sequence of type indices
`α > ... > β`. -/
inductive Path (α : TypeIndex) : TypeIndex → Type u
| nil : Path α α
| cons {β γ : TypeIndex} : Path α β → γ < β → Path α γ
@[inherit_doc] infix:70 " ↝ " => Path
def Path.single {α β : TypeIndex} (h : β < α) : α ↝ β :=
.cons .nil h
/-- Typeclass for the `↘` notation. -/
class SingleDerivative (X : Type _) (Y : outParam <| Type _)
(β : outParam TypeIndex) (γ : TypeIndex) where
sderiv : X → γ < β → Y
/-- Typeclass for the `⇘` notation. -/
class Derivative (X : Type _) (Y : outParam <| Type _)
(β : outParam TypeIndex) (γ : TypeIndex) extends SingleDerivative X Y β γ where
deriv : X → β ↝ γ → Y
sderiv x h := deriv x (.single h)
deriv_single : ∀ x : X, ∀ h : γ < β, deriv x (.single h) = sderiv x h := by intros; rfl
/-- Typeclass for the `↘.` notation. -/
class BotSingleDerivative (X : Type _) (Y : outParam <| Type _) where
botSderiv : X → Y
/-- Typeclass for the `⇘.` notation. -/
class BotDerivative (X : Type _) (Y : outParam <| Type _) (β : outParam TypeIndex)
extends BotSingleDerivative X Y where
botDeriv : X → β ↝ ⊥ → Y
/-- We often need to do case analysis on `β` to show that it's a proper type index here.
This case check doesn't need to be done in most actual use cases of the notation. -/
botDeriv_single : ∀ x : X, ∀ h : ⊥ < β, botDeriv x (.single h) = botSderiv x
/-- Typeclass for the `↗` notation. -/
class SingleCoderivative (X : Type _) (Y : outParam <| Type _)
(β : TypeIndex) (γ : outParam TypeIndex) where
scoderiv : X → γ < β → Y
/-- Typeclass for the `⇗` notation. -/
class Coderivative (X : Type _) (Y : outParam <| Type _)
(β : TypeIndex) (γ : outParam TypeIndex) extends SingleCoderivative X Y β γ where
coderiv : X → β ↝ γ → Y
scoderiv x h := coderiv x (.single h)
coderiv_single : ∀ x : X, ∀ h : γ < β, coderiv x (.single h) = scoderiv x h := by intros; rfl
infixl:75 " ↘ " => SingleDerivative.sderiv
infixl:75 " ⇘ " => Derivative.deriv
postfix:75 " ↘." => BotSingleDerivative.botSderiv
infixl:75 " ⇘. " => BotDerivative.botDeriv
infixl:75 " ↗ " => SingleCoderivative.scoderiv
infixl:75 " ⇗ " => Coderivative.coderiv
@[simp]
theorem deriv_single {X Y : Type _} [Derivative X Y β γ] (x : X) (h : γ < β) :
x ⇘ .single h = x ↘ h :=
Derivative.deriv_single x h
@[simp]
theorem coderiv_single {X Y : Type _} [Coderivative X Y β γ] (x : X) (h : γ < β) :
x ⇗ .single h = x ↗ h :=
Coderivative.coderiv_single x h
@[simp]
theorem botDeriv_single {X Y : Type _} [BotDerivative X Y β] (x : X) (h : ⊥ < β) :
x ⇘. .single h = x ↘. :=
BotDerivative.botDeriv_single x h
/-!
## Downwards recursion along paths
-/
instance : SingleDerivative (α ↝ β) (α ↝ γ) β γ where
sderiv := .cons
/-- The downwards recursion principle for paths. -/
@[elab_as_elim, induction_eliminator, cases_eliminator]
def Path.recSderiv {motive : ∀ β, α ↝ β → Sort _}
(nil : motive α .nil)
(sderiv : ∀ β γ (A : α ↝ β) (h : γ < β), motive β A → motive γ (A ↘ h)) :
{β : TypeIndex} → (A : α ↝ β) → motive β A
| _, .nil => nil
| _, .cons A h => sderiv _ _ A h (recSderiv nil sderiv A)
@[simp]
theorem Path.recSderiv_nil {motive : ∀ β, α ↝ β → Sort _}
(nil : motive α .nil)
(sderiv : ∀ β γ (A : α ↝ β) (h : γ < β), motive β A → motive γ (A ↘ h)) :
recSderiv (motive := motive) nil sderiv .nil = nil :=
rfl
@[simp]
theorem Path.recSderiv_sderiv {motive : ∀ β, α ↝ β → Sort _}
(nil : motive α .nil)
(sderiv : ∀ β γ (A : α ↝ β) (h : γ < β), motive β A → motive γ (A ↘ h))
{β γ : TypeIndex} (A : α ↝ β) (h : γ < β) :
recSderiv (motive := motive) nil sderiv (A ↘ h) = sderiv β γ A h (recSderiv nil sderiv A) :=
rfl
theorem Path.le (A : α ↝ β) : β ≤ α := by
induction A with
| nil => exact le_rfl
| sderiv β γ _A h h' => exact h.le.trans h'
/-- The downwards recursion principle for paths, specialised to the case where the motive at `β`
only depends on the fact that `β ≤ α`. -/
def Path.recSderivLe {motive : ∀ β ≤ α, Sort _}
(nil : motive α le_rfl)
(sderiv : ∀ β γ, ∀ (A : α ↝ β) (h : γ < β), motive β A.le → motive γ (h.le.trans A.le)) :
{β : TypeIndex} → (A : α ↝ β) → motive β A.le :=
Path.recSderiv (motive := λ β A ↦ motive β A.le) nil sderiv
@[simp]
theorem Path.recSderivLe_nil {motive : ∀ β ≤ α, Sort _}
(nil : motive α le_rfl)
(sderiv : ∀ β γ (A : α ↝ β) (h : γ < β), motive β A.le → motive γ (h.le.trans A.le)) :
recSderivLe (motive := motive) nil sderiv .nil = nil :=
rfl
@[simp]
theorem Path.recSderivLe_sderiv {motive : ∀ β ≤ α, Sort _}
(nil : motive α le_rfl)
(sderiv : ∀ β γ (A : α ↝ β) (h : γ < β), motive β A.le → motive γ (h.le.trans A.le))
{β γ : TypeIndex} (A : α ↝ β) (h : γ < β) :
recSderivLe (motive := motive) nil sderiv (A ↘ h) = sderiv β γ A h (recSderiv nil sderiv A) :=
rfl
/-- The downwards recursion principle for paths, specialised to the case where the motive is not
dependent on the relation of `β` to `α`. -/
@[elab_as_elim]
def Path.recSderivGlobal {motive : TypeIndex → Sort _}
(nil : motive α)
(sderiv : ∀ β γ, α ↝ β → γ < β → motive β → motive γ) :
{β : TypeIndex} → α ↝ β → motive β :=
Path.recSderiv (motive := λ β _ ↦ motive β) nil sderiv
@[simp]
theorem Path.recSderivGlobal_nil {motive : TypeIndex → Sort _}
(nil : motive α)
(sderiv : ∀ β γ, α ↝ β → γ < β → motive β → motive γ) :
recSderivGlobal (motive := motive) nil sderiv .nil = nil :=
rfl
@[simp]
theorem Path.recSderivGlobal_sderiv {motive : TypeIndex → Sort _}
(nil : motive α)
(sderiv : ∀ β γ, α ↝ β → γ < β → motive β → motive γ)
{β γ : TypeIndex} (A : α ↝ β) (h : γ < β) :
recSderivGlobal (motive := motive) nil sderiv (A ↘ h) =
sderiv β γ A h (recSderiv nil sderiv A) :=
rfl
/-!
## Derivatives of paths
-/
instance : Derivative (α ↝ β) (α ↝ γ) β γ where
deriv A := Path.recSderivGlobal A (λ _ _ _ h B ↦ B ↘ h)
instance : BotDerivative (α ↝ β) (α ↝ ⊥) β where
botDeriv A B := A ⇘ B
botSderiv A :=
match β with
| ⊥ => A
| (β : Λ) => A ↘ bot_lt_coe β
botDeriv_single A h := by
cases β using WithBot.recBotCoe with
| bot => cases lt_irrefl ⊥ h
| coe => rfl
instance : Coderivative (β ↝ γ) (α ↝ γ) α β where
coderiv A B := B ⇘ A
@[simp]
theorem Path.deriv_nil (A : α ↝ β) :
A ⇘ .nil = A :=
rfl
@[simp]
theorem Path.deriv_sderiv (A : α ↝ β) (B : β ↝ γ) (h : δ < γ) :
A ⇘ (B ↘ h) = A ⇘ B ↘ h :=
rfl
@[simp]
theorem Path.nil_deriv (A : α ↝ β) :
(.nil : α ↝ α) ⇘ A = A := by
induction A with
| nil => rfl
| sderiv γ δ A h ih => rw [deriv_sderiv, ih]
@[simp]
theorem Path.deriv_sderivBot (A : α ↝ β) (B : β ↝ γ) :
A ⇘ (B ↘.) = A ⇘ B ↘. := by
cases γ using WithBot.recBotCoe with
| bot => rfl
| coe => rfl
@[simp]
theorem Path.botSderiv_bot_eq (A : α ↝ ⊥) :
A ↘. = A :=
rfl
@[simp]
theorem Path.botSderiv_coe_eq {β : Λ} (A : α ↝ β) :
A ↘ bot_lt_coe β = A ↘. :=
rfl
@[simp]
theorem Path.deriv_assoc (A : α ↝ β) (B : β ↝ γ) (C : γ ↝ δ) :
A ⇘ (B ⇘ C) = A ⇘ B ⇘ C := by
induction C with
| nil => rfl
| sderiv ε ζ C h ih => simp only [deriv_sderiv, ih]
@[simp]
theorem Path.deriv_sderiv_assoc (A : α ↝ β) (B : β ↝ γ) (h : δ < γ) :
A ⇘ (B ↘ h) = A ⇘ B ↘ h :=
rfl
@[simp]
theorem Path.deriv_scoderiv (A : α ↝ β) (B : γ ↝ δ) (h : γ < β) :
A ⇘ (B ↗ h) = A ↘ h ⇘ B := by
induction B with
| nil => rfl
| sderiv ε ζ B h' ih =>
rw [deriv_sderiv, ← ih]
rfl
@[simp]
theorem Path.botDeriv_scoderiv (A : α ↝ β) (B : γ ↝ ⊥) (h : γ < β) :
A ⇘. (B ↗ h) = A ↘ h ⇘. B :=
deriv_scoderiv A B h
theorem Path.coderiv_eq_deriv (A : α ↝ β) (B : β ↝ γ) :
B ⇗ A = A ⇘ B :=
rfl
theorem Path.coderiv_deriv (A : β ↝ γ) (h₁ : β < α) (h₂ : δ < γ) :
A ↗ h₁ ↘ h₂ = A ↘ h₂ ↗ h₁ :=
rfl
theorem Path.coderiv_deriv' (A : β ↝ γ) (h : β < α) (B : γ ↝ δ) :
A ↗ h ⇘ B = A ⇘ B ↗ h := by
induction B with
| nil => rfl
| sderiv ε ζ B h' ih =>
rw [deriv_sderiv, ih]
rfl
theorem Path.eq_nil (A : β ↝ β) :
A = .nil := by
cases A with
| nil => rfl
| sderiv γ _ A h => cases A.le.not_lt h
theorem Path.sderiv_index_injective {A : α ↝ β} {B : α ↝ γ} {hδβ : δ < β} {hδγ : δ < γ}
(h : A ↘ hδβ = B ↘ hδγ) :
β = γ := by
cases h
rfl
theorem Path.sderivBot_index_injective {β γ : Λ} {A : α ↝ β} {B : α ↝ γ}
(h : A ↘. = B ↘.) :
β = γ := by
cases h
rfl
theorem Path.sderiv_path_injective {A B : α ↝ β} {hγ : γ < β} (h : A ↘ hγ = B ↘ hγ) :
A = B := by
cases h
rfl
theorem Path.sderivBot_path_injective {β : Λ} {A B : α ↝ β} (h : A ↘. = B ↘.) :
A = B := by
cases h
rfl
theorem Path.deriv_left_injective {A B : α ↝ β} {C : β ↝ γ} (h : A ⇘ C = B ⇘ C) :
A = B := by
induction C with
| nil => exact h
| sderiv δ ε C hε ih =>
rw [deriv_sderiv_assoc, deriv_sderiv_assoc] at h
exact ih (Path.sderiv_path_injective h)
theorem Path.deriv_right_injective {A : α ↝ β} {B C : β ↝ γ} (h : A ⇘ B = A ⇘ C) :
B = C := by
induction C with
| nil => exact B.eq_nil
| sderiv δ ε C hε ih =>
cases B with
| nil => cases C.le.not_lt hε
| sderiv ζ η B hε' =>
cases Path.sderiv_index_injective h
rw [deriv_sderiv_assoc, deriv_sderiv_assoc] at h
rw [ih (Path.sderiv_path_injective h)]
@[simp]
theorem Path.sderiv_left_inj {A B : α ↝ β} {h : γ < β} :
A ↘ h = B ↘ h ↔ A = B :=
⟨Path.sderiv_path_injective, λ h ↦ h ▸ rfl⟩
@[simp]
theorem Path.deriv_left_inj {A B : α ↝ β} {C : β ↝ γ} :
A ⇘ C = B ⇘ C ↔ A = B :=
⟨deriv_left_injective, λ h ↦ h ▸ rfl⟩
@[simp]
theorem Path.deriv_right_inj {A : α ↝ β} {B C : β ↝ γ} :
A ⇘ B = A ⇘ C ↔ B = C :=
⟨deriv_right_injective, λ h ↦ h ▸ rfl⟩
@[simp]
theorem Path.scoderiv_left_inj {A B : β ↝ γ} {h : β < α} :
A ↗ h = B ↗ h ↔ A = B :=
deriv_right_inj
@[simp]
theorem Path.coderiv_left_inj {A B : β ↝ γ} {C : α ↝ β} :
A ⇗ C = B ⇗ C ↔ A = B :=
deriv_right_inj
@[simp]
theorem Path.coderiv_right_inj {A : β ↝ γ} {B C : α ↝ β} :
A ⇗ B = A ⇗ C ↔ B = C :=
deriv_left_inj
/-!
## Upwards recursion along paths
-/
/--
The same as `Path`, but the components of this path point "upwards" instead of "downwards".
This type is only used for proving `revScoderiv`, and should be considered an implementation detail.
-/
inductive RevPath (α : TypeIndex) : TypeIndex → Type u
| nil : RevPath α α
| cons {β γ : TypeIndex} : RevPath α β → β < γ → RevPath α γ
/-- A computable statement of the recursion principle for `RevPath`. This needs to be written due
to a current limitation in the Lean 4 kernel: it cannot generate code for the `.rec` functions. -/
def RevPath.rec' {motive : (β : TypeIndex) → RevPath α β → Sort _}
(nil : motive α RevPath.nil)
(cons : {β γ : TypeIndex} → (A : RevPath α β) → (h : β < γ) →
motive β A → motive γ (A.cons h)) :
{β : TypeIndex} → (A : RevPath α β) → motive β A
| _, .nil => nil
| _, .cons A h => cons A h (RevPath.rec' nil cons A)
def RevPath.snoc (h : γ < β) : {α : TypeIndex} → RevPath β α → RevPath γ α
| _, .nil => .cons .nil h
| _, .cons A h' => (RevPath.snoc h A).cons h'
def Path.rev : α ↝ β → RevPath β α :=
Path.recSderiv .nil (λ _ _ _ h ↦ RevPath.snoc h)
@[simp]
theorem Path.rev_nil :
(.nil : α ↝ α).rev = .nil :=
rfl
@[simp]
theorem Path.rev_sderiv (A : α ↝ β) (h : γ < β) :
(A ↘ h).rev = A.rev.snoc h :=
rfl
def RevPath.rev : {α : TypeIndex} → RevPath β α → α ↝ β
| _, .nil => .nil
| _, .cons A h => RevPath.rev A ↗ h
theorem Path.sderiv_rev (A : α ↝ β) (h : γ < β) :
(A ↘ h).rev = A.rev.snoc h :=
rfl
theorem Path.scoderiv_rev (A : β ↝ γ) (h : β < α) :
(A ↗ h).rev = A.rev.cons h := by
induction A with
| nil => rfl
| sderiv δ ε A h ih => rw [rev_sderiv, ← coderiv_deriv, rev_sderiv, ih, RevPath.snoc]
theorem RevPath.snoc_rev (A : RevPath β α) (h : γ < β) :
(A.snoc h).rev = A.rev ↘ h := by
induction A with
| nil => rfl
| cons A h ih => rw [snoc, rev, ih, rev, Path.coderiv_deriv]
theorem Path.rev_rev (A : α ↝ β) : A.rev.rev = A := by
induction A with
| nil => rfl
| sderiv γ δ A h ih => rw [Path.sderiv_rev, RevPath.snoc_rev, ih]
def Path.recScoderiv' {motive : ∀ β, β ↝ γ → Sort _}
(nil : motive γ .nil)
(scoderiv : ∀ α β (A : β ↝ γ) (h : β < α), motive β A → motive α (A ↗ h))
{β : TypeIndex} (A : RevPath γ β) : motive β A.rev :=
RevPath.rec' (motive := λ β A ↦ motive β A.rev) nil (λ A ↦ scoderiv _ _ A.rev) A
@[simp]
theorem Path.recScoderiv'_nil {motive : ∀ β, β ↝ γ → Sort _}
(nil : motive γ .nil)
(scoderiv : ∀ α β (A : β ↝ γ) (h : β < α), motive β A → motive α (A ↗ h)) :
recScoderiv' (motive := motive) nil scoderiv .nil = nil :=
rfl
@[simp]
theorem Path.recScoderiv'_cons {motive : ∀ β, β ↝ γ → Sort _}
(nil : motive γ .nil)
(scoderiv : ∀ α β (A : β ↝ γ) (h : β < α), motive β A → motive α (A ↗ h))
(A : RevPath γ β) (h : β < α) :
recScoderiv' (motive := motive) nil scoderiv (A.cons h) =
scoderiv α β A.rev h (recScoderiv' nil scoderiv A) :=
rfl
/-- The upwards recursion principle for paths. The `scoderiv` computation rule
`recScoderiv_scoderiv` is not a definitional equality. -/
@[elab_as_elim]
def Path.recScoderiv {motive : ∀ β, β ↝ γ → Sort _}
(nil : motive γ .nil)
(scoderiv : ∀ α β (A : β ↝ γ) (h : β < α), motive β A → motive α (A ↗ h))
{β : TypeIndex} (A : β ↝ γ) : motive β A :=
cast (by rw [A.rev_rev]) (recScoderiv' nil scoderiv A.rev)
@[simp]
theorem Path.recScoderiv_nil {motive : ∀ β, β ↝ γ → Sort _}
(nil : motive γ .nil)
(scoderiv : ∀ α β (A : β ↝ γ) (h : β < α), motive β A → motive α (A ↗ h)) :
recScoderiv (motive := motive) nil scoderiv .nil = nil :=
rfl
@[simp]
theorem Path.recScoderiv_scoderiv {motive : ∀ β, β ↝ γ → Sort _}
(nil : motive γ .nil)
(scoderiv : ∀ α β (A : β ↝ γ) (h : β < α), motive β A → motive α (A ↗ h))
{α β : TypeIndex} (A : β ↝ γ) (h : β < α) :
recScoderiv (motive := motive) nil scoderiv (A ↗ h) =
scoderiv α β A h (recScoderiv nil scoderiv A) := by
unfold recScoderiv
rw [cast_eq_iff_heq, scoderiv_rev, recScoderiv'_cons]
congr 1
· exact A.rev_rev
· exact HEq.symm (cast_heq _ _)
| theorem Path.scoderiv_index_injective {A : β ↝ δ} {B : γ ↝ δ} {hβα : β < α} {hγα : γ < α}
(h : A ↗ hβα = B ↗ hγα) :
β = γ | ConNF.Path.scoderiv_index_injective | {
"commit": "8896e416a16c39e1fe487b5fc7c78bc20c4e182b",
"date": "2024-12-03T00:00:00"
} | {
"commit": "ce890707e37ede74a2fcd66134d3f403335c5cc1",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/Levels/Path.lean | ConNF.Levels.Path | ConNF.Levels.Path.jsonl | {
"lineInFile": 467,
"tokenPositionInFile": 14717,
"theoremPositionInFile": 59
} | {
"inFilePremises": true,
"numInFilePremises": 9,
"repositoryPremises": true,
"numRepositoryPremises": 14,
"numPremises": 30
} | {
"hasProof": true,
"proof": ":= by\n have := congr_arg rev h\n rw [scoderiv_rev, scoderiv_rev, RevPath.cons.injEq] at this\n exact this.1",
"proofType": "tactic",
"proofLengthLines": 3,
"proofLengthTokens": 108
} |
import ConNF.ModelData.Enumeration
import ConNF.Levels.StrPerm
/-!
# Enumerations over paths
In this file, we provide extra features to `Enumeration`s that take values of the form `α ↝ ⊥ × X`.
## Main declarations
* `ConNF.Enumeration.ext_path`: An extensionality principle for such `Enumeration`s.
-/
noncomputable section
universe u
open Cardinal Ordinal
namespace ConNF
variable [Params.{u}]
namespace Enumeration
/-- A helper function for making relations with domain and codomain of the form `α ↝ ⊥ × X`
by defining it on each branch. -/
def relWithPath {X Y : Type u} {α : TypeIndex} (f : α ↝ ⊥ → Rel X Y) :
Rel (α ↝ ⊥ × X) (α ↝ ⊥ × Y) :=
λ x y ↦ x.1 = y.1 ∧ f x.1 x.2 y.2
theorem relWithPath_coinjective {X Y : Type u} {α : TypeIndex} {f : α ↝ ⊥ → Rel X Y}
(hf : ∀ A, (f A).Coinjective) :
(relWithPath f).Coinjective := by
constructor
rintro ⟨_, y₁⟩ ⟨_, y₂⟩ ⟨A, x⟩ ⟨rfl, h₁⟩ ⟨rfl, h₂⟩
cases (hf A).coinjective h₁ h₂
rfl
instance (X : Type u) (α β : TypeIndex) :
Derivative (Enumeration (α ↝ ⊥ × X)) (Enumeration (β ↝ ⊥ × X)) α β where
deriv E A := E.invImage (λ x ↦ (x.1 ⇗ A, x.2))
(λ x y h ↦ Prod.ext (Path.deriv_right_injective
((Prod.mk.injEq _ _ _ _).mp h).1) ((Prod.mk.injEq _ _ _ _).mp h).2)
theorem deriv_rel {X : Type _} {α β : TypeIndex} (E : Enumeration (α ↝ ⊥ × X)) (A : α ↝ β)
(i : κ) (x : β ↝ ⊥ × X) :
(E ⇘ A).rel i x ↔ E.rel i (x.1 ⇗ A, x.2) :=
Iff.rfl
instance (X : Type u) (α β : TypeIndex) :
Coderivative (Enumeration (β ↝ ⊥ × X)) (Enumeration (α ↝ ⊥ × X)) α β where
coderiv E A := E.image (λ x ↦ (x.1 ⇗ A, x.2))
theorem coderiv_rel {X : Type _} {α β : TypeIndex} (E : Enumeration (β ↝ ⊥ × X)) (A : α ↝ β)
(i : κ) (x : α ↝ ⊥ × X) :
(E ⇗ A).rel i x ↔ ∃ B, x.1 = A ⇘ B ∧ E.rel i (B, x.2) := by
constructor
· rintro ⟨x, h, rfl⟩
exact ⟨_, rfl, h⟩
· rintro ⟨B, h₁, h₂⟩
refine ⟨(B, x.2), h₂, ?_⟩
apply Prod.ext
· dsimp only
exact h₁.symm
· rfl
| theorem scoderiv_rel {X : Type _} {α β : TypeIndex} (E : Enumeration (β ↝ ⊥ × X)) (h : β < α)
(i : κ) (x : α ↝ ⊥ × X) :
(E ↗ h).rel i x ↔ ∃ B, x.1 = B ↗ h ∧ E.rel i (B, x.2) | ConNF.Enumeration.scoderiv_rel | {
"commit": "39c33b4a743bea62dbcc549548b712ffd38ca65c",
"date": "2024-12-05T00:00:00"
} | {
"commit": "ce890707e37ede74a2fcd66134d3f403335c5cc1",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/ModelData/PathEnumeration.lean | ConNF.ModelData.PathEnumeration | ConNF.ModelData.PathEnumeration.jsonl | {
"lineInFile": 67,
"tokenPositionInFile": 1972,
"theoremPositionInFile": 4
} | {
"inFilePremises": true,
"numInFilePremises": 2,
"repositoryPremises": true,
"numRepositoryPremises": 15,
"numPremises": 33
} | {
"hasProof": true,
"proof": ":=\n coderiv_rel E (.single h) i x",
"proofType": "term",
"proofLengthLines": 1,
"proofLengthTokens": 34
} |
import ConNF.ModelData.PathEnumeration
/-!
# Supports
In this file, we define the notion of a support.
## Main declarations
* `ConNF.BaseSupport`: The type of supports of atoms.
* `ConNF.Support`: The type of supports of objects of arbitrary type indices.
-/
universe u
open Cardinal
namespace ConNF
variable [Params.{u}]
/-!
## Base supports
-/
structure BaseSupport where
atoms : Enumeration Atom
nearLitters : Enumeration NearLitter
namespace BaseSupport
instance : SuperA BaseSupport (Enumeration Atom) where
superA := atoms
instance : SuperN BaseSupport (Enumeration NearLitter) where
superN := nearLitters
@[simp]
theorem mk_atoms {a : Enumeration Atom} {N : Enumeration NearLitter} :
(BaseSupport.mk a N)ᴬ = a :=
rfl
@[simp]
theorem mk_nearLitters {a : Enumeration Atom} {N : Enumeration NearLitter} :
(BaseSupport.mk a N)ᴺ = N :=
rfl
theorem atoms_congr {S T : BaseSupport} (h : S = T) :
Sᴬ = Tᴬ :=
h ▸ rfl
theorem nearLitters_congr {S T : BaseSupport} (h : S = T) :
Sᴺ = Tᴺ :=
h ▸ rfl
@[ext]
theorem ext {S T : BaseSupport} (h₁ : Sᴬ = Tᴬ) (h₂ : Sᴺ = Tᴺ) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
cases h₁
cases h₂
rfl
instance : SMul BasePerm BaseSupport where
smul π S := ⟨π • Sᴬ, π • Sᴺ⟩
@[simp]
theorem smul_atoms (π : BasePerm) (S : BaseSupport) :
(π • S)ᴬ = π • Sᴬ :=
rfl
@[simp]
theorem smul_nearLitters (π : BasePerm) (S : BaseSupport) :
(π • S)ᴺ = π • Sᴺ :=
rfl
@[simp]
theorem smul_atoms_eq_of_smul_eq {π : BasePerm} {S : BaseSupport}
(h : π • S = S) :
π • Sᴬ = Sᴬ := by
rw [← smul_atoms, h]
@[simp]
theorem smul_nearLitters_eq_of_smul_eq {π : BasePerm} {S : BaseSupport}
(h : π • S = S) :
π • Sᴺ = Sᴺ := by
rw [← smul_nearLitters, h]
instance : MulAction BasePerm BaseSupport where
one_smul S := by
apply ext
· rw [smul_atoms, one_smul]
· rw [smul_nearLitters, one_smul]
mul_smul π₁ π₂ S := by
apply ext
· rw [smul_atoms, smul_atoms, smul_atoms, mul_smul]
· rw [smul_nearLitters, smul_nearLitters, smul_nearLitters, mul_smul]
theorem smul_eq_smul_iff (π₁ π₂ : BasePerm) (S : BaseSupport) :
π₁ • S = π₂ • S ↔ (∀ a ∈ Sᴬ, π₁ • a = π₂ • a) ∧ (∀ N ∈ Sᴺ, π₁ • N = π₂ • N) := by
constructor
· intro h
constructor
· rintro a ⟨i, ha⟩
have := congr_arg (·ᴬ.rel i (π₁ • a)) h
simp only [smul_atoms, Enumeration.smul_rel, inv_smul_smul, eq_iff_iff] at this
have := Sᴬ.rel_coinjective.coinjective ha (this.mp ha)
rw [eq_inv_smul_iff] at this
rw [this]
· rintro N ⟨i, hN⟩
have := congr_arg (·ᴺ.rel i (π₁ • N)) h
simp only [smul_nearLitters, Enumeration.smul_rel, inv_smul_smul, eq_iff_iff] at this
have := Sᴺ.rel_coinjective.coinjective hN (this.mp hN)
rw [eq_inv_smul_iff] at this
rw [this]
· intro h
ext : 2
· rfl
· ext i a : 3
rw [smul_atoms, smul_atoms, Enumeration.smul_rel, Enumeration.smul_rel]
constructor
· intro ha
have := h.1 _ ⟨i, ha⟩
rw [smul_inv_smul, ← inv_smul_eq_iff] at this
rwa [this]
· intro ha
have := h.1 _ ⟨i, ha⟩
rw [smul_inv_smul, smul_eq_iff_eq_inv_smul] at this
rwa [← this]
· rfl
· ext i a : 3
rw [smul_nearLitters, smul_nearLitters, Enumeration.smul_rel, Enumeration.smul_rel]
constructor
· intro hN
have := h.2 _ ⟨i, hN⟩
rw [smul_inv_smul, ← inv_smul_eq_iff] at this
rwa [this]
· intro hN
have := h.2 _ ⟨i, hN⟩
rw [smul_inv_smul, smul_eq_iff_eq_inv_smul] at this
rwa [← this]
theorem smul_eq_iff (π : BasePerm) (S : BaseSupport) :
π • S = S ↔ (∀ a ∈ Sᴬ, π • a = a) ∧ (∀ N ∈ Sᴺ, π • N = N) := by
have := smul_eq_smul_iff π 1 S
simp only [one_smul] at this
exact this
noncomputable instance : Add BaseSupport where
add S T := ⟨Sᴬ + Tᴬ, Sᴺ + Tᴺ⟩
@[simp]
theorem add_atoms (S T : BaseSupport) :
(S + T)ᴬ = Sᴬ + Tᴬ :=
rfl
@[simp]
theorem add_nearLitters (S T : BaseSupport) :
(S + T)ᴺ = Sᴺ + Tᴺ :=
rfl
end BaseSupport
def baseSupportEquiv : BaseSupport ≃ Enumeration Atom × Enumeration NearLitter where
toFun S := (Sᴬ, Sᴺ)
invFun S := ⟨S.1, S.2⟩
left_inv _ := rfl
right_inv _ := rfl
theorem card_baseSupport : #BaseSupport = #μ := by
rw [Cardinal.eq.mpr ⟨baseSupportEquiv⟩, mk_prod, lift_id, lift_id,
card_enumeration_eq card_atom, card_enumeration_eq card_nearLitter, mul_eq_self aleph0_lt_μ.le]
/-!
## Structural supports
-/
structure Support (α : TypeIndex) where
atoms : Enumeration (α ↝ ⊥ × Atom)
nearLitters : Enumeration (α ↝ ⊥ × NearLitter)
namespace Support
variable {α β : TypeIndex}
instance : SuperA (Support α) (Enumeration (α ↝ ⊥ × Atom)) where
superA := atoms
instance : SuperN (Support α) (Enumeration (α ↝ ⊥ × NearLitter)) where
superN := nearLitters
@[simp]
theorem mk_atoms (E : Enumeration (α ↝ ⊥ × Atom)) (F : Enumeration (α ↝ ⊥ × NearLitter)) :
(⟨E, F⟩ : Support α)ᴬ = E :=
rfl
@[simp]
theorem mk_nearLitters (E : Enumeration (α ↝ ⊥ × Atom)) (F : Enumeration (α ↝ ⊥ × NearLitter)) :
(⟨E, F⟩ : Support α)ᴺ = F :=
rfl
instance : Derivative (Support α) (Support β) α β where
deriv S A := ⟨Sᴬ ⇘ A, Sᴺ ⇘ A⟩
instance : Coderivative (Support β) (Support α) α β where
coderiv S A := ⟨Sᴬ ⇗ A, Sᴺ ⇗ A⟩
instance : BotDerivative (Support α) BaseSupport α where
botDeriv S A := ⟨Sᴬ ⇘. A, Sᴺ ⇘. A⟩
botSderiv S := ⟨Sᴬ ↘., Sᴺ ↘.⟩
botDeriv_single S h := by dsimp only; rw [botDeriv_single, botDeriv_single]
@[simp]
theorem deriv_atoms {α β : TypeIndex} (S : Support α) (A : α ↝ β) :
Sᴬ ⇘ A = (S ⇘ A)ᴬ :=
rfl
@[simp]
theorem deriv_nearLitters {α β : TypeIndex} (S : Support α) (A : α ↝ β) :
Sᴺ ⇘ A = (S ⇘ A)ᴺ :=
rfl
@[simp]
theorem sderiv_atoms {α β : TypeIndex} (S : Support α) (h : β < α) :
Sᴬ ↘ h = (S ↘ h)ᴬ :=
rfl
@[simp]
theorem sderiv_nearLitters {α β : TypeIndex} (S : Support α) (h : β < α) :
Sᴺ ↘ h = (S ↘ h)ᴺ :=
rfl
@[simp]
theorem coderiv_atoms {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
Sᴬ ⇗ A = (S ⇗ A)ᴬ :=
rfl
@[simp]
theorem coderiv_nearLitters {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
Sᴺ ⇗ A = (S ⇗ A)ᴺ :=
rfl
@[simp]
theorem scoderiv_atoms {α β : TypeIndex} (S : Support β) (h : β < α) :
Sᴬ ↗ h = (S ↗ h)ᴬ :=
rfl
@[simp]
theorem scoderiv_nearLitters {α β : TypeIndex} (S : Support β) (h : β < α) :
Sᴺ ↗ h = (S ↗ h)ᴺ :=
rfl
@[simp]
theorem derivBot_atoms {α : TypeIndex} (S : Support α) (A : α ↝ ⊥) :
Sᴬ ⇘. A = (S ⇘. A)ᴬ :=
rfl
@[simp]
theorem derivBot_nearLitters {α : TypeIndex} (S : Support α) (A : α ↝ ⊥) :
Sᴺ ⇘. A = (S ⇘. A)ᴺ :=
rfl
theorem ext' {S T : Support α} (h₁ : Sᴬ = Tᴬ) (h₂ : Sᴺ = Tᴺ) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
cases h₁
cases h₂
rfl
@[ext]
theorem ext {S T : Support α} (h : ∀ A, S ⇘. A = T ⇘. A) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
rw [mk.injEq]
constructor
· apply Enumeration.ext_path
intro A
exact BaseSupport.atoms_congr (h A)
· apply Enumeration.ext_path
intro A
exact BaseSupport.nearLitters_congr (h A)
@[simp]
theorem deriv_derivBot {α : TypeIndex} (S : Support α)
(A : α ↝ β) (B : β ↝ ⊥) :
S ⇘ A ⇘. B = S ⇘. (A ⇘ B) :=
rfl
@[simp]
theorem coderiv_deriv_eq {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
S ⇗ A ⇘ A = S :=
ext' (Sᴬ.coderiv_deriv_eq A) (Sᴺ.coderiv_deriv_eq A)
theorem eq_of_atom_mem_scoderiv_botDeriv {α β : TypeIndex} {S : Support β} {A : α ↝ ⊥}
{h : β < α} {a : Atom} (ha : a ∈ (S ↗ h ⇘. A)ᴬ) :
∃ B : β ↝ ⊥, A = B ↗ h :=
Enumeration.eq_of_mem_scoderiv_botDeriv ha
theorem eq_of_nearLitter_mem_scoderiv_botDeriv {α β : TypeIndex} {S : Support β} {A : α ↝ ⊥}
{h : β < α} {N : NearLitter} (hN : N ∈ (S ↗ h ⇘. A)ᴺ) :
∃ B : β ↝ ⊥, A = B ↗ h :=
Enumeration.eq_of_mem_scoderiv_botDeriv hN
@[simp]
theorem scoderiv_botDeriv_eq {α β : TypeIndex} (S : Support β) (A : β ↝ ⊥) (h : β < α) :
S ↗ h ⇘. (A ↗ h) = S ⇘. A :=
BaseSupport.ext (Enumeration.scoderiv_botDeriv_eq _ _ _) (Enumeration.scoderiv_botDeriv_eq _ _ _)
@[simp]
theorem scoderiv_deriv_eq {α β γ : TypeIndex} (S : Support β) (A : β ↝ γ) (h : β < α) :
S ↗ h ⇘ (A ↗ h) = S ⇘ A := by
apply ext
intro B
simp only [deriv_derivBot, ← scoderiv_botDeriv_eq S (A ⇘ B) h, Path.coderiv_deriv']
@[simp]
theorem coderiv_inj {α β : TypeIndex} (S T : Support β) (A : α ↝ β) :
S ⇗ A = T ⇗ A ↔ S = T := by
constructor
swap
· rintro rfl
rfl
intro h
ext B : 1
have : S ⇗ A ⇘ A ⇘. B = T ⇗ A ⇘ A ⇘. B := by rw [h]
rwa [coderiv_deriv_eq, coderiv_deriv_eq] at this
@[simp]
theorem scoderiv_inj {α β : TypeIndex} (S T : Support β) (h : β < α) :
S ↗ h = T ↗ h ↔ S = T :=
coderiv_inj S T (.single h)
instance {α : TypeIndex} : SMul (StrPerm α) (Support α) where
smul π S := ⟨π • Sᴬ, π • Sᴺ⟩
@[simp]
theorem smul_atoms {α : TypeIndex} (π : StrPerm α) (S : Support α) :
(π • S)ᴬ = π • Sᴬ :=
rfl
@[simp]
theorem smul_nearLitters {α : TypeIndex} (π : StrPerm α) (S : Support α) :
(π • S)ᴺ = π • Sᴺ :=
rfl
theorem smul_atoms_eq_of_smul_eq {α : TypeIndex} {π : StrPerm α} {S : Support α}
(h : π • S = S) :
π • Sᴬ = Sᴬ := by
rw [← smul_atoms, h]
theorem smul_nearLitters_eq_of_smul_eq {α : TypeIndex} {π : StrPerm α} {S : Support α}
(h : π • S = S) :
π • Sᴺ = Sᴺ := by
rw [← smul_nearLitters, h]
instance {α : TypeIndex} : MulAction (StrPerm α) (Support α) where
one_smul S := by
apply ext'
· rw [smul_atoms, one_smul]
· rw [smul_nearLitters, one_smul]
mul_smul π₁ π₂ S := by
apply ext'
· rw [smul_atoms, smul_atoms, smul_atoms, mul_smul]
· rw [smul_nearLitters, smul_nearLitters, smul_nearLitters, mul_smul]
@[simp]
theorem smul_derivBot {α : TypeIndex} (π : StrPerm α) (S : Support α) (A : α ↝ ⊥) :
(π • S) ⇘. A = π A • (S ⇘. A) :=
rfl
theorem smul_coderiv {α : TypeIndex} (π : StrPerm α) (S : Support β) (A : α ↝ β) :
π • S ⇗ A = (π ⇘ A • S) ⇗ A := by
ext B i x
· rfl
· constructor
· rintro ⟨⟨C, x⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, x⟩, hS, rfl⟩
· rintro ⟨⟨C, x⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, _⟩, hS, rfl⟩
· rfl
· constructor
· rintro ⟨⟨C, x⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, x⟩, hS, rfl⟩
· rintro ⟨⟨C, a⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, _⟩, hS, rfl⟩
theorem smul_scoderiv {α : TypeIndex} (π : StrPerm α) (S : Support β) (h : β < α) :
π • S ↗ h = (π ↘ h • S) ↗ h :=
smul_coderiv π S (Path.single h)
theorem smul_eq_smul_iff (π₁ π₂ : StrPerm β) (S : Support β) :
π₁ • S = π₂ • S ↔
∀ A, (∀ a ∈ (S ⇘. A)ᴬ, π₁ A • a = π₂ A • a) ∧ (∀ N ∈ (S ⇘. A)ᴺ, π₁ A • N = π₂ A • N) := by
constructor
· intro h A
have := congr_arg (· ⇘. A) h
simp only [smul_derivBot, BaseSupport.smul_eq_smul_iff] at this
exact this
· intro h
apply ext
intro A
simp only [smul_derivBot, BaseSupport.smul_eq_smul_iff]
exact h A
theorem smul_eq_iff (π : StrPerm β) (S : Support β) :
π • S = S ↔ ∀ A, (∀ a ∈ (S ⇘. A)ᴬ, π A • a = a) ∧ (∀ N ∈ (S ⇘. A)ᴺ, π A • N = N) := by
have := smul_eq_smul_iff π 1 S
simp only [one_smul, Tree.one_apply] at this
exact this
noncomputable instance : Add (Support α) where
add S T := ⟨Sᴬ + Tᴬ, Sᴺ + Tᴺ⟩
@[simp]
theorem add_derivBot (S T : Support α) (A : α ↝ ⊥) :
(S + T) ⇘. A = (S ⇘. A) + (T ⇘. A) :=
rfl
theorem smul_add (S T : Support α) (π : StrPerm α) :
π • (S + T) = π • S + π • T :=
rfl
theorem add_inj_of_bound_eq_bound {S T U V : Support α}
(ha : Sᴬ.bound = Tᴬ.bound) (hN : Sᴺ.bound = Tᴺ.bound)
(h' : S + U = T + V) : S = T ∧ U = V := by
have ha' := Enumeration.add_inj_of_bound_eq_bound ha (congr_arg (·ᴬ) h')
have hN' := Enumeration.add_inj_of_bound_eq_bound hN (congr_arg (·ᴺ) h')
constructor
· exact Support.ext' ha'.1 hN'.1
· exact Support.ext' ha'.2 hN'.2
end Support
def supportEquiv {α : TypeIndex} : Support α ≃
Enumeration (α ↝ ⊥ × Atom) × Enumeration (α ↝ ⊥ × NearLitter) where
toFun S := (Sᴬ, Sᴺ)
invFun S := ⟨S.1, S.2⟩
left_inv _ := rfl
right_inv _ := rfl
theorem card_support {α : TypeIndex} : #(Support α) = #μ := by
rw [Cardinal.eq.mpr ⟨supportEquiv⟩, mk_prod, lift_id, lift_id,
card_enumeration_eq, card_enumeration_eq, mul_eq_self aleph0_lt_μ.le]
· rw [mk_prod, lift_id, lift_id, card_nearLitter,
mul_eq_right aleph0_lt_μ.le (card_path_lt' α ⊥).le (card_path_ne_zero α)]
· rw [mk_prod, lift_id, lift_id, card_atom,
mul_eq_right aleph0_lt_μ.le (card_path_lt' α ⊥).le (card_path_ne_zero α)]
/-!
## Orders on supports
-/
-- TODO: Is this order used?
instance : LE BaseSupport where
le S T := (∀ a ∈ Sᴬ, a ∈ Tᴬ) ∧ (∀ N ∈ Sᴺ, N ∈ Tᴺ)
instance : Preorder BaseSupport where
le_refl S := ⟨λ _ ↦ id, λ _ ↦ id⟩
le_trans S T U h₁ h₂ := ⟨λ a h ↦ h₂.1 _ (h₁.1 a h), λ N h ↦ h₂.2 _ (h₁.2 N h)⟩
theorem BaseSupport.smul_le_smul {S T : BaseSupport} (h : S ≤ T) (π : BasePerm) :
π • S ≤ π • T := by
constructor
· intro a
exact h.1 (π⁻¹ • a)
· intro N
exact h.2 (π⁻¹ • N)
theorem BaseSupport.le_add_right {S T : BaseSupport} :
S ≤ S + T := by
constructor
· intro a ha
simp only [Support.add_derivBot, BaseSupport.add_atoms, Enumeration.mem_add_iff]
exact Or.inl ha
· intro N hN
simp only [Support.add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
exact Or.inl hN
theorem BaseSupport.le_add_left {S T : BaseSupport} :
S ≤ T + S := by
constructor
· intro a ha
simp only [add_atoms, Enumeration.mem_add_iff]
exact Or.inr ha
· intro N hN
simp only [add_nearLitters, Enumeration.mem_add_iff]
exact Or.inr hN
def BaseSupport.Subsupport (S T : BaseSupport) : Prop :=
Sᴬ.rel ≤ Tᴬ.rel ∧ Sᴺ.rel ≤ Tᴺ.rel
theorem BaseSupport.Subsupport.le {S T : BaseSupport}
(h : S.Subsupport T) : S ≤ T := by
constructor
· rintro a ⟨i, hi⟩
exact ⟨i, h.1 i a hi⟩
· rintro N ⟨i, hi⟩
exact ⟨i, h.2 i N hi⟩
theorem BaseSupport.Subsupport.trans {S T U : BaseSupport}
(h₁ : S.Subsupport T) (h₂ : T.Subsupport U) :
S.Subsupport U :=
⟨h₁.1.trans h₂.1, h₁.2.trans h₂.2⟩
theorem BaseSupport.smul_subsupport_smul {S T : BaseSupport} (h : S.Subsupport T) (π : BasePerm) :
(π • S).Subsupport (π • T) := by
constructor
· intro i a ha
exact h.1 i _ ha
· intro i N hN
exact h.2 i _ hN
instance {α : TypeIndex} : LE (Support α) where
le S T := ∀ A, S ⇘. A ≤ T ⇘. A
instance {α : TypeIndex} : Preorder (Support α) where
le_refl S := λ A ↦ le_rfl
le_trans S T U h₁ h₂ := λ A ↦ (h₁ A).trans (h₂ A)
theorem Support.smul_le_smul {α : TypeIndex} {S T : Support α} (h : S ≤ T) (π : StrPerm α) :
π • S ≤ π • T :=
λ A ↦ BaseSupport.smul_le_smul (h A) (π A)
theorem Support.le_add_right {α : TypeIndex} {S T : Support α} :
S ≤ S + T := by
intro A
rw [add_derivBot]
exact BaseSupport.le_add_right
| theorem Support.le_add_left {α : TypeIndex} {S T : Support α} :
S ≤ T + S | ConNF.Support.le_add_left | {
"commit": "39c33b4a743bea62dbcc549548b712ffd38ca65c",
"date": "2024-12-05T00:00:00"
} | {
"commit": "251ac752f844dfde539ac2bd3ff112305ad59139",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/ModelData/Support.lean | ConNF.ModelData.Support | ConNF.ModelData.Support.jsonl | {
"lineInFile": 538,
"tokenPositionInFile": 15061,
"theoremPositionInFile": 58
} | {
"inFilePremises": true,
"numInFilePremises": 9,
"repositoryPremises": true,
"numRepositoryPremises": 14,
"numPremises": 23
} | {
"hasProof": true,
"proof": ":= by\n intro A\n rw [add_derivBot]\n exact BaseSupport.le_add_left",
"proofType": "tactic",
"proofLengthLines": 3,
"proofLengthTokens": 67
} |
import ConNF.Model.Result
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
def union (x y : TSet α) : TSet α :=
(xᶜ' ⊓' yᶜ')ᶜ'
notation:68 x:68 " ⊔[" h "] " y:68 => _root_.ConNF.union h x y
notation:68 x:68 " ⊔' " y:68 => x ⊔[by assumption] y
@[simp]
theorem mem_union_iff (x y : TSet α) :
∀ z : TSet β, z ∈' x ⊔' y ↔ z ∈' x ∨ z ∈' y := by
rw [union]
intro z
rw [mem_compl_iff, mem_inter_iff, mem_compl_iff, mem_compl_iff, or_iff_not_and_not]
def higherIndex (α : Λ) : Λ :=
(exists_gt α).choose
theorem lt_higherIndex {α : Λ} :
(α : TypeIndex) < higherIndex α :=
WithBot.coe_lt_coe.mpr (exists_gt α).choose_spec
theorem tSet_nonempty (h : ∃ β : Λ, (β : TypeIndex) < α) : Nonempty (TSet α) := by
obtain ⟨α', hα⟩ := h
constructor
apply typeLower lt_higherIndex lt_higherIndex lt_higherIndex hα
apply cardinalOne lt_higherIndex lt_higherIndex
def empty : TSet α :=
(tSet_nonempty ⟨β, hβ⟩).some ⊓' (tSet_nonempty ⟨β, hβ⟩).someᶜ'
@[simp]
theorem mem_empty_iff :
∀ x : TSet β, ¬x ∈' empty hβ := by
intro x
rw [empty, mem_inter_iff, mem_compl_iff]
exact and_not_self
def univ : TSet α :=
(empty hβ)ᶜ'
@[simp]
theorem mem_univ_iff :
∀ x : TSet β, x ∈' univ hβ := by
intro x
simp only [univ, mem_compl_iff, mem_empty_iff, not_false_eq_true]
/-- The set of all ordered pairs. -/
def orderedPairs : TSet α :=
vCross hβ hγ hδ (univ hδ)
@[simp]
theorem mem_orderedPairs_iff (x : TSet β) :
x ∈' orderedPairs hβ hγ hδ ↔ ∃ a b, x = ⟨a, b⟩' := by
simp only [orderedPairs, vCross_spec, mem_univ_iff, and_true]
def converse (x : TSet α) : TSet α :=
converse' hβ hγ hδ x ⊓' orderedPairs hβ hγ hδ
| @[simp]
theorem op_mem_converse_iff (x : TSet α) :
∀ a b, ⟨a, b⟩' ∈' converse hβ hγ hδ x ↔ ⟨b, a⟩' ∈' x | ConNF.op_mem_converse_iff | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | ConNF/ConNF/External/Basic.lean | ConNF.External.Basic | ConNF.External.Basic.jsonl | {
"lineInFile": 80,
"tokenPositionInFile": 1953,
"theoremPositionInFile": 14
} | {
"inFilePremises": true,
"numInFilePremises": 3,
"repositoryPremises": true,
"numRepositoryPremises": 18,
"numPremises": 44
} | {
"hasProof": true,
"proof": ":= by\n intro a b\n simp only [converse, mem_inter_iff, converse'_spec, mem_orderedPairs_iff, op_inj, exists_and_left,\n exists_eq', and_true]",
"proofType": "tactic",
"proofLengthLines": 3,
"proofLengthTokens": 144
} |
import ConNF.Model.Externalise
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal
namespace ConNF
variable [Params.{u}] {β γ : Λ} {hγ : (γ : TypeIndex) < β}
namespace Support
theorem not_mem_scoderiv_botDeriv (S : Support γ) (N : NearLitter) :
N ∉ (S ↗ hγ ⇘. (Path.nil ↘.))ᴺ := by
rintro ⟨i, ⟨A, N'⟩, h₁, h₂⟩
simp only [Prod.mk.injEq] at h₂
cases A
case sderiv δ A hδ _ =>
simp only [Path.deriv_sderiv] at h₂
cases A
case nil => cases h₂.1
case sderiv ζ A hζ _ =>
simp only [Path.deriv_sderiv] at h₂
cases h₂.1
variable [Level] [LtLevel β]
theorem not_mem_strong_botDeriv (S : Support γ) (N : NearLitter) :
N ∉ ((S ↗ hγ).strong ⇘. (Path.nil ↘.))ᴺ := by
rintro h
rw [strong, close_nearLitters, preStrong_nearLitters, Enumeration.mem_add_iff] at h
obtain h | h := h
· exact not_mem_scoderiv_botDeriv S N h
· rw [mem_constrainsNearLitters_nearLitters] at h
obtain ⟨B, N', hN', h⟩ := h
cases h using Relation.ReflTransGen.head_induction_on
case refl => exact not_mem_scoderiv_botDeriv S N hN'
case head x hx₁ hx₂ _ =>
obtain ⟨⟨γ, δ, ε, hδ, hε, hδε, A⟩, t, B, hB, hN, ht⟩ := hx₂
simp only at hB
cases B
case nil =>
cases hB
obtain ⟨C, N''⟩ := x
simp only at ht
cases ht.1
change _ ∈ t.supportᴺ at hN
rw [t.support_supports.2 rfl] at hN
obtain ⟨i, hN⟩ := hN
cases hN
case sderiv δ B hδ _ _ =>
cases B
case nil => cases hB
case sderiv ζ B hζ _ _ => cases hB
theorem raise_preStrong' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).PreStrong := by
apply hS.toPreStrong.add
constructor
intro A N hN P t hA ht
obtain ⟨A, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN
simp only [scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, interferenceSupport_nearLitters,
Enumeration.mem_add_iff, Enumeration.mem_smul, Enumeration.not_mem_empty, or_false] at hN
obtain ⟨δ, ε, ζ, hε, hζ, hεζ, B⟩ := P
dsimp only at *
cases A
case sderiv ζ' A hζ' _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_left_inj.mp at hA
cases A
case nil =>
cases hA
cases not_mem_strong_botDeriv T _ hN
case sderiv ι A hι _ _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
cases hA
haveI : LtLevel δ := ⟨A.le.trans_lt LtLevel.elim⟩
haveI : LtLevel ε := ⟨hε.trans LtLevel.elim⟩
haveI : LtLevel ζ := ⟨hζ.trans LtLevel.elim⟩
have := (T ↗ hγ).strong_strong.support_le hN ⟨δ, ε, ζ, hε, hζ, hεζ, A⟩
(ρ⁻¹ ⇘ A ↘ hε • t) rfl ?_
· simp only [Tangle.smul_support, allPermSderiv_forget, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv] at this
have := smul_le_smul this (ρᵁ ⇘ A ↘ hε)
simp only [smul_inv_smul] at this
apply le_trans this
intro B
constructor
· intro a ha
simp only [smul_derivBot, Tree.sderiv_apply, Tree.deriv_apply, Path.deriv_scoderiv,
deriv_derivBot, Enumeration.mem_smul] at ha
rw [deriv_derivBot, ← Path.deriv_scoderiv, Path.coderiv_deriv', scoderiv_botDeriv_eq,]
simp only [Path.deriv_scoderiv, add_derivBot, smul_derivBot,
BaseSupport.add_atoms, BaseSupport.smul_atoms, Enumeration.mem_add_iff,
Enumeration.mem_smul]
exact Or.inl ha
· intro N hN
simp only [smul_derivBot, Tree.sderiv_apply, Tree.deriv_apply, Path.deriv_scoderiv,
deriv_derivBot, Enumeration.mem_smul] at hN
rw [deriv_derivBot, ← Path.deriv_scoderiv, Path.coderiv_deriv', scoderiv_botDeriv_eq,]
simp only [Path.deriv_scoderiv, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul]
exact Or.inl hN
· rw [← smul_fuzz hε hζ hεζ, ← ht]
simp only [Path.botSderiv_coe_eq, BasePerm.smul_nearLitter_litter, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.inv_sderivBot]
rfl
theorem raise_closed' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β)
(hρ : ρᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).Closed := by
constructor
intro A
constructor
intro N₁ N₂ hN₁ hN₂ a ha
simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff,
BaseSupport.add_atoms] at hN₁ hN₂ ⊢
obtain hN₁ | hN₁ := hN₁
· obtain hN₂ | hN₂ := hN₂
· exact Or.inl ((hS.closed A).interference_subset hN₁ hN₂ a ha)
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN₂
simp only [smul_add, scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul, BaseSupport.add_atoms, BaseSupport.smul_atoms] at hN₁ hN₂ ⊢
refine Or.inr (Or.inr ?_)
rw [mem_interferenceSupport_atoms]
refine ⟨(ρᵁ B)⁻¹ • N₁, ?_, (ρᵁ B)⁻¹ • N₂, ?_, ?_⟩
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
rw [← Enumeration.mem_smul, ← BaseSupport.smul_nearLitters, ← smul_derivBot, hρ]
exact Or.inl hN₁
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₂
exact Or.inr hN₂
· rw [← BasePerm.smul_interference]
exact Set.smul_mem_smul_set ha
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN₁
simp only [smul_add, scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul, BaseSupport.add_atoms, BaseSupport.smul_atoms] at hN₁ hN₂ ⊢
refine Or.inr (Or.inr ?_)
rw [mem_interferenceSupport_atoms]
refine ⟨(ρᵁ B)⁻¹ • N₁, ?_, (ρᵁ B)⁻¹ • N₂, ?_, ?_⟩
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₁
exact Or.inr hN₁
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₂
obtain hN₂ | hN₂ := hN₂
· rw [← Enumeration.mem_smul, ← BaseSupport.smul_nearLitters, ← smul_derivBot, hρ]
exact Or.inl hN₂
· exact Or.inr hN₂
· rw [← BasePerm.smul_interference]
exact Set.smul_mem_smul_set ha
theorem raise_strong' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β)
(hρ : ρᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).Strong :=
⟨raise_preStrong' S hS T ρ hγ, raise_closed' S hS T ρ hγ hρ⟩
theorem convAtoms_injective_of_fixes {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(A : ↑α ↝ ⊥) :
(convAtoms
(S + (ρ₁ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim) A).Injective := by
rw [Support.smul_eq_iff] at hρ₁ hρ₂
constructor
rintro a₁ a₂ a₃ ⟨i, hi₁, hi₂⟩ ⟨j, hj₁, hj₂⟩
simp only [add_derivBot, BaseSupport.add_atoms, Rel.inv_apply,
Enumeration.rel_add_iff] at hi₁ hi₂ hj₁ hj₂
obtain hi₁ | ⟨i, rfl, hi₁⟩ := hi₁
· obtain hi₂ | ⟨i', rfl, _⟩ := hi₂
swap
· have := Enumeration.lt_bound _ _ ⟨_, hi₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i').not_lt this
cases (Enumeration.rel_coinjective _).coinjective hi₁ hi₂
obtain hj₁ | ⟨j, rfl, hj₁⟩ := hj₁
· obtain hj₂ | ⟨j', rfl, _⟩ := hj₂
· exact (Enumeration.rel_coinjective _).coinjective hj₂ hj₁
· have := Enumeration.lt_bound _ _ ⟨_, hj₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j').not_lt this
· obtain hj₂ | hj₂ := hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
· simp only [add_right_inj, exists_eq_left] at hj₂
obtain ⟨B, rfl⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨j, hj₁⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,
BaseSupport.add_atoms, Enumeration.smul_rel, add_right_inj, exists_eq_left] at hj₁ hj₂
have := (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
rw [← (hρ₂ B).1 a₁ ⟨_, hi₁⟩, inv_smul_smul, inv_smul_eq_iff, (hρ₁ B).1 a₁ ⟨_, hi₁⟩] at this
exact this.symm
· obtain ⟨B, rfl⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨i, hi₁⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,
BaseSupport.add_atoms, Enumeration.smul_rel, add_right_inj, exists_eq_left] at hi₁ hi₂ hj₁ hj₂
obtain hi₂ | hi₂ := hi₂
· have := Enumeration.lt_bound _ _ ⟨_, hi₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i).not_lt this
have hi := (Enumeration.rel_coinjective _).coinjective hi₁ hi₂
suffices hj : (ρ₁ᵁ B)⁻¹ • a₂ = (ρ₂ᵁ B)⁻¹ • a₃ by
rwa [← hj, smul_left_cancel_iff] at hi
obtain hj₁ | ⟨j, rfl, hj₁⟩ := hj₁
· obtain hj₂ | ⟨j', rfl, _⟩ := hj₂
· rw [← (hρ₁ B).1 a₂ ⟨_, hj₁⟩, ← (hρ₂ B).1 a₃ ⟨_, hj₂⟩, inv_smul_smul, inv_smul_smul]
exact (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j').not_lt this
· obtain hj₂ | hj₂ := hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
· simp only [add_right_inj, exists_eq_left] at hj₂
exact (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
| theorem atomMemRel_le_of_fixes {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(A : ↑α ↝ ⊥) :
atomMemRel (S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A ≤
atomMemRel (S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A | ConNF.Support.atomMemRel_le_of_fixes | {
"commit": "abf71bc79c407ceb462cc2edd2d994cda9cdef05",
"date": "2024-04-04T00:00:00"
} | {
"commit": "7965dba9f7fcbea5f6e2d5e3c622db5790f2f494",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/Model/RaiseStrong.lean | ConNF.Model.RaiseStrong | ConNF.Model.RaiseStrong.jsonl | {
"lineInFile": 244,
"tokenPositionInFile": 10746,
"theoremPositionInFile": 6
} | {
"inFilePremises": false,
"numInFilePremises": 0,
"repositoryPremises": true,
"numRepositoryPremises": 71,
"numPremises": 146
} | {
"hasProof": true,
"proof": ":= by\n rw [Support.smul_eq_iff] at hρ₁ hρ₂\n rintro i j ⟨N, hN, a, haN, ha⟩\n simp only [add_derivBot, BaseSupport.add_atoms, Rel.inv_apply, Enumeration.rel_add_iff,\n BaseSupport.add_nearLitters] at ha hN\n obtain hN | ⟨i, rfl, hi⟩ := hN\n · obtain ha | ⟨j, rfl, hj⟩ := ha\n · exact ⟨N, Or.inl hN, a, haN, Or.inl ha⟩\n · obtain ⟨B, rfl⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨j, hj⟩\n simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,\n BaseSupport.add_atoms, Enumeration.smul_rel] at hj hN\n refine ⟨N, Or.inl hN, ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • a, ?_, ?_⟩\n · dsimp only\n rw [← (hρ₂ B).2 N ⟨_, hN⟩, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]\n have := (hρ₁ B).2 N ⟨_, hN⟩\n rw [smul_eq_iff_eq_inv_smul] at this\n rwa [this, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]\n · rw [Rel.inv_apply, add_derivBot, BaseSupport.add_atoms, Enumeration.rel_add_iff]\n simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,\n BaseSupport.smul_atoms, BaseSupport.add_atoms, Enumeration.smul_rel, inv_smul_smul,\n exists_eq_left]\n exact Or.inr hj\n · obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv ⟨i, hi⟩\n simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,\n BaseSupport.add_atoms, Enumeration.smul_rel] at hi ha\n obtain ha | ⟨j, rfl, hj⟩ := ha\n · refine ⟨ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • N, ?_, a, ?_, Or.inl ha⟩\n · rw [add_derivBot, BaseSupport.add_nearLitters, Enumeration.rel_add_iff]\n simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,\n BaseSupport.smul_nearLitters, BaseSupport.add_nearLitters, Enumeration.smul_rel,\n inv_smul_smul, exists_eq_left]\n exact Or.inr hi\n · dsimp only\n rw [← (hρ₂ B).1 a ⟨_, ha⟩, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]\n have := (hρ₁ B).1 a ⟨_, ha⟩\n rw [smul_eq_iff_eq_inv_smul] at this\n rwa [this, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]\n · refine ⟨ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • N, ?_, ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • a, ?_, ?_⟩\n · rw [add_derivBot, BaseSupport.add_nearLitters, Enumeration.rel_add_iff]\n simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,\n BaseSupport.smul_nearLitters, BaseSupport.add_nearLitters, Enumeration.smul_rel,\n inv_smul_smul, exists_eq_left]\n exact Or.inr hi\n · simp only [BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]\n exact haN\n · rw [Rel.inv_apply, add_derivBot, BaseSupport.add_atoms, Enumeration.rel_add_iff]\n simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,\n BaseSupport.smul_atoms, BaseSupport.add_atoms, Enumeration.smul_rel, inv_smul_smul,\n exists_eq_left]\n exact Or.inr hj",
"proofType": "tactic",
"proofLengthLines": 49,
"proofLengthTokens": 2905
} |
import ConNF.Model.Result
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
def union (x y : TSet α) : TSet α :=
(xᶜ' ⊓' yᶜ')ᶜ'
notation:68 x:68 " ⊔[" h "] " y:68 => _root_.ConNF.union h x y
notation:68 x:68 " ⊔' " y:68 => x ⊔[by assumption] y
@[simp]
theorem mem_union_iff (x y : TSet α) :
∀ z : TSet β, z ∈' x ⊔' y ↔ z ∈' x ∨ z ∈' y := by
rw [union]
intro z
rw [mem_compl_iff, mem_inter_iff, mem_compl_iff, mem_compl_iff, or_iff_not_and_not]
def higherIndex (α : Λ) : Λ :=
(exists_gt α).choose
theorem lt_higherIndex {α : Λ} :
(α : TypeIndex) < higherIndex α :=
WithBot.coe_lt_coe.mpr (exists_gt α).choose_spec
theorem tSet_nonempty (h : ∃ β : Λ, (β : TypeIndex) < α) : Nonempty (TSet α) := by
obtain ⟨α', hα⟩ := h
constructor
apply typeLower lt_higherIndex lt_higherIndex lt_higherIndex hα
apply cardinalOne lt_higherIndex lt_higherIndex
def empty : TSet α :=
(tSet_nonempty ⟨β, hβ⟩).some ⊓' (tSet_nonempty ⟨β, hβ⟩).someᶜ'
@[simp]
theorem mem_empty_iff :
∀ x : TSet β, ¬x ∈' empty hβ := by
intro x
rw [empty, mem_inter_iff, mem_compl_iff]
exact and_not_self
def univ : TSet α :=
(empty hβ)ᶜ'
@[simp]
theorem mem_univ_iff :
∀ x : TSet β, x ∈' univ hβ := by
intro x
simp only [univ, mem_compl_iff, mem_empty_iff, not_false_eq_true]
/-- The set of all ordered pairs. -/
def orderedPairs : TSet α :=
vCross hβ hγ hδ (univ hδ)
@[simp]
theorem mem_orderedPairs_iff (x : TSet β) :
x ∈' orderedPairs hβ hγ hδ ↔ ∃ a b, x = ⟨a, b⟩' := by
simp only [orderedPairs, vCross_spec, mem_univ_iff, and_true]
def converse (x : TSet α) : TSet α :=
converse' hβ hγ hδ x ⊓' orderedPairs hβ hγ hδ
@[simp]
theorem op_mem_converse_iff (x : TSet α) :
∀ a b, ⟨a, b⟩' ∈' converse hβ hγ hδ x ↔ ⟨b, a⟩' ∈' x := by
intro a b
simp only [converse, mem_inter_iff, converse'_spec, mem_orderedPairs_iff, op_inj, exists_and_left,
exists_eq', and_true]
def cross (x y : TSet γ) : TSet α :=
converse hβ hγ hδ (vCross hβ hγ hδ x) ⊓' vCross hβ hγ hδ y
@[simp]
theorem mem_cross_iff (x y : TSet γ) :
∀ a, a ∈' cross hβ hγ hδ x y ↔ ∃ b c, a = ⟨b, c⟩' ∧ b ∈' x ∧ c ∈' y := by
intro a
rw [cross, mem_inter_iff, vCross_spec]
constructor
· rintro ⟨h₁, b, c, rfl, h₂⟩
simp only [op_mem_converse_iff, vCross_spec, op_inj] at h₁
obtain ⟨b', c', ⟨rfl, rfl⟩, h₁⟩ := h₁
exact ⟨b, c, rfl, h₁, h₂⟩
· rintro ⟨b, c, rfl, h₁, h₂⟩
simp only [op_mem_converse_iff, vCross_spec, op_inj]
exact ⟨⟨c, b, ⟨rfl, rfl⟩, h₁⟩, ⟨b, c, ⟨rfl, rfl⟩, h₂⟩⟩
def singletonImage (x : TSet β) : TSet α :=
singletonImage' hβ hγ hδ hε x ⊓' (cross hβ hγ hδ (cardinalOne hδ hε) (cardinalOne hδ hε))
@[simp]
theorem singletonImage_spec (x : TSet β) :
∀ z w,
⟨ {z}', {w}' ⟩' ∈' singletonImage hβ hγ hδ hε x ↔ ⟨z, w⟩' ∈' x := by
intro z w
rw [singletonImage, mem_inter_iff, singletonImage'_spec, and_iff_left_iff_imp]
intro hzw
rw [mem_cross_iff]
refine ⟨{z}', {w}', rfl, ?_⟩
simp only [mem_cardinalOne_iff, singleton_inj, exists_eq', and_self]
theorem exists_of_mem_singletonImage {x : TSet β} {z w : TSet δ}
(h : ⟨z, w⟩' ∈' singletonImage hβ hγ hδ hε x) :
∃ a b, z = {a}' ∧ w = {b}' := by
simp only [singletonImage, mem_inter_iff, mem_cross_iff, op_inj, mem_cardinalOne_iff] at h
obtain ⟨-, _, _, ⟨rfl, rfl⟩, ⟨a, rfl⟩, ⟨b, rfl⟩⟩ := h
exact ⟨a, b, rfl, rfl⟩
/-- Turn a model element encoding a relation into an actual relation. -/
def ExternalRel (r : TSet α) : Rel (TSet δ) (TSet δ) :=
λ x y ↦ ⟨x, y⟩' ∈' r
@[simp]
theorem externalRel_converse (r : TSet α) :
ExternalRel hβ hγ hδ (converse hβ hγ hδ r) = (ExternalRel hβ hγ hδ r).inv := by
ext
simp only [ExternalRel, op_mem_converse_iff, Rel.inv_apply]
/-- The codomain of a relation. -/
def codom (r : TSet α) : TSet γ :=
(typeLower lt_higherIndex hβ hγ hδ (singletonImage lt_higherIndex hβ hγ hδ r)ᶜ[lt_higherIndex])ᶜ'
@[simp]
theorem mem_codom_iff (r : TSet α) (x : TSet δ) :
x ∈' codom hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).codom := by
simp only [codom, mem_compl_iff, mem_typeLower_iff, not_forall, not_not]
constructor
· rintro ⟨y, hy⟩
obtain ⟨a, b, rfl, hb⟩ := exists_of_mem_singletonImage lt_higherIndex hβ hγ hδ hy
rw [singleton_inj] at hb
subst hb
rw [singletonImage_spec] at hy
exact ⟨a, hy⟩
· rintro ⟨a, ha⟩
use {a}'
rw [singletonImage_spec]
exact ha
/-- The domain of a relation. -/
def dom (r : TSet α) : TSet γ :=
codom hβ hγ hδ (converse hβ hγ hδ r)
@[simp]
theorem mem_dom_iff (r : TSet α) (x : TSet δ) :
x ∈' dom hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).dom := by
rw [dom, mem_codom_iff, externalRel_converse, Rel.inv_codom]
/-- The field of a relation. -/
def field (r : TSet α) : TSet γ :=
dom hβ hγ hδ r ⊔' codom hβ hγ hδ r
@[simp]
theorem mem_field_iff (r : TSet α) (x : TSet δ) :
x ∈' field hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).field := by
rw [field, mem_union_iff, mem_dom_iff, mem_codom_iff, Rel.field, Set.mem_union]
def subset : TSet α :=
subset' hβ hγ hδ hε ⊓' orderedPairs hβ hγ hδ
@[simp]
theorem subset_spec :
∀ a b, ⟨a, b⟩' ∈' subset hβ hγ hδ hε ↔ a ⊆[TSet ε] b := by
intro a b
simp only [subset, mem_inter_iff, subset'_spec, mem_orderedPairs_iff, op_inj, exists_and_left,
exists_eq', and_true]
def membership : TSet α :=
subset hβ hγ hδ hε ⊓' cross hβ hγ hδ (cardinalOne hδ hε) (univ hδ)
@[simp]
theorem membership_spec :
∀ a b, ⟨{a}', b⟩' ∈' membership hβ hγ hδ hε ↔ a ∈' b := by
intro a b
rw [membership, mem_inter_iff, subset_spec]
simp only [mem_cross_iff, op_inj, mem_cardinalOne_iff, mem_univ_iff, and_true, exists_and_right,
exists_and_left, exists_eq', exists_eq_left', singleton_inj]
constructor
· intro h
exact h a ((typedMem_singleton_iff' hε a a).mpr rfl)
· intro h c hc
simp only [typedMem_singleton_iff'] at hc
cases hc
exact h
def powerset (x : TSet β) : TSet α :=
dom lt_higherIndex lt_higherIndex hβ
(subset lt_higherIndex lt_higherIndex hβ hγ ⊓[lt_higherIndex]
vCross lt_higherIndex lt_higherIndex hβ {x}')
@[simp]
theorem mem_powerset_iff (x y : TSet β) :
x ∈' powerset hβ hγ y ↔ x ⊆[TSet γ] y := by
rw [powerset, mem_dom_iff]
constructor
· rintro ⟨z, h⟩
simp only [ExternalRel, mem_inter_iff, subset_spec, vCross_spec, op_inj,
typedMem_singleton_iff', exists_eq_right, exists_and_right, exists_eq', true_and] at h
cases h.2
exact h.1
· intro h
refine ⟨y, ?_⟩
simp only [ExternalRel, mem_inter_iff, subset_spec, h, vCross_spec, op_inj,
typedMem_singleton_iff', exists_eq_right, and_true, exists_eq', and_self]
/-- The set `ι²''x = {{{a}} | a ∈ x}`. -/
def doubleSingleton (x : TSet γ) : TSet α :=
cross hβ hγ hδ x x ⊓' cardinalOne hβ hγ
| @[simp]
theorem mem_doubleSingleton_iff (x : TSet γ) :
∀ y : TSet β, y ∈' doubleSingleton hβ hγ hδ x ↔
∃ z : TSet δ, z ∈' x ∧ y = { {z}' }' | ConNF.mem_doubleSingleton_iff | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | {
"commit": "6dd8406a01cc28b071bb26965294469664a1b592",
"date": "2025-01-07T00:00:00"
} | ConNF/ConNF/External/Basic.lean | ConNF.External.Basic | ConNF.External.Basic.jsonl | {
"lineInFile": 225,
"tokenPositionInFile": 7029,
"theoremPositionInFile": 35
} | {
"inFilePremises": true,
"numInFilePremises": 3,
"repositoryPremises": true,
"numRepositoryPremises": 19,
"numPremises": 49
} | {
"hasProof": true,
"proof": ":= by\n intro y\n rw [doubleSingleton, mem_inter_iff, mem_cross_iff, mem_cardinalOne_iff]\n constructor\n · rintro ⟨⟨b, c, h₁, h₂, h₃⟩, ⟨a, rfl⟩⟩\n obtain ⟨hbc, rfl⟩ := (op_eq_singleton_iff _ _ _ _ _).mp h₁.symm\n exact ⟨c, h₃, rfl⟩\n · rintro ⟨z, h, rfl⟩\n constructor\n · refine ⟨z, z, ?_⟩\n rw [eq_comm, op_eq_singleton_iff]\n tauto\n · exact ⟨_, rfl⟩",
"proofType": "tactic",
"proofLengthLines": 12,
"proofLengthTokens": 372
} |
import ConNF.Model.RunInduction
/-!
# Externalisation
In this file, we convert many of our *internal* results (i.e. inside the induction) to *external*
ones (i.e. defined using the global `TSet`/`AllPerm` definitions).
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal WithBot
namespace ConNF
variable [Params.{u}]
instance globalModelData : {α : TypeIndex} → ModelData α
| (α : Λ) => (motive α).data
| ⊥ => botModelData
instance globalPosition : {α : TypeIndex} → Position (Tangle α)
| (α : Λ) => (motive α).pos
| ⊥ => botPosition
instance globalTypedNearLitters {α : Λ} : TypedNearLitters α :=
(motive α).typed
instance globalLtData [Level] : LtData where
instance globalLeData [Level] : LeData where
omit [Params] in
theorem heq_funext {α : Sort _} {β γ : α → Sort _} {f : (x : α) → β x} {g : (x : α) → γ x}
(h : ∀ x, HEq (f x) (g x)) : HEq f g := by
cases funext λ x ↦ type_eq_of_heq (h x)
simp only [heq_eq_eq] at h ⊢
exact funext h
theorem globalLtData_eq [Level] :
globalLtData = ltData (λ β _ ↦ motive β) := by
apply LtData.ext
· ext β hβ
induction β using recBotCoe
case bot => rfl
case coe β => rfl
· apply heq_funext
intro β
induction β using recBotCoe
case bot => rfl
case coe β => rfl
· rfl
theorem globalLeData_eq [Level] :
globalLeData = leData (λ β _ ↦ motive β) := by
apply LeData.ext
· ext β hβ
induction β using recBotCoe
case bot => rfl
case coe β =>
by_cases h : (β : TypeIndex) = α
· cases coe_injective h
rw [leData_data_eq]
unfold globalLeData globalModelData
dsimp only
rw [motive_eq]
rfl
· rw [leData_data_lt _ (hβ.elim.lt_of_ne h)]
rfl
· apply heq_funext
intro β
apply heq_funext
intro hβ
induction β using recBotCoe
case bot => rfl
case coe β =>
rw [leData]
simp only [coe_inj, id_eq, eq_mpr_eq_cast, recBotCoe_bot, recBotCoe_coe, LtLevel.elim.ne]
exact HEq.symm (cast_heq _ _)
instance globalPreCoherentData [Level] : PreCoherentData where
allPermSderiv h := cast (by rw [globalLeData_eq])
((preCoherentData (λ β _ ↦ motive β) (λ β _ ↦ hypothesis β)).allPermSderiv h)
singleton h := cast (by rw [globalLeData_eq])
((preCoherentData (λ β _ ↦ motive β) (λ β _ ↦ hypothesis β)).singleton h)
omit [Params] in
| @[simp]
theorem heq_cast_eq_iff {α β γ : Type _} {x : α} {y : β} {h : α = γ} :
HEq (cast h x) y ↔ HEq x y | ConNF.heq_cast_eq_iff | {
"commit": "6fdc87c6b30b73931407a372f1430ecf0fef7601",
"date": "2024-12-03T00:00:00"
} | {
"commit": "e409f3d0cd939e7218c3f39dcf3493c4b6e0b821",
"date": "2024-11-29T00:00:00"
} | ConNF/ConNF/Model/Externalise.lean | ConNF.Model.Externalise | ConNF.Model.Externalise.jsonl | {
"lineInFile": 93,
"tokenPositionInFile": 2413,
"theoremPositionInFile": 3
} | {
"inFilePremises": false,
"numInFilePremises": 0,
"repositoryPremises": false,
"numRepositoryPremises": 0,
"numPremises": 15
} | {
"hasProof": true,
"proof": ":= by\n cases h\n rw [cast_eq]",
"proofType": "tactic",
"proofLengthLines": 2,
"proofLengthTokens": 30
} |
import ConNF.ModelData.Enumeration
import ConNF.Levels.StrPerm
/-!
# Enumerations over paths
In this file, we provide extra features to `Enumeration`s that take values of the form `α ↝ ⊥ × X`.
## Main declarations
* `ConNF.Enumeration.ext_path`: An extensionality principle for such `Enumeration`s.
-/
noncomputable section
universe u
open Cardinal Ordinal
namespace ConNF
variable [Params.{u}]
namespace Enumeration
/-- A helper function for making relations with domain and codomain of the form `α ↝ ⊥ × X`
by defining it on each branch. -/
def relWithPath {X Y : Type u} {α : TypeIndex} (f : α ↝ ⊥ → Rel X Y) :
Rel (α ↝ ⊥ × X) (α ↝ ⊥ × Y) :=
λ x y ↦ x.1 = y.1 ∧ f x.1 x.2 y.2
theorem relWithPath_coinjective {X Y : Type u} {α : TypeIndex} {f : α ↝ ⊥ → Rel X Y}
(hf : ∀ A, (f A).Coinjective) :
(relWithPath f).Coinjective := by
constructor
rintro ⟨_, y₁⟩ ⟨_, y₂⟩ ⟨A, x⟩ ⟨rfl, h₁⟩ ⟨rfl, h₂⟩
cases (hf A).coinjective h₁ h₂
rfl
instance (X : Type u) (α β : TypeIndex) :
Derivative (Enumeration (α ↝ ⊥ × X)) (Enumeration (β ↝ ⊥ × X)) α β where
deriv E A := E.invImage (λ x ↦ (x.1 ⇗ A, x.2))
(λ x y h ↦ Prod.ext (Path.deriv_right_injective
((Prod.mk.injEq _ _ _ _).mp h).1) ((Prod.mk.injEq _ _ _ _).mp h).2)
theorem deriv_rel {X : Type _} {α β : TypeIndex} (E : Enumeration (α ↝ ⊥ × X)) (A : α ↝ β)
(i : κ) (x : β ↝ ⊥ × X) :
(E ⇘ A).rel i x ↔ E.rel i (x.1 ⇗ A, x.2) :=
Iff.rfl
instance (X : Type u) (α β : TypeIndex) :
Coderivative (Enumeration (β ↝ ⊥ × X)) (Enumeration (α ↝ ⊥ × X)) α β where
coderiv E A := E.image (λ x ↦ (x.1 ⇗ A, x.2))
theorem coderiv_rel {X : Type _} {α β : TypeIndex} (E : Enumeration (β ↝ ⊥ × X)) (A : α ↝ β)
(i : κ) (x : α ↝ ⊥ × X) :
(E ⇗ A).rel i x ↔ ∃ B, x.1 = A ⇘ B ∧ E.rel i (B, x.2) := by
constructor
· rintro ⟨x, h, rfl⟩
exact ⟨_, rfl, h⟩
· rintro ⟨B, h₁, h₂⟩
refine ⟨(B, x.2), h₂, ?_⟩
apply Prod.ext
· dsimp only
exact h₁.symm
· rfl
theorem scoderiv_rel {X : Type _} {α β : TypeIndex} (E : Enumeration (β ↝ ⊥ × X)) (h : β < α)
(i : κ) (x : α ↝ ⊥ × X) :
(E ↗ h).rel i x ↔ ∃ B, x.1 = B ↗ h ∧ E.rel i (B, x.2) :=
coderiv_rel E (.single h) i x
theorem eq_of_scoderiv_mem {X : Type _} {α β γ : TypeIndex} (E : Enumeration (β ↝ ⊥ × X))
(h : β < α) (h' : γ < α)
(i : κ) (A : γ ↝ ⊥) (x : X) (h : (E ↗ h).rel i ⟨A ↗ h', x⟩) :
β = γ := by
rw [scoderiv_rel] at h
obtain ⟨B, h₁, h₂⟩ := h
exact Path.scoderiv_index_injective h₁.symm
instance (X : Type u) (α : TypeIndex) :
BotDerivative (Enumeration (α ↝ ⊥ × X)) (Enumeration X) α where
botDeriv E A := E.invImage (λ x ↦ (A, x)) (Prod.mk.inj_left A)
botSderiv E := E.invImage (λ x ↦ (Path.nil ↘., x)) (Prod.mk.inj_left (Path.nil ↘.))
botDeriv_single E h := by
cases α using WithBot.recBotCoe with
| bot => cases lt_irrefl ⊥ h
| coe => rfl
theorem derivBot_rel {X : Type _} {α : TypeIndex} (E : Enumeration (α ↝ ⊥ × X)) (A : α ↝ ⊥)
(i : κ) (x : X) :
(E ⇘. A).rel i x ↔ E.rel i (A, x) :=
Iff.rfl
@[simp]
theorem mem_path_iff {X : Type _} {α : TypeIndex} (E : Enumeration (α ↝ ⊥ × X))
(A : α ↝ ⊥) (x : X) :
(A, x) ∈ E ↔ x ∈ E ⇘. A :=
Iff.rfl
theorem ext_path {X : Type u} {α : TypeIndex} {E F : Enumeration (α ↝ ⊥ × X)}
(h : ∀ A, E ⇘. A = F ⇘. A) :
E = F := by
ext i x
· have := congr_arg bound (h (Path.nil ↘.))
exact this
· have := congr_arg rel (h x.1)
exact iff_of_eq (congr_fun₂ this i x.2)
theorem deriv_derivBot {X : Type _} {α β : TypeIndex} (E : Enumeration (α ↝ ⊥ × X))
(A : α ↝ β) (B : β ↝ ⊥) :
E ⇘ A ⇘. B = E ⇘. (A ⇘ B) :=
rfl
@[simp]
theorem coderiv_deriv_eq {X : Type _} {α β : TypeIndex} (E : Enumeration (β ↝ ⊥ × X)) (A : α ↝ β) :
E ⇗ A ⇘ A = E := by
apply ext_path
intro B
ext i x
· rfl
· simp only [derivBot_rel, deriv_rel, coderiv_rel,
Path.coderiv_eq_deriv, Path.deriv_right_inj, exists_eq_left']
theorem eq_of_mem_scoderiv_botDeriv {X : Type _} {α β : TypeIndex} {S : Enumeration (β ↝ ⊥ × X)}
{A : α ↝ ⊥} {h : β < α} {x : X} (hx : x ∈ S ↗ h ⇘. A) :
∃ B : β ↝ ⊥, A = B ↗ h := by
obtain ⟨i, ⟨B, y⟩, hi₁, hi₂⟩ := hx
cases hi₂
exact ⟨B, rfl⟩
@[simp]
theorem scoderiv_botDeriv_eq {X : Type _} {α β : TypeIndex} (S : Enumeration (β ↝ ⊥ × X))
(A : β ↝ ⊥) (h : β < α) :
S ↗ h ⇘. (A ↗ h) = S ⇘. A := by
ext i x
· rfl
· simp only [derivBot_rel, scoderiv_rel, Path.scoderiv_left_inj, exists_eq_left']
theorem mulAction_aux {X : Type _} {α : TypeIndex} [MulAction BasePerm X] (π : StrPerm α) :
Function.Injective (λ x : α ↝ ⊥ × X ↦ (x.1, (π x.1)⁻¹ • x.2)) := by
rintro ⟨A₁, x₁⟩ ⟨A₂, x₂⟩ h
rw [Prod.mk.injEq] at h
cases h.1
exact Prod.ext h.1 (smul_left_cancel _ h.2)
instance {X : Type _} {α : TypeIndex} [MulAction BasePerm X] :
SMul (StrPerm α) (Enumeration (α ↝ ⊥ × X)) where
smul π E := E.invImage (λ x ↦ (x.1, (π x.1)⁻¹ • x.2)) (mulAction_aux π)
| @[simp]
theorem smulPath_rel {X : Type _} {α : TypeIndex} [MulAction BasePerm X]
(π : StrPerm α) (E : Enumeration (α ↝ ⊥ × X)) (i : κ) (x : α ↝ ⊥ × X) :
(π • E).rel i x ↔ E.rel i (x.1, (π x.1)⁻¹ • x.2) | ConNF.Enumeration.smulPath_rel | {
"commit": "39c33b4a743bea62dbcc549548b712ffd38ca65c",
"date": "2024-12-05T00:00:00"
} | {
"commit": "6709914ae7f5cd3e2bb24b413e09aa844554d234",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/ModelData/PathEnumeration.lean | ConNF.ModelData.PathEnumeration | ConNF.ModelData.PathEnumeration.jsonl | {
"lineInFile": 150,
"tokenPositionInFile": 4913,
"theoremPositionInFile": 14
} | {
"inFilePremises": true,
"numInFilePremises": 1,
"repositoryPremises": true,
"numRepositoryPremises": 12,
"numPremises": 27
} | {
"hasProof": true,
"proof": ":=\n Iff.rfl",
"proofType": "term",
"proofLengthLines": 1,
"proofLengthTokens": 12
} |
import ConNF.Model.Hailperin
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
theorem ext (x y : TSet α) :
(∀ z : TSet β, z ∈' x ↔ z ∈' y) → x = y :=
tSet_ext' hβ x y
def inter (x y : TSet α) : TSet α :=
(TSet.exists_inter hβ x y).choose
notation:69 x:69 " ⊓[" h "] " y:69 => _root_.ConNF.inter h x y
notation:69 x:69 " ⊓' " y:69 => x ⊓[by assumption] y
@[simp]
theorem mem_inter_iff (x y : TSet α) :
∀ z : TSet β, z ∈' x ⊓' y ↔ z ∈' x ∧ z ∈' y :=
(TSet.exists_inter hβ x y).choose_spec
def compl (x : TSet α) : TSet α :=
(TSet.exists_compl hβ x).choose
notation:1024 x:1024 " ᶜ[" h "]" => _root_.ConNF.compl h x
notation:1024 x:1024 " ᶜ'" => xᶜ[by assumption]
@[simp]
theorem mem_compl_iff (x : TSet α) :
∀ z : TSet β, z ∈' xᶜ' ↔ ¬z ∈' x :=
(TSet.exists_compl hβ x).choose_spec
notation:1024 "{" x "}[" h "]" => _root_.ConNF.singleton h x
notation:1024 "{" x "}'" => {x}[by assumption]
@[simp]
theorem mem_singleton_iff (x y : TSet β) :
y ∈' {x}' ↔ y = x :=
typedMem_singleton_iff' hβ x y
notation:1024 "{" x ", " y "}[" h "]" => _root_.ConNF.TSet.up h x y
notation:1024 "{" x ", " y "}'" => {x, y}[by assumption]
@[simp]
theorem mem_up_iff (x y z : TSet β) :
z ∈' {x, y}' ↔ z = x ∨ z = y :=
TSet.mem_up_iff hβ x y z
notation:1024 "⟨" x ", " y "⟩[" h ", " h' "]" => _root_.ConNF.TSet.op h h' x y
notation:1024 "⟨" x ", " y "⟩'" => ⟨x, y⟩[by assumption, by assumption]
theorem op_def (x y : TSet γ) :
(⟨x, y⟩' : TSet α) = { {x}', {x, y}' }' :=
rfl
def singletonImage' (x : TSet β) : TSet α :=
(TSet.exists_singletonImage hβ hγ hδ hε x).choose
@[simp]
theorem singletonImage'_spec (x : TSet β) :
∀ z w,
⟨ {z}', {w}' ⟩' ∈' singletonImage' hβ hγ hδ hε x ↔ ⟨z, w⟩' ∈' x :=
(TSet.exists_singletonImage hβ hγ hδ hε x).choose_spec
def insertion2' (x : TSet γ) : TSet α :=
(TSet.exists_insertion2 hβ hγ hδ hε hζ x).choose
@[simp]
theorem insertion2'_spec (x : TSet γ) :
∀ a b c, ⟨ { {a}' }', ⟨b, c⟩' ⟩' ∈' insertion2' hβ hγ hδ hε hζ x ↔
⟨a, c⟩' ∈' x :=
(TSet.exists_insertion2 hβ hγ hδ hε hζ x).choose_spec
def insertion3' (x : TSet γ) : TSet α :=
(TSet.exists_insertion3 hβ hγ hδ hε hζ x).choose
theorem insertion3'_spec (x : TSet γ) :
∀ a b c, ⟨ { {a}' }', ⟨b, c⟩' ⟩' ∈' insertion3' hβ hγ hδ hε hζ x ↔
⟨a, b⟩' ∈' x :=
(TSet.exists_insertion3 hβ hγ hδ hε hζ x).choose_spec
def vCross (x : TSet γ) : TSet α :=
(TSet.exists_cross hβ hγ hδ x).choose
@[simp]
theorem vCross_spec (x : TSet γ) :
∀ a, a ∈' vCross hβ hγ hδ x ↔ ∃ b c, a = ⟨b, c⟩' ∧ c ∈' x :=
(TSet.exists_cross hβ hγ hδ x).choose_spec
def typeLower (x : TSet α) : TSet δ :=
(TSet.exists_typeLower hβ hγ hδ hε x).choose
@[simp]
theorem mem_typeLower_iff (x : TSet α) :
∀ a, a ∈' typeLower hβ hγ hδ hε x ↔ ∀ b, ⟨ b, {a}' ⟩' ∈' x :=
(TSet.exists_typeLower hβ hγ hδ hε x).choose_spec
def converse' (x : TSet α) : TSet α :=
(TSet.exists_converse hβ hγ hδ x).choose
@[simp]
theorem converse'_spec (x : TSet α) :
∀ a b, ⟨a, b⟩' ∈' converse' hβ hγ hδ x ↔ ⟨b, a⟩' ∈' x :=
(TSet.exists_converse hβ hγ hδ x).choose_spec
def cardinalOne : TSet α :=
(TSet.exists_cardinalOne hβ hγ).choose
| @[simp]
theorem mem_cardinalOne_iff :
∀ a : TSet β, a ∈' cardinalOne hβ hγ ↔ ∃ b, a = {b}' | ConNF.mem_cardinalOne_iff | {
"commit": "b12701769822aaf5451982e26d7b7d1c2f21b137",
"date": "2024-04-11T00:00:00"
} | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | ConNF/ConNF/Model/Result.lean | ConNF.Model.Result | ConNF.Model.Result.jsonl | {
"lineInFile": 125,
"tokenPositionInFile": 3460,
"theoremPositionInFile": 31
} | {
"inFilePremises": true,
"numInFilePremises": 1,
"repositoryPremises": true,
"numRepositoryPremises": 12,
"numPremises": 26
} | {
"hasProof": true,
"proof": ":=\n (TSet.exists_cardinalOne hβ hγ).choose_spec",
"proofType": "term",
"proofLengthLines": 1,
"proofLengthTokens": 48
} |
import ConNF.Model.Result
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
def union (x y : TSet α) : TSet α :=
(xᶜ' ⊓' yᶜ')ᶜ'
notation:68 x:68 " ⊔[" h "] " y:68 => _root_.ConNF.union h x y
notation:68 x:68 " ⊔' " y:68 => x ⊔[by assumption] y
@[simp]
theorem mem_union_iff (x y : TSet α) :
∀ z : TSet β, z ∈' x ⊔' y ↔ z ∈' x ∨ z ∈' y := by
rw [union]
intro z
rw [mem_compl_iff, mem_inter_iff, mem_compl_iff, mem_compl_iff, or_iff_not_and_not]
def higherIndex (α : Λ) : Λ :=
(exists_gt α).choose
theorem lt_higherIndex {α : Λ} :
(α : TypeIndex) < higherIndex α :=
WithBot.coe_lt_coe.mpr (exists_gt α).choose_spec
theorem tSet_nonempty (h : ∃ β : Λ, (β : TypeIndex) < α) : Nonempty (TSet α) := by
obtain ⟨α', hα⟩ := h
constructor
apply typeLower lt_higherIndex lt_higherIndex lt_higherIndex hα
apply cardinalOne lt_higherIndex lt_higherIndex
def empty : TSet α :=
(tSet_nonempty ⟨β, hβ⟩).some ⊓' (tSet_nonempty ⟨β, hβ⟩).someᶜ'
@[simp]
theorem mem_empty_iff :
∀ x : TSet β, ¬x ∈' empty hβ := by
intro x
rw [empty, mem_inter_iff, mem_compl_iff]
exact and_not_self
def univ : TSet α :=
(empty hβ)ᶜ'
@[simp]
theorem mem_univ_iff :
∀ x : TSet β, x ∈' univ hβ := by
intro x
simp only [univ, mem_compl_iff, mem_empty_iff, not_false_eq_true]
/-- The set of all ordered pairs. -/
def orderedPairs : TSet α :=
vCross hβ hγ hδ (univ hδ)
@[simp]
theorem mem_orderedPairs_iff (x : TSet β) :
x ∈' orderedPairs hβ hγ hδ ↔ ∃ a b, x = ⟨a, b⟩' := by
simp only [orderedPairs, vCross_spec, mem_univ_iff, and_true]
def converse (x : TSet α) : TSet α :=
converse' hβ hγ hδ x ⊓' orderedPairs hβ hγ hδ
@[simp]
theorem op_mem_converse_iff (x : TSet α) :
∀ a b, ⟨a, b⟩' ∈' converse hβ hγ hδ x ↔ ⟨b, a⟩' ∈' x := by
intro a b
simp only [converse, mem_inter_iff, converse'_spec, mem_orderedPairs_iff, op_inj, exists_and_left,
exists_eq', and_true]
def cross (x y : TSet γ) : TSet α :=
converse hβ hγ hδ (vCross hβ hγ hδ x) ⊓' vCross hβ hγ hδ y
@[simp]
theorem mem_cross_iff (x y : TSet γ) :
∀ a, a ∈' cross hβ hγ hδ x y ↔ ∃ b c, a = ⟨b, c⟩' ∧ b ∈' x ∧ c ∈' y := by
intro a
rw [cross, mem_inter_iff, vCross_spec]
constructor
· rintro ⟨h₁, b, c, rfl, h₂⟩
simp only [op_mem_converse_iff, vCross_spec, op_inj] at h₁
obtain ⟨b', c', ⟨rfl, rfl⟩, h₁⟩ := h₁
exact ⟨b, c, rfl, h₁, h₂⟩
· rintro ⟨b, c, rfl, h₁, h₂⟩
simp only [op_mem_converse_iff, vCross_spec, op_inj]
exact ⟨⟨c, b, ⟨rfl, rfl⟩, h₁⟩, ⟨b, c, ⟨rfl, rfl⟩, h₂⟩⟩
def singletonImage (x : TSet β) : TSet α :=
singletonImage' hβ hγ hδ hε x ⊓' (cross hβ hγ hδ (cardinalOne hδ hε) (cardinalOne hδ hε))
@[simp]
theorem singletonImage_spec (x : TSet β) :
∀ z w,
⟨ {z}', {w}' ⟩' ∈' singletonImage hβ hγ hδ hε x ↔ ⟨z, w⟩' ∈' x := by
intro z w
rw [singletonImage, mem_inter_iff, singletonImage'_spec, and_iff_left_iff_imp]
intro hzw
rw [mem_cross_iff]
refine ⟨{z}', {w}', rfl, ?_⟩
simp only [mem_cardinalOne_iff, singleton_inj, exists_eq', and_self]
theorem exists_of_mem_singletonImage {x : TSet β} {z w : TSet δ}
(h : ⟨z, w⟩' ∈' singletonImage hβ hγ hδ hε x) :
∃ a b, z = {a}' ∧ w = {b}' := by
simp only [singletonImage, mem_inter_iff, mem_cross_iff, op_inj, mem_cardinalOne_iff] at h
obtain ⟨-, _, _, ⟨rfl, rfl⟩, ⟨a, rfl⟩, ⟨b, rfl⟩⟩ := h
exact ⟨a, b, rfl, rfl⟩
/-- Turn a model element encoding a relation into an actual relation. -/
def ExternalRel (r : TSet α) : Rel (TSet δ) (TSet δ) :=
λ x y ↦ ⟨x, y⟩' ∈' r
@[simp]
theorem externalRel_converse (r : TSet α) :
ExternalRel hβ hγ hδ (converse hβ hγ hδ r) = (ExternalRel hβ hγ hδ r).inv := by
ext
simp only [ExternalRel, op_mem_converse_iff, Rel.inv_apply]
/-- The codomain of a relation. -/
def codom (r : TSet α) : TSet γ :=
(typeLower lt_higherIndex hβ hγ hδ (singletonImage lt_higherIndex hβ hγ hδ r)ᶜ[lt_higherIndex])ᶜ'
@[simp]
theorem mem_codom_iff (r : TSet α) (x : TSet δ) :
x ∈' codom hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).codom := by
simp only [codom, mem_compl_iff, mem_typeLower_iff, not_forall, not_not]
constructor
· rintro ⟨y, hy⟩
obtain ⟨a, b, rfl, hb⟩ := exists_of_mem_singletonImage lt_higherIndex hβ hγ hδ hy
rw [singleton_inj] at hb
subst hb
rw [singletonImage_spec] at hy
exact ⟨a, hy⟩
· rintro ⟨a, ha⟩
use {a}'
rw [singletonImage_spec]
exact ha
/-- The domain of a relation. -/
def dom (r : TSet α) : TSet γ :=
codom hβ hγ hδ (converse hβ hγ hδ r)
@[simp]
theorem mem_dom_iff (r : TSet α) (x : TSet δ) :
x ∈' dom hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).dom := by
rw [dom, mem_codom_iff, externalRel_converse, Rel.inv_codom]
/-- The field of a relation. -/
def field (r : TSet α) : TSet γ :=
dom hβ hγ hδ r ⊔' codom hβ hγ hδ r
| @[simp]
theorem mem_field_iff (r : TSet α) (x : TSet δ) :
x ∈' field hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).field | ConNF.mem_field_iff | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | {
"commit": "1c08486feb882444888c228ce1501e92bb85e0e2",
"date": "2025-01-07T00:00:00"
} | ConNF/ConNF/External/Basic.lean | ConNF.External.Basic | ConNF.External.Basic.jsonl | {
"lineInFile": 168,
"tokenPositionInFile": 5056,
"theoremPositionInFile": 27
} | {
"inFilePremises": true,
"numInFilePremises": 8,
"repositoryPremises": true,
"numRepositoryPremises": 18,
"numPremises": 46
} | {
"hasProof": true,
"proof": ":= by\n rw [field, mem_union_iff, mem_dom_iff, mem_codom_iff, Rel.field, Set.mem_union]",
"proofType": "tactic",
"proofLengthLines": 1,
"proofLengthTokens": 87
} |
import ConNF.Model.Externalise
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal
namespace ConNF
variable [Params.{u}] {β γ : Λ} {hγ : (γ : TypeIndex) < β}
namespace Support
theorem not_mem_scoderiv_botDeriv (S : Support γ) (N : NearLitter) :
N ∉ (S ↗ hγ ⇘. (Path.nil ↘.))ᴺ := by
rintro ⟨i, ⟨A, N'⟩, h₁, h₂⟩
simp only [Prod.mk.injEq] at h₂
cases A
case sderiv δ A hδ _ =>
simp only [Path.deriv_sderiv] at h₂
cases A
case nil => cases h₂.1
case sderiv ζ A hζ _ =>
simp only [Path.deriv_sderiv] at h₂
cases h₂.1
variable [Level] [LtLevel β]
theorem not_mem_strong_botDeriv (S : Support γ) (N : NearLitter) :
N ∉ ((S ↗ hγ).strong ⇘. (Path.nil ↘.))ᴺ := by
rintro h
rw [strong, close_nearLitters, preStrong_nearLitters, Enumeration.mem_add_iff] at h
obtain h | h := h
· exact not_mem_scoderiv_botDeriv S N h
· rw [mem_constrainsNearLitters_nearLitters] at h
obtain ⟨B, N', hN', h⟩ := h
cases h using Relation.ReflTransGen.head_induction_on
case refl => exact not_mem_scoderiv_botDeriv S N hN'
case head x hx₁ hx₂ _ =>
obtain ⟨⟨γ, δ, ε, hδ, hε, hδε, A⟩, t, B, hB, hN, ht⟩ := hx₂
simp only at hB
cases B
case nil =>
cases hB
obtain ⟨C, N''⟩ := x
simp only at ht
cases ht.1
change _ ∈ t.supportᴺ at hN
rw [t.support_supports.2 rfl] at hN
obtain ⟨i, hN⟩ := hN
cases hN
case sderiv δ B hδ _ _ =>
cases B
case nil => cases hB
case sderiv ζ B hζ _ _ => cases hB
theorem raise_preStrong' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).PreStrong := by
apply hS.toPreStrong.add
constructor
intro A N hN P t hA ht
obtain ⟨A, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN
simp only [scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, interferenceSupport_nearLitters,
Enumeration.mem_add_iff, Enumeration.mem_smul, Enumeration.not_mem_empty, or_false] at hN
obtain ⟨δ, ε, ζ, hε, hζ, hεζ, B⟩ := P
dsimp only at *
cases A
case sderiv ζ' A hζ' _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_left_inj.mp at hA
cases A
case nil =>
cases hA
cases not_mem_strong_botDeriv T _ hN
case sderiv ι A hι _ _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
cases hA
haveI : LtLevel δ := ⟨A.le.trans_lt LtLevel.elim⟩
haveI : LtLevel ε := ⟨hε.trans LtLevel.elim⟩
haveI : LtLevel ζ := ⟨hζ.trans LtLevel.elim⟩
have := (T ↗ hγ).strong_strong.support_le hN ⟨δ, ε, ζ, hε, hζ, hεζ, A⟩
(ρ⁻¹ ⇘ A ↘ hε • t) rfl ?_
· simp only [Tangle.smul_support, allPermSderiv_forget, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv] at this
have := smul_le_smul this (ρᵁ ⇘ A ↘ hε)
simp only [smul_inv_smul] at this
apply le_trans this
intro B
constructor
· intro a ha
simp only [smul_derivBot, Tree.sderiv_apply, Tree.deriv_apply, Path.deriv_scoderiv,
deriv_derivBot, Enumeration.mem_smul] at ha
rw [deriv_derivBot, ← Path.deriv_scoderiv, Path.coderiv_deriv', scoderiv_botDeriv_eq,]
simp only [Path.deriv_scoderiv, add_derivBot, smul_derivBot,
BaseSupport.add_atoms, BaseSupport.smul_atoms, Enumeration.mem_add_iff,
Enumeration.mem_smul]
exact Or.inl ha
· intro N hN
simp only [smul_derivBot, Tree.sderiv_apply, Tree.deriv_apply, Path.deriv_scoderiv,
deriv_derivBot, Enumeration.mem_smul] at hN
rw [deriv_derivBot, ← Path.deriv_scoderiv, Path.coderiv_deriv', scoderiv_botDeriv_eq,]
simp only [Path.deriv_scoderiv, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul]
exact Or.inl hN
· rw [← smul_fuzz hε hζ hεζ, ← ht]
simp only [Path.botSderiv_coe_eq, BasePerm.smul_nearLitter_litter, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.inv_sderivBot]
rfl
theorem raise_closed' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β)
(hρ : ρᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).Closed := by
constructor
intro A
constructor
intro N₁ N₂ hN₁ hN₂ a ha
simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff,
BaseSupport.add_atoms] at hN₁ hN₂ ⊢
obtain hN₁ | hN₁ := hN₁
· obtain hN₂ | hN₂ := hN₂
· exact Or.inl ((hS.closed A).interference_subset hN₁ hN₂ a ha)
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN₂
simp only [smul_add, scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul, BaseSupport.add_atoms, BaseSupport.smul_atoms] at hN₁ hN₂ ⊢
refine Or.inr (Or.inr ?_)
rw [mem_interferenceSupport_atoms]
refine ⟨(ρᵁ B)⁻¹ • N₁, ?_, (ρᵁ B)⁻¹ • N₂, ?_, ?_⟩
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
rw [← Enumeration.mem_smul, ← BaseSupport.smul_nearLitters, ← smul_derivBot, hρ]
exact Or.inl hN₁
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₂
exact Or.inr hN₂
· rw [← BasePerm.smul_interference]
exact Set.smul_mem_smul_set ha
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN₁
simp only [smul_add, scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul, BaseSupport.add_atoms, BaseSupport.smul_atoms] at hN₁ hN₂ ⊢
refine Or.inr (Or.inr ?_)
rw [mem_interferenceSupport_atoms]
refine ⟨(ρᵁ B)⁻¹ • N₁, ?_, (ρᵁ B)⁻¹ • N₂, ?_, ?_⟩
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₁
exact Or.inr hN₁
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₂
obtain hN₂ | hN₂ := hN₂
· rw [← Enumeration.mem_smul, ← BaseSupport.smul_nearLitters, ← smul_derivBot, hρ]
exact Or.inl hN₂
· exact Or.inr hN₂
· rw [← BasePerm.smul_interference]
exact Set.smul_mem_smul_set ha
theorem raise_strong' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β)
(hρ : ρᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).Strong :=
⟨raise_preStrong' S hS T ρ hγ, raise_closed' S hS T ρ hγ hρ⟩
theorem convAtoms_injective_of_fixes {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(A : ↑α ↝ ⊥) :
(convAtoms
(S + (ρ₁ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim) A).Injective := by
rw [Support.smul_eq_iff] at hρ₁ hρ₂
constructor
rintro a₁ a₂ a₃ ⟨i, hi₁, hi₂⟩ ⟨j, hj₁, hj₂⟩
simp only [add_derivBot, BaseSupport.add_atoms, Rel.inv_apply,
Enumeration.rel_add_iff] at hi₁ hi₂ hj₁ hj₂
obtain hi₁ | ⟨i, rfl, hi₁⟩ := hi₁
· obtain hi₂ | ⟨i', rfl, _⟩ := hi₂
swap
· have := Enumeration.lt_bound _ _ ⟨_, hi₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i').not_lt this
cases (Enumeration.rel_coinjective _).coinjective hi₁ hi₂
obtain hj₁ | ⟨j, rfl, hj₁⟩ := hj₁
· obtain hj₂ | ⟨j', rfl, _⟩ := hj₂
· exact (Enumeration.rel_coinjective _).coinjective hj₂ hj₁
· have := Enumeration.lt_bound _ _ ⟨_, hj₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j').not_lt this
· obtain hj₂ | hj₂ := hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
· simp only [add_right_inj, exists_eq_left] at hj₂
obtain ⟨B, rfl⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨j, hj₁⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,
BaseSupport.add_atoms, Enumeration.smul_rel, add_right_inj, exists_eq_left] at hj₁ hj₂
have := (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
rw [← (hρ₂ B).1 a₁ ⟨_, hi₁⟩, inv_smul_smul, inv_smul_eq_iff, (hρ₁ B).1 a₁ ⟨_, hi₁⟩] at this
exact this.symm
· obtain ⟨B, rfl⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨i, hi₁⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,
BaseSupport.add_atoms, Enumeration.smul_rel, add_right_inj, exists_eq_left] at hi₁ hi₂ hj₁ hj₂
obtain hi₂ | hi₂ := hi₂
· have := Enumeration.lt_bound _ _ ⟨_, hi₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i).not_lt this
have hi := (Enumeration.rel_coinjective _).coinjective hi₁ hi₂
suffices hj : (ρ₁ᵁ B)⁻¹ • a₂ = (ρ₂ᵁ B)⁻¹ • a₃ by
rwa [← hj, smul_left_cancel_iff] at hi
obtain hj₁ | ⟨j, rfl, hj₁⟩ := hj₁
· obtain hj₂ | ⟨j', rfl, _⟩ := hj₂
· rw [← (hρ₁ B).1 a₂ ⟨_, hj₁⟩, ← (hρ₂ B).1 a₃ ⟨_, hj₂⟩, inv_smul_smul, inv_smul_smul]
exact (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j').not_lt this
· obtain hj₂ | hj₂ := hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
· simp only [add_right_inj, exists_eq_left] at hj₂
exact (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
theorem atomMemRel_le_of_fixes {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(A : ↑α ↝ ⊥) :
atomMemRel (S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A ≤
atomMemRel (S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A := by
rw [Support.smul_eq_iff] at hρ₁ hρ₂
rintro i j ⟨N, hN, a, haN, ha⟩
simp only [add_derivBot, BaseSupport.add_atoms, Rel.inv_apply, Enumeration.rel_add_iff,
BaseSupport.add_nearLitters] at ha hN
obtain hN | ⟨i, rfl, hi⟩ := hN
· obtain ha | ⟨j, rfl, hj⟩ := ha
· exact ⟨N, Or.inl hN, a, haN, Or.inl ha⟩
· obtain ⟨B, rfl⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨j, hj⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,
BaseSupport.add_atoms, Enumeration.smul_rel] at hj hN
refine ⟨N, Or.inl hN, ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • a, ?_, ?_⟩
· dsimp only
rw [← (hρ₂ B).2 N ⟨_, hN⟩, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]
have := (hρ₁ B).2 N ⟨_, hN⟩
rw [smul_eq_iff_eq_inv_smul] at this
rwa [this, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]
· rw [Rel.inv_apply, add_derivBot, BaseSupport.add_atoms, Enumeration.rel_add_iff]
simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,
BaseSupport.smul_atoms, BaseSupport.add_atoms, Enumeration.smul_rel, inv_smul_smul,
exists_eq_left]
exact Or.inr hj
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv ⟨i, hi⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,
BaseSupport.add_atoms, Enumeration.smul_rel] at hi ha
obtain ha | ⟨j, rfl, hj⟩ := ha
· refine ⟨ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • N, ?_, a, ?_, Or.inl ha⟩
· rw [add_derivBot, BaseSupport.add_nearLitters, Enumeration.rel_add_iff]
simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,
BaseSupport.smul_nearLitters, BaseSupport.add_nearLitters, Enumeration.smul_rel,
inv_smul_smul, exists_eq_left]
exact Or.inr hi
· dsimp only
rw [← (hρ₂ B).1 a ⟨_, ha⟩, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]
have := (hρ₁ B).1 a ⟨_, ha⟩
rw [smul_eq_iff_eq_inv_smul] at this
rwa [this, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]
· refine ⟨ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • N, ?_, ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • a, ?_, ?_⟩
· rw [add_derivBot, BaseSupport.add_nearLitters, Enumeration.rel_add_iff]
simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,
BaseSupport.smul_nearLitters, BaseSupport.add_nearLitters, Enumeration.smul_rel,
inv_smul_smul, exists_eq_left]
exact Or.inr hi
· simp only [BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]
exact haN
· rw [Rel.inv_apply, add_derivBot, BaseSupport.add_atoms, Enumeration.rel_add_iff]
simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,
BaseSupport.smul_atoms, BaseSupport.add_atoms, Enumeration.smul_rel, inv_smul_smul,
exists_eq_left]
exact Or.inr hj
theorem convNearLitters_cases {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
{A : α ↝ ⊥} {N₁ N₂ : NearLitter} :
convNearLitters
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A N₁ N₂ →
N₁ = N₂ ∧ N₁ ∈ (S ⇘. A)ᴺ ∨
∃ B : β ↝ ⊥, A = B ↗ LtLevel.elim ∧ (ρ₁ᵁ B)⁻¹ • N₁ = (ρ₂ᵁ B)⁻¹ • N₂ ∧
(ρ₁ᵁ B)⁻¹ • N₁ ∈ (((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport) ⇘. B)ᴺ := by
rintro ⟨i, hN₁, hN₂⟩
simp only [add_derivBot, BaseSupport.add_nearLitters, Rel.inv_apply,
Enumeration.rel_add_iff] at hN₁ hN₂
obtain hN₁ | ⟨i, rfl, hN₁⟩ := hN₁
· obtain hN₂ | ⟨i, rfl, hN₂⟩ := hN₂
swap
· have := Enumeration.lt_bound _ _ ⟨_, hN₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i).not_lt this
exact Or.inl ⟨(Enumeration.rel_coinjective _).coinjective hN₁ hN₂, _, hN₁⟩
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv ⟨i, hN₁⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_nearLitters,
BaseSupport.add_nearLitters, Enumeration.smul_rel, add_right_inj, exists_eq_left] at hN₁ hN₂
obtain hN₂ | hN₂ := hN₂
· have := Enumeration.lt_bound _ _ ⟨_, hN₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i).not_lt this
exact Or.inr ⟨B, rfl, (Enumeration.rel_coinjective _).coinjective hN₁ hN₂, _, hN₁⟩
theorem inflexible_of_inflexible_of_fixes {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
{A : α ↝ ⊥} {N₁ N₂ : NearLitter} :
convNearLitters
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A N₁ N₂ →
∀ (P : InflexiblePath ↑α) (t : Tangle P.δ), A = P.A ↘ P.hε ↘. → N₁ᴸ = fuzz P.hδε t →
∃ ρ : AllPerm P.δ, N₂ᴸ = fuzz P.hδε (ρ • t) := by
rintro hN ⟨γ, δ, ε, hδ, hε, hδε, A⟩ t hA ht
haveI : LeLevel γ := ⟨A.le⟩
haveI : LtLevel δ := ⟨hδ.trans_le LeLevel.elim⟩
haveI : LtLevel ε := ⟨hε.trans_le LeLevel.elim⟩
obtain ⟨rfl, _⟩ | ⟨B, rfl, hN'⟩ := convNearLitters_cases hN
· use 1
rw [one_smul, ht]
· clear hN
cases B
case sderiv ε B hε' _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_path_injective at hA
cases B
case nil =>
simp only [Path.botSderiv_coe_eq, add_derivBot, BaseSupport.add_nearLitters,
interferenceSupport_nearLitters, Enumeration.add_empty] at hN'
cases not_mem_strong_botDeriv _ _ hN'.2
case sderiv ζ B hζ _ _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_path_injective at hA
dsimp only at hA hζ hε' B t
cases hA
use (ρ₂ * ρ₁⁻¹) ⇘ B ↘ hδ
rw [inv_smul_eq_iff] at hN'
rw [← smul_fuzz hδ hε hδε, ← ht, hN'.1]
simp only [allPermDeriv_forget, allPermForget_mul, allPermForget_inv, Tree.mul_deriv,
Tree.inv_deriv, Tree.mul_sderiv, Tree.inv_sderiv, Tree.mul_sderivBot, Tree.inv_sderivBot,
Path.botSderiv_coe_eq, BasePerm.smul_nearLitter_litter, mul_smul]
erw [inv_smul_smul, smul_inv_smul]
| theorem atoms_of_inflexible_of_fixes {S : Support α} (hS : S.Strong) {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(A : α ↝ ⊥) (N₁ N₂ : NearLitter) (P : InflexiblePath ↑α) (t : Tangle P.δ) (ρ : AllPerm P.δ) :
A = P.A ↘ P.hε ↘. → N₁ᴸ = fuzz P.hδε t → N₂ᴸ = fuzz P.hδε (ρ • t) →
convNearLitters
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A N₁ N₂ →
∀ (B : P.δ ↝ ⊥), ∀ a ∈ (t.support ⇘. B)ᴬ, ∀ (i : κ),
((S + (ρ₁ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim) ⇘. (P.A ↘ P.hδ ⇘ B))ᴬ.rel i a →
((S + (ρ₂ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim) ⇘. (P.A ↘ P.hδ ⇘ B))ᴬ.rel i (ρᵁ B • a) | ConNF.Support.atoms_of_inflexible_of_fixes | {
"commit": "abf71bc79c407ceb462cc2edd2d994cda9cdef05",
"date": "2024-04-04T00:00:00"
} | {
"commit": "2dd04bc4e7c491b6023c78aea4cd613f00becfc4",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/Model/RaiseStrong.lean | ConNF.Model.RaiseStrong | ConNF.Model.RaiseStrong.jsonl | {
"lineInFile": 378,
"tokenPositionInFile": 17816,
"theoremPositionInFile": 9
} | {
"inFilePremises": true,
"numInFilePremises": 2,
"repositoryPremises": true,
"numRepositoryPremises": 138,
"numPremises": 231
} | {
"hasProof": true,
"proof": ":= by\n rw [Support.smul_eq_iff] at hρ₁ hρ₂\n obtain ⟨γ, δ, ε, hδ, hε, hδε, B⟩ := P\n haveI : LeLevel γ := ⟨B.le⟩\n haveI : LtLevel δ := ⟨hδ.trans_le LeLevel.elim⟩\n haveI : LtLevel ε := ⟨hε.trans_le LeLevel.elim⟩\n dsimp only at t ρ ⊢\n intro hA hN₁ hN₂ hN C a ha i hi\n obtain ⟨rfl, hN'⟩ | ⟨A, rfl, hN₁', hN₂'⟩ := convNearLitters_cases hN\n · have haS := (hS.support_le hN' ⟨γ, δ, ε, hδ, hε, hδε, _⟩ t hA hN₁ _).1 a ha\n rw [hN₂] at hN₁\n have hρt := congr_arg Tangle.support (fuzz_injective hN₁)\n rw [Tangle.smul_support, Support.smul_eq_iff] at hρt\n simp only [add_derivBot, BaseSupport.add_atoms, Enumeration.rel_add_iff] at hi ⊢\n rw [(hρt C).1 a ha]\n obtain hi | ⟨i, rfl, hi⟩ := hi\n · exact Or.inl hi\n · simp only [add_right_inj, exists_eq_left]\n obtain ⟨D, hD⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨i, hi⟩\n cases B using Path.recScoderiv\n case nil =>\n cases Path.scoderiv_index_injective hD\n cases Path.scoderiv_left_inj.mp hD\n simp only [hD, Path.coderiv_deriv, Path.coderiv_deriv', scoderiv_botDeriv_eq, smul_derivBot,\n add_derivBot, BaseSupport.smul_atoms, BaseSupport.add_atoms, Enumeration.smul_rel] at hi ⊢\n rw [deriv_derivBot, hD] at haS\n rw [← (hρ₂ _).1 a haS, inv_smul_smul]\n rw [← (hρ₁ _).1 a haS, inv_smul_smul] at hi\n exact Or.inr hi\n case scoderiv ζ B hζ' _ =>\n rw [Path.coderiv_deriv, Path.coderiv_deriv'] at hD\n cases Path.scoderiv_index_injective hD\n rw [Path.scoderiv_left_inj] at hD\n cases hD\n simp only [Path.coderiv_deriv, Path.coderiv_deriv', scoderiv_botDeriv_eq, smul_derivBot,\n add_derivBot, BaseSupport.smul_atoms, BaseSupport.add_atoms, Enumeration.smul_rel] at hi ⊢\n rw [deriv_derivBot, Path.coderiv_deriv, Path.coderiv_deriv'] at haS\n rw [← (hρ₂ _).1 a haS, inv_smul_smul]\n rw [← (hρ₁ _).1 a haS, inv_smul_smul] at hi\n exact Or.inr hi\n · simp only [add_derivBot, BaseSupport.add_nearLitters, interferenceSupport_nearLitters,\n Enumeration.add_empty] at hN₂'\n cases A\n case sderiv ζ A hζ' _ =>\n rw [← Path.coderiv_deriv] at hA\n cases Path.sderiv_index_injective hA\n apply Path.sderiv_path_injective at hA\n cases A\n case nil =>\n cases hA\n cases not_mem_strong_botDeriv _ _ hN₂'\n case sderiv ζ A hζ _ _ =>\n rw [← Path.coderiv_deriv] at hA\n cases Path.sderiv_index_injective hA\n apply Path.sderiv_path_injective at hA\n cases hA\n simp only [Path.coderiv_deriv, Path.coderiv_deriv', add_derivBot, scoderiv_botDeriv_eq,\n smul_derivBot, BaseSupport.add_atoms, BaseSupport.smul_atoms] at hi ⊢\n have : N₂ᴸ = (ρ₂ ⇘ A)ᵁ ↘ hζ ↘. • (ρ₁⁻¹ ⇘ A)ᵁ ↘ hζ ↘. • fuzz hδε t := by\n rw [inv_smul_eq_iff] at hN₁'\n rw [hN₁', Path.botSderiv_coe_eq, BasePerm.smul_nearLitter_litter,\n BasePerm.smul_nearLitter_litter, smul_smul, smul_eq_iff_eq_inv_smul,\n mul_inv_rev, inv_inv, mul_smul, ← Tree.inv_apply, ← allPermForget_inv] at hN₁\n rw [hN₁]\n simp only [allPermForget_inv, Tree.inv_apply, allPermDeriv_forget, Tree.inv_deriv,\n Tree.inv_sderiv, Tree.inv_sderivBot]\n rfl\n rw [smul_fuzz hδ hε hδε, smul_fuzz hδ hε hδε] at this\n have := fuzz_injective (hN₂.symm.trans this)\n rw [smul_smul] at this\n rw [t.smul_atom_eq_of_mem_support this ha]\n rw [Enumeration.rel_add_iff] at hi ⊢\n obtain hi | ⟨i, rfl, hi⟩ := hi\n · left\n simp only [allPermForget_mul, allPermSderiv_forget, allPermDeriv_forget,\n allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.mul_apply, Tree.sderiv_apply,\n Tree.deriv_apply, Path.deriv_scoderiv, Tree.inv_apply, mul_smul]\n rwa [← (hρ₁ _).1 a ⟨i, hi⟩, inv_smul_smul, (hρ₂ _).1 a ⟨i, hi⟩]\n · refine Or.inr ⟨i, rfl, ?_⟩\n simp only [allPermForget_mul, allPermSderiv_forget, allPermDeriv_forget,\n allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.mul_apply, Tree.sderiv_apply,\n Tree.deriv_apply, Path.deriv_scoderiv, Tree.inv_apply, mul_smul, Enumeration.smul_rel,\n inv_smul_smul]\n exact hi",
"proofType": "tactic",
"proofLengthLines": 83,
"proofLengthTokens": 4222
} |
import ConNF.Model.RunInduction
/-!
# Externalisation
In this file, we convert many of our *internal* results (i.e. inside the induction) to *external*
ones (i.e. defined using the global `TSet`/`AllPerm` definitions).
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal WithBot
namespace ConNF
variable [Params.{u}]
instance globalModelData : {α : TypeIndex} → ModelData α
| (α : Λ) => (motive α).data
| ⊥ => botModelData
instance globalPosition : {α : TypeIndex} → Position (Tangle α)
| (α : Λ) => (motive α).pos
| ⊥ => botPosition
instance globalTypedNearLitters {α : Λ} : TypedNearLitters α :=
(motive α).typed
instance globalLtData [Level] : LtData where
instance globalLeData [Level] : LeData where
omit [Params] in
| theorem heq_funext {α : Sort _} {β γ : α → Sort _} {f : (x : α) → β x} {g : (x : α) → γ x}
(h : ∀ x, HEq (f x) (g x)) : HEq f g | ConNF.heq_funext | {
"commit": "6fdc87c6b30b73931407a372f1430ecf0fef7601",
"date": "2024-12-03T00:00:00"
} | {
"commit": "e409f3d0cd939e7218c3f39dcf3493c4b6e0b821",
"date": "2024-11-29T00:00:00"
} | ConNF/ConNF/Model/Externalise.lean | ConNF.Model.Externalise | ConNF.Model.Externalise.jsonl | {
"lineInFile": 39,
"tokenPositionInFile": 803,
"theoremPositionInFile": 0
} | {
"inFilePremises": false,
"numInFilePremises": 0,
"repositoryPremises": false,
"numRepositoryPremises": 0,
"numPremises": 14
} | {
"hasProof": true,
"proof": ":= by\n cases funext λ x ↦ type_eq_of_heq (h x)\n simp only [heq_eq_eq] at h ⊢\n exact funext h",
"proofType": "tactic",
"proofLengthLines": 3,
"proofLengthTokens": 95
} |
import ConNF.Model.TTT
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
namespace TSet
theorem exists_inter (x y : TSet α) :
∃ w : TSet α, ∀ z : TSet β, z ∈[hβ] w ↔ z ∈[hβ] x ∧ z ∈[hβ] y := by
refine exists_of_symmetric {z | z ∈[hβ] x ∧ z ∈[hβ] y} hβ ?_
obtain ⟨S, hS⟩ := symmetric x hβ
obtain ⟨T, hT⟩ := symmetric y hβ
use S + T
intro ρ hρ
specialize hS ρ (smul_eq_of_le Support.le_add_right hρ)
specialize hT ρ (smul_eq_of_le Support.le_add_left hρ)
simp [Set.ext_iff, Set.mem_smul_set_iff_inv_smul_mem] at hS hT ⊢
aesop
theorem exists_compl (x : TSet α) :
∃ y : TSet α, ∀ z : TSet β, z ∈[hβ] y ↔ ¬z ∈[hβ] x := by
refine exists_of_symmetric {z | ¬z ∈[hβ] x} hβ ?_
obtain ⟨S, hS⟩ := symmetric x hβ
use S
intro ρ hρ
specialize hS ρ hρ
simp [Set.ext_iff, Set.mem_smul_set_iff_inv_smul_mem] at hS ⊢
aesop
theorem exists_up (x y : TSet β) :
∃ w : TSet α, ∀ z : TSet β, z ∈[hβ] w ↔ z = x ∨ z = y := by
refine exists_of_symmetric {x, y} hβ ?_
obtain ⟨S, hS⟩ := exists_support x
obtain ⟨T, hT⟩ := exists_support y
use (S + T) ↗ hβ
intro ρ hρ
rw [Support.smul_scoderiv, Support.scoderiv_inj, ← allPermSderiv_forget'] at hρ
specialize hS (ρ ↘ hβ) (smul_eq_of_le Support.le_add_right hρ)
specialize hT (ρ ↘ hβ) (smul_eq_of_le Support.le_add_left hρ)
simp only [Set.smul_set_def, Set.image, Set.mem_insert_iff, Set.mem_singleton_iff,
exists_eq_or_imp, hS, exists_eq_left, hT]
ext z
rw [Set.mem_insert_iff, Set.mem_singleton_iff, Set.mem_setOf_eq]
aesop
/-- The unordered pair. -/
def up (x y : TSet β) : TSet α :=
(exists_up hβ x y).choose
@[simp]
theorem mem_up_iff (x y z : TSet β) :
z ∈[hβ] up hβ x y ↔ z = x ∨ z = y :=
(exists_up hβ x y).choose_spec z
/-- The Kuratowski ordered pair. -/
def op (x y : TSet γ) : TSet α :=
up hβ (singleton hγ x) (up hγ x y)
theorem up_injective {x y z w : TSet β} (h : up hβ x y = up hβ z w) :
(x = z ∧ y = w) ∨ (x = w ∧ y = z) := by
have h₁ := mem_up_iff hβ x y z
have h₂ := mem_up_iff hβ x y w
have h₃ := mem_up_iff hβ z w x
have h₄ := mem_up_iff hβ z w y
rw [h, mem_up_iff] at h₁ h₂
rw [← h, mem_up_iff] at h₃ h₄
aesop
@[simp]
theorem up_inj (x y z w : TSet β) :
up hβ x y = up hβ z w ↔ (x = z ∧ y = w) ∨ (x = w ∧ y = z) := by
constructor
· exact up_injective hβ
· rintro (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)
· rfl
· apply tSet_ext' hβ
aesop
@[simp]
theorem up_self {x : TSet β} :
up hβ x x = singleton hβ x := by
apply tSet_ext' hβ
aesop
@[simp]
theorem up_eq_singleton_iff (x y z : TSet β) :
up hβ x y = singleton hβ z ↔ x = z ∧ y = z := by
constructor
· intro h
have h₁ := typedMem_singleton_iff' hβ z x
have h₂ := typedMem_singleton_iff' hβ z y
rw [← h, mem_up_iff] at h₁ h₂
aesop
· rintro ⟨rfl, rfl⟩
rw [up_self]
@[simp]
theorem singleton_eq_up_iff (x y z : TSet β) :
singleton hβ z = up hβ x y ↔ x = z ∧ y = z := by
rw [← up_eq_singleton_iff hβ x y z, eq_comm]
theorem op_injective {x y z w : TSet γ} (h : op hβ hγ x y = op hβ hγ z w) :
x = z ∧ y = w := by
rw [op, op] at h
simp only [up_inj, singleton_inj, singleton_eq_up_iff, up_eq_singleton_iff] at h
obtain (⟨rfl, ⟨h, rfl⟩ | ⟨rfl, rfl⟩⟩ | ⟨⟨rfl, rfl⟩, ⟨h, rfl⟩⟩) := h <;> simp only [and_self]
@[simp]
theorem op_inj (x y z w : TSet γ) :
op hβ hγ x y = op hβ hγ z w ↔ x = z ∧ y = w := by
constructor
· exact op_injective hβ hγ
· rintro ⟨rfl, rfl⟩
rfl
@[simp]
theorem op_eq_singleton_iff (x y : TSet γ) (z : TSet β) :
op hβ hγ x y = singleton hβ z ↔ singleton hγ x = z ∧ singleton hγ y = z := by
rw [op, up_eq_singleton_iff, and_congr_right_iff]
rintro rfl
simp only [up_eq_singleton_iff, true_and, singleton_inj]
@[simp]
theorem smul_up (x y : TSet β) (ρ : AllPerm α) :
ρ • up hβ x y = up hβ (ρ ↘ hβ • x) (ρ ↘ hβ • y) := by
apply tSet_ext' hβ
aesop
@[simp]
theorem smul_op (x y : TSet γ) (ρ : AllPerm α) :
ρ • op hβ hγ x y = op hβ hγ (ρ ↘ hβ ↘ hγ • x) (ρ ↘ hβ ↘ hγ • y) := by
apply tSet_ext' hβ
simp only [op, smul_up, smul_singleton, mem_up_iff, implies_true]
theorem exists_singletonImage (x : TSet β) :
∃ y : TSet α, ∀ z w,
op hγ hδ (singleton hε z) (singleton hε w) ∈[hβ] y ↔ op hδ hε z w ∈[hγ] x := by
have := exists_of_symmetric {u | ∃ z w : TSet ε, op hδ hε z w ∈[hγ] x ∧
u = op hγ hδ (singleton hε z) (singleton hε w)} hβ ?_
· obtain ⟨y, hy⟩ := this
use y
intro z w
rw [hy]
simp only [Set.mem_setOf_eq, op_inj, singleton_inj, exists_eq_right_right', exists_eq_right']
· obtain ⟨S, hS⟩ := exists_support x
use S ↗ hβ
intro ρ hρ
rw [Support.smul_scoderiv, Support.scoderiv_inj, ← allPermSderiv_forget'] at hρ
specialize hS (ρ ↘ hβ) hρ
ext z
constructor
· rintro ⟨_, ⟨z, w, hab, rfl⟩, rfl⟩
refine ⟨ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε • z, ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε • w, ?_, ?_⟩
· rwa [← hS, mem_smul_iff', smul_op, allPerm_inv_sderiv', allPerm_inv_sderiv',
allPerm_inv_sderiv', inv_smul_smul, inv_smul_smul]
· simp only [smul_op, smul_singleton]
· rintro ⟨z, w, hab, rfl⟩
refine ⟨ρ⁻¹ ↘ hβ • op hγ hδ (singleton hε z) (singleton hε w), ?_, ?_⟩
· simp only [allPerm_inv_sderiv', smul_op, smul_singleton, Set.mem_setOf_eq, op_inj,
singleton_inj, exists_eq_right_right', exists_eq_right']
rw [smul_eq_iff_eq_inv_smul] at hS
rw [hS]
simp only [mem_smul_iff', inv_inv, smul_op, smul_inv_smul]
exact hab
· simp only [allPerm_inv_sderiv', smul_inv_smul]
theorem exists_insertion2 (x : TSet γ) :
∃ y : TSet α, ∀ a b c, op hγ hδ (singleton hε (singleton hζ a)) (op hε hζ b c) ∈[hβ] y ↔
op hε hζ a c ∈[hδ] x := by
have := exists_of_symmetric {u | ∃ a b c : TSet ζ, op hε hζ a c ∈[hδ] x ∧
u = op hγ hδ (singleton hε (singleton hζ a)) (op hε hζ b c)} hβ ?_
· obtain ⟨y, hy⟩ := this
use y
intro a b c
rw [hy]
constructor
· rintro ⟨a', b', c', h₁, h₂⟩
simp only [op_inj, singleton_inj] at h₂
obtain ⟨rfl, rfl, rfl⟩ := h₂
exact h₁
· intro h
exact ⟨a, b, c, h, rfl⟩
· obtain ⟨S, hS⟩ := exists_support x
use S ↗ hγ ↗ hβ
intro ρ hρ
simp only [Support.smul_scoderiv, Support.scoderiv_inj, ← allPermSderiv_forget'] at hρ
specialize hS (ρ ↘ hβ ↘ hγ) hρ
ext z
constructor
· rintro ⟨_, ⟨a, b, c, hx, rfl⟩, rfl⟩
refine ⟨ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • a, ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • b,
ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • c, ?_, ?_⟩
· rw [← hS]
simp only [mem_smul_iff', allPerm_inv_sderiv', smul_op, inv_smul_smul]
exact hx
· simp only [smul_op, smul_singleton]
· rintro ⟨a, b, c, hx, rfl⟩
rw [Set.mem_smul_set_iff_inv_smul_mem]
refine ⟨ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • a, ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • b,
ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • c, ?_, ?_⟩
· rw [smul_eq_iff_eq_inv_smul] at hS
rw [hS, mem_smul_iff']
simp only [inv_inv, allPerm_inv_sderiv', smul_op, smul_inv_smul]
exact hx
· simp only [smul_op, allPerm_inv_sderiv', smul_singleton]
| theorem exists_insertion3 (x : TSet γ) :
∃ y : TSet α, ∀ a b c, op hγ hδ (singleton hε (singleton hζ a)) (op hε hζ b c) ∈[hβ] y ↔
op hε hζ a b ∈[hδ] x | ConNF.TSet.exists_insertion3 | {
"commit": "f804f5c71cfaa98223fc227dd822801e8bf77004",
"date": "2024-03-30T00:00:00"
} | {
"commit": "f7c233c7f7fd9d8b74595bbfa2bbbd49d538ef59",
"date": "2024-12-02T00:00:00"
} | ConNF/ConNF/Model/Hailperin.lean | ConNF.Model.Hailperin | ConNF.Model.Hailperin.jsonl | {
"lineInFile": 224,
"tokenPositionInFile": 7357,
"theoremPositionInFile": 18
} | {
"inFilePremises": true,
"numInFilePremises": 3,
"repositoryPremises": true,
"numRepositoryPremises": 44,
"numPremises": 102
} | {
"hasProof": true,
"proof": ":= by\n have := exists_of_symmetric {u | ∃ a b c : TSet ζ, op hε hζ a b ∈[hδ] x ∧\n u = op hγ hδ (singleton hε (singleton hζ a)) (op hε hζ b c)} hβ ?_\n · obtain ⟨y, hy⟩ := this\n use y\n intro a b c\n rw [hy]\n constructor\n · rintro ⟨a', b', c', h₁, h₂⟩\n simp only [op_inj, singleton_inj] at h₂\n obtain ⟨rfl, rfl, rfl⟩ := h₂\n exact h₁\n · intro h\n exact ⟨a, b, c, h, rfl⟩\n · obtain ⟨S, hS⟩ := exists_support x\n use S ↗ hγ ↗ hβ\n intro ρ hρ\n simp only [Support.smul_scoderiv, Support.scoderiv_inj, ← allPermSderiv_forget'] at hρ\n specialize hS (ρ ↘ hβ ↘ hγ) hρ\n ext z\n constructor\n · rintro ⟨_, ⟨a, b, c, hx, rfl⟩, rfl⟩\n refine ⟨ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • a, ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • b,\n ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • c, ?_, ?_⟩\n · rw [← hS]\n simp only [mem_smul_iff', allPerm_inv_sderiv', smul_op, inv_smul_smul]\n exact hx\n · simp only [smul_op, smul_singleton]\n · rintro ⟨a, b, c, hx, rfl⟩\n rw [Set.mem_smul_set_iff_inv_smul_mem]\n refine ⟨ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • a, ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • b,\n ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • c, ?_, ?_⟩\n · rw [smul_eq_iff_eq_inv_smul] at hS\n rw [hS, mem_smul_iff']\n simp only [inv_inv, allPerm_inv_sderiv', smul_op, smul_inv_smul]\n exact hx\n · simp only [smul_op, allPerm_inv_sderiv', smul_singleton]",
"proofType": "tactic",
"proofLengthLines": 36,
"proofLengthTokens": 1399
} |
import ConNF.Background.ReflTransGen
import ConNF.FOA.Inflexible
/-!
# Strong supports
In this file, we define strong supports.
## Main declarations
* `ConNF.Support.Strong`: The property that a support is strong.
-/
noncomputable section
universe u
open Cardinal Ordinal
open scoped symmDiff
namespace ConNF
variable [Params.{u}] {β : TypeIndex}
structure BaseSupport.Closed (S : BaseSupport) : Prop where
interference_subset {N₁ N₂ : NearLitter} :
N₁ ∈ Sᴺ → N₂ ∈ Sᴺ → ∀ a ∈ interference N₁ N₂, a ∈ Sᴬ
namespace Support
variable [Level] [CoherentData] [LeLevel β]
structure PreStrong (S : Support β) : Prop where
support_le {A : β ↝ ⊥} {N : NearLitter} (h : N ∈ (S ⇘. A)ᴺ)
(P : InflexiblePath β) (t : Tangle P.δ)
(hA : A = P.A ↘ P.hε ↘.) (ht : Nᴸ = fuzz P.hδε t) :
t.support ≤ S ⇘ (P.A ↘ P.hδ)
structure Closed (S : Support β) : Prop where
closed : ∀ A, (S ⇘. A).Closed
structure Strong (S : Support β) extends S.PreStrong, S.Closed : Prop
theorem PreStrong.smul {S : Support β} (hS : S.PreStrong) (ρ : AllPerm β) : (ρᵁ • S).PreStrong := by
constructor
intro A N hN P t hA ht
rw [smul_derivBot, BaseSupport.smul_nearLitters, Enumeration.mem_smul] at hN
have := hS.support_le hN P (ρ⁻¹ ⇘ P.A ↘ P.hδ • t) hA ?_
· convert smul_le_smul this (ρᵁ ⇘ P.A ↘ P.hδ) using 1
· rw [Tangle.smul_support, smul_smul,
allPermSderiv_forget, allPermDeriv_forget, allPermForget_inv,
Tree.inv_deriv, Tree.inv_sderiv, mul_inv_cancel, one_smul]
· ext B : 1
rw [smul_derivBot, Tree.sderiv_apply, Tree.deriv_apply, Path.deriv_scoderiv]
rfl
· rw [← smul_fuzz P.hδ P.hε P.hδε, allPermDeriv_forget, allPermForget_inv,
BasePerm.smul_nearLitter_litter, ← Tree.inv_apply, hA, ht]
rfl
theorem Closed.smul {S : Support β} (hS : S.Closed) (ρ : AllPerm β) : (ρᵁ • S).Closed := by
constructor
intro A
constructor
intro N₁ N₂ h₁ h₂
simp only [smul_derivBot, BaseSupport.smul_nearLitters, BaseSupport.smul_atoms,
Enumeration.mem_smul] at h₁ h₂ ⊢
intro a ha
apply (hS.closed A).interference_subset h₁ h₂
rwa [← BasePerm.smul_interference, Set.smul_mem_smul_set_iff]
theorem Strong.smul {S : Support β} (hS : S.Strong) (ρ : AllPerm β) : (ρᵁ • S).Strong :=
⟨hS.toPreStrong.smul ρ, hS.toClosed.smul ρ⟩
theorem PreStrong.add {S T : Support β} (hS : S.PreStrong) (hT : T.PreStrong) :
(S + T).PreStrong := by
constructor
intro A N hN P t hA ht
simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff] at hN
obtain hN | hN := hN
· intro B
simp only [deriv_derivBot, add_derivBot]
exact (hS.support_le hN P t hA ht B).trans (BaseSupport.le_add_right)
· intro B
simp only [deriv_derivBot, add_derivBot]
exact (hT.support_le hN P t hA ht B).trans (BaseSupport.le_add_left)
omit [Level] [CoherentData] [LeLevel β] in
| theorem Closed.scoderiv {γ : TypeIndex} {S : Support γ} (hS : S.Closed) (hγ : γ < β) :
(S ↗ hγ).Closed | ConNF.Support.Closed.scoderiv | {
"commit": "8896e416a16c39e1fe487b5fc7c78bc20c4e182b",
"date": "2024-12-03T00:00:00"
} | {
"commit": "6709914ae7f5cd3e2bb24b413e09aa844554d234",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/Strong/Strong.lean | ConNF.Strong.Strong | ConNF.Strong.Strong.jsonl | {
"lineInFile": 87,
"tokenPositionInFile": 2843,
"theoremPositionInFile": 4
} | {
"inFilePremises": true,
"numInFilePremises": 5,
"repositoryPremises": true,
"numRepositoryPremises": 35,
"numPremises": 75
} | {
"hasProof": true,
"proof": ":= by\n constructor\n intro A\n constructor\n intro N₁ N₂ hN₁ hN₂ a ha\n obtain ⟨i, ⟨B, N₁⟩, hi, hi'⟩ := hN₁\n cases hi'\n obtain ⟨j, ⟨C, N₂⟩, hj, hj'⟩ := hN₂\n simp only [Prod.mk.injEq, Path.deriv_right_inj] at hj'\n cases hj'.1\n cases hj'.2\n simp only\n obtain ⟨k, hk⟩ := (hS.closed B).interference_subset ⟨i, hi⟩ ⟨j, hj⟩ a ha\n exact ⟨k, ⟨B, a⟩, hk, rfl⟩",
"proofType": "tactic",
"proofLengthLines": 13,
"proofLengthTokens": 359
} |
import ConNF.Model.Result
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
def union (x y : TSet α) : TSet α :=
(xᶜ' ⊓' yᶜ')ᶜ'
notation:68 x:68 " ⊔[" h "] " y:68 => _root_.ConNF.union h x y
notation:68 x:68 " ⊔' " y:68 => x ⊔[by assumption] y
@[simp]
theorem mem_union_iff (x y : TSet α) :
∀ z : TSet β, z ∈' x ⊔' y ↔ z ∈' x ∨ z ∈' y := by
rw [union]
intro z
rw [mem_compl_iff, mem_inter_iff, mem_compl_iff, mem_compl_iff, or_iff_not_and_not]
def higherIndex (α : Λ) : Λ :=
(exists_gt α).choose
theorem lt_higherIndex {α : Λ} :
(α : TypeIndex) < higherIndex α :=
WithBot.coe_lt_coe.mpr (exists_gt α).choose_spec
theorem tSet_nonempty (h : ∃ β : Λ, (β : TypeIndex) < α) : Nonempty (TSet α) := by
obtain ⟨α', hα⟩ := h
constructor
apply typeLower lt_higherIndex lt_higherIndex lt_higherIndex hα
apply cardinalOne lt_higherIndex lt_higherIndex
def empty : TSet α :=
(tSet_nonempty ⟨β, hβ⟩).some ⊓' (tSet_nonempty ⟨β, hβ⟩).someᶜ'
@[simp]
theorem mem_empty_iff :
∀ x : TSet β, ¬x ∈' empty hβ := by
intro x
rw [empty, mem_inter_iff, mem_compl_iff]
exact and_not_self
def univ : TSet α :=
(empty hβ)ᶜ'
@[simp]
theorem mem_univ_iff :
∀ x : TSet β, x ∈' univ hβ := by
intro x
simp only [univ, mem_compl_iff, mem_empty_iff, not_false_eq_true]
/-- The set of all ordered pairs. -/
def orderedPairs : TSet α :=
vCross hβ hγ hδ (univ hδ)
@[simp]
theorem mem_orderedPairs_iff (x : TSet β) :
x ∈' orderedPairs hβ hγ hδ ↔ ∃ a b, x = ⟨a, b⟩' := by
simp only [orderedPairs, vCross_spec, mem_univ_iff, and_true]
def converse (x : TSet α) : TSet α :=
converse' hβ hγ hδ x ⊓' orderedPairs hβ hγ hδ
@[simp]
theorem op_mem_converse_iff (x : TSet α) :
∀ a b, ⟨a, b⟩' ∈' converse hβ hγ hδ x ↔ ⟨b, a⟩' ∈' x := by
intro a b
simp only [converse, mem_inter_iff, converse'_spec, mem_orderedPairs_iff, op_inj, exists_and_left,
exists_eq', and_true]
def cross (x y : TSet γ) : TSet α :=
converse hβ hγ hδ (vCross hβ hγ hδ x) ⊓' vCross hβ hγ hδ y
@[simp]
theorem mem_cross_iff (x y : TSet γ) :
∀ a, a ∈' cross hβ hγ hδ x y ↔ ∃ b c, a = ⟨b, c⟩' ∧ b ∈' x ∧ c ∈' y := by
intro a
rw [cross, mem_inter_iff, vCross_spec]
constructor
· rintro ⟨h₁, b, c, rfl, h₂⟩
simp only [op_mem_converse_iff, vCross_spec, op_inj] at h₁
obtain ⟨b', c', ⟨rfl, rfl⟩, h₁⟩ := h₁
exact ⟨b, c, rfl, h₁, h₂⟩
· rintro ⟨b, c, rfl, h₁, h₂⟩
simp only [op_mem_converse_iff, vCross_spec, op_inj]
exact ⟨⟨c, b, ⟨rfl, rfl⟩, h₁⟩, ⟨b, c, ⟨rfl, rfl⟩, h₂⟩⟩
def singletonImage (x : TSet β) : TSet α :=
singletonImage' hβ hγ hδ hε x ⊓' (cross hβ hγ hδ (cardinalOne hδ hε) (cardinalOne hδ hε))
@[simp]
theorem singletonImage_spec (x : TSet β) :
∀ z w,
⟨ {z}', {w}' ⟩' ∈' singletonImage hβ hγ hδ hε x ↔ ⟨z, w⟩' ∈' x := by
intro z w
rw [singletonImage, mem_inter_iff, singletonImage'_spec, and_iff_left_iff_imp]
intro hzw
rw [mem_cross_iff]
refine ⟨{z}', {w}', rfl, ?_⟩
simp only [mem_cardinalOne_iff, singleton_inj, exists_eq', and_self]
theorem exists_of_mem_singletonImage {x : TSet β} {z w : TSet δ}
(h : ⟨z, w⟩' ∈' singletonImage hβ hγ hδ hε x) :
∃ a b, z = {a}' ∧ w = {b}' := by
simp only [singletonImage, mem_inter_iff, mem_cross_iff, op_inj, mem_cardinalOne_iff] at h
obtain ⟨-, _, _, ⟨rfl, rfl⟩, ⟨a, rfl⟩, ⟨b, rfl⟩⟩ := h
exact ⟨a, b, rfl, rfl⟩
/-- Turn a model element encoding a relation into an actual relation. -/
def ExternalRel (r : TSet α) : Rel (TSet δ) (TSet δ) :=
λ x y ↦ ⟨x, y⟩' ∈' r
@[simp]
theorem externalRel_converse (r : TSet α) :
ExternalRel hβ hγ hδ (converse hβ hγ hδ r) = (ExternalRel hβ hγ hδ r).inv := by
ext
simp only [ExternalRel, op_mem_converse_iff, Rel.inv_apply]
/-- The codomain of a relation. -/
def codom (r : TSet α) : TSet γ :=
(typeLower lt_higherIndex hβ hγ hδ (singletonImage lt_higherIndex hβ hγ hδ r)ᶜ[lt_higherIndex])ᶜ'
@[simp]
theorem mem_codom_iff (r : TSet α) (x : TSet δ) :
x ∈' codom hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).codom := by
simp only [codom, mem_compl_iff, mem_typeLower_iff, not_forall, not_not]
constructor
· rintro ⟨y, hy⟩
obtain ⟨a, b, rfl, hb⟩ := exists_of_mem_singletonImage lt_higherIndex hβ hγ hδ hy
rw [singleton_inj] at hb
subst hb
rw [singletonImage_spec] at hy
exact ⟨a, hy⟩
· rintro ⟨a, ha⟩
use {a}'
rw [singletonImage_spec]
exact ha
/-- The domain of a relation. -/
def dom (r : TSet α) : TSet γ :=
codom hβ hγ hδ (converse hβ hγ hδ r)
@[simp]
theorem mem_dom_iff (r : TSet α) (x : TSet δ) :
x ∈' dom hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).dom := by
rw [dom, mem_codom_iff, externalRel_converse, Rel.inv_codom]
/-- The field of a relation. -/
def field (r : TSet α) : TSet γ :=
dom hβ hγ hδ r ⊔' codom hβ hγ hδ r
@[simp]
theorem mem_field_iff (r : TSet α) (x : TSet δ) :
x ∈' field hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).field := by
rw [field, mem_union_iff, mem_dom_iff, mem_codom_iff, Rel.field, Set.mem_union]
def subset : TSet α :=
subset' hβ hγ hδ hε ⊓' orderedPairs hβ hγ hδ
@[simp]
theorem subset_spec :
∀ a b, ⟨a, b⟩' ∈' subset hβ hγ hδ hε ↔ a ⊆[TSet ε] b := by
intro a b
simp only [subset, mem_inter_iff, subset'_spec, mem_orderedPairs_iff, op_inj, exists_and_left,
exists_eq', and_true]
def membership : TSet α :=
subset hβ hγ hδ hε ⊓' cross hβ hγ hδ (cardinalOne hδ hε) (univ hδ)
@[simp]
theorem membership_spec :
∀ a b, ⟨{a}', b⟩' ∈' membership hβ hγ hδ hε ↔ a ∈' b := by
intro a b
rw [membership, mem_inter_iff, subset_spec]
simp only [mem_cross_iff, op_inj, mem_cardinalOne_iff, mem_univ_iff, and_true, exists_and_right,
exists_and_left, exists_eq', exists_eq_left', singleton_inj]
constructor
· intro h
exact h a ((typedMem_singleton_iff' hε a a).mpr rfl)
· intro h c hc
simp only [typedMem_singleton_iff'] at hc
cases hc
exact h
def powerset (x : TSet β) : TSet α :=
dom lt_higherIndex lt_higherIndex hβ
(subset lt_higherIndex lt_higherIndex hβ hγ ⊓[lt_higherIndex]
vCross lt_higherIndex lt_higherIndex hβ {x}')
@[simp]
theorem mem_powerset_iff (x y : TSet β) :
x ∈' powerset hβ hγ y ↔ x ⊆[TSet γ] y := by
rw [powerset, mem_dom_iff]
constructor
· rintro ⟨z, h⟩
simp only [ExternalRel, mem_inter_iff, subset_spec, vCross_spec, op_inj,
typedMem_singleton_iff', exists_eq_right, exists_and_right, exists_eq', true_and] at h
cases h.2
exact h.1
· intro h
refine ⟨y, ?_⟩
simp only [ExternalRel, mem_inter_iff, subset_spec, h, vCross_spec, op_inj,
typedMem_singleton_iff', exists_eq_right, and_true, exists_eq', and_self]
/-- The set `ι²''x = {{{a}} | a ∈ x}`. -/
def doubleSingleton (x : TSet γ) : TSet α :=
cross hβ hγ hδ x x ⊓' cardinalOne hβ hγ
@[simp]
theorem mem_doubleSingleton_iff (x : TSet γ) :
∀ y : TSet β, y ∈' doubleSingleton hβ hγ hδ x ↔
∃ z : TSet δ, z ∈' x ∧ y = { {z}' }' := by
intro y
rw [doubleSingleton, mem_inter_iff, mem_cross_iff, mem_cardinalOne_iff]
constructor
· rintro ⟨⟨b, c, h₁, h₂, h₃⟩, ⟨a, rfl⟩⟩
obtain ⟨hbc, rfl⟩ := (op_eq_singleton_iff _ _ _ _ _).mp h₁.symm
exact ⟨c, h₃, rfl⟩
· rintro ⟨z, h, rfl⟩
constructor
· refine ⟨z, z, ?_⟩
rw [eq_comm, op_eq_singleton_iff]
tauto
· exact ⟨_, rfl⟩
/-- The union of a set of *singletons*: `ι⁻¹''x = {a | {a} ∈ x}`. -/
def singletonUnion (x : TSet α) : TSet β :=
typeLower lt_higherIndex lt_higherIndex hβ hγ
(vCross lt_higherIndex lt_higherIndex hβ x)
@[simp]
theorem mem_singletonUnion_iff (x : TSet α) :
∀ y : TSet γ, y ∈' singletonUnion hβ hγ x ↔ {y}' ∈' x := by
intro y
simp only [singletonUnion, mem_typeLower_iff, vCross_spec, op_inj]
constructor
· intro h
obtain ⟨a, b, ⟨rfl, rfl⟩, hy⟩ := h {y}'
exact hy
· intro h b
exact ⟨b, _, ⟨rfl, rfl⟩, h⟩
/--
The union of a set of sets.
```
singletonUnion dom {⟨{a}, b⟩ | a ∈ b} ∩ (1 × x) =
singletonUnion dom {⟨{a}, b⟩ | a ∈ b ∧ b ∈ x} =
singletonUnion {{a} | a ∈ b ∧ b ∈ x} =
{a | a ∈ b ∧ b ∈ x} =
⋃ x
```
-/
def sUnion (x : TSet α) : TSet β :=
singletonUnion hβ hγ
(dom lt_higherIndex lt_higherIndex hβ
(membership lt_higherIndex lt_higherIndex hβ hγ ⊓[lt_higherIndex]
cross lt_higherIndex lt_higherIndex hβ (cardinalOne hβ hγ) x))
| @[simp]
theorem mem_sUnion_iff (x : TSet α) :
∀ y : TSet γ, y ∈' sUnion hβ hγ x ↔ ∃ t : TSet β, t ∈' x ∧ y ∈' t | ConNF.mem_sUnion_iff | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | {
"commit": "d9f28df240ac4df047c3af0d236aed2e437e571f",
"date": "2025-01-07T00:00:00"
} | ConNF/ConNF/External/Basic.lean | ConNF.External.Basic | ConNF.External.Basic.jsonl | {
"lineInFile": 276,
"tokenPositionInFile": 8540,
"theoremPositionInFile": 39
} | {
"inFilePremises": true,
"numInFilePremises": 12,
"repositoryPremises": true,
"numRepositoryPremises": 29,
"numPremises": 69
} | {
"hasProof": true,
"proof": ":= by\n intro y\n simp only [sUnion, mem_singletonUnion_iff, mem_dom_iff, Rel.dom, ExternalRel, mem_inter_iff,\n mem_cross_iff, op_inj, mem_cardinalOne_iff, Set.mem_setOf_eq, membership_spec]\n constructor\n · rintro ⟨z, h₁, a, b, ⟨rfl, rfl⟩, ⟨c, h₂⟩, h₃⟩\n rw [singleton_inj] at h₂\n cases h₂\n exact ⟨z, h₃, h₁⟩\n · rintro ⟨z, h₂, h₃⟩\n exact ⟨z, h₃, _, _, ⟨rfl, rfl⟩, ⟨y, rfl⟩, h₂⟩",
"proofType": "tactic",
"proofLengthLines": 10,
"proofLengthTokens": 394
} |
import ConNF.ModelData.PathEnumeration
/-!
# Supports
In this file, we define the notion of a support.
## Main declarations
* `ConNF.BaseSupport`: The type of supports of atoms.
* `ConNF.Support`: The type of supports of objects of arbitrary type indices.
-/
universe u
open Cardinal
namespace ConNF
variable [Params.{u}]
/-!
## Base supports
-/
structure BaseSupport where
atoms : Enumeration Atom
nearLitters : Enumeration NearLitter
namespace BaseSupport
instance : SuperA BaseSupport (Enumeration Atom) where
superA := atoms
instance : SuperN BaseSupport (Enumeration NearLitter) where
superN := nearLitters
@[simp]
theorem mk_atoms {a : Enumeration Atom} {N : Enumeration NearLitter} :
(BaseSupport.mk a N)ᴬ = a :=
rfl
@[simp]
theorem mk_nearLitters {a : Enumeration Atom} {N : Enumeration NearLitter} :
(BaseSupport.mk a N)ᴺ = N :=
rfl
theorem atoms_congr {S T : BaseSupport} (h : S = T) :
Sᴬ = Tᴬ :=
h ▸ rfl
theorem nearLitters_congr {S T : BaseSupport} (h : S = T) :
Sᴺ = Tᴺ :=
h ▸ rfl
@[ext]
theorem ext {S T : BaseSupport} (h₁ : Sᴬ = Tᴬ) (h₂ : Sᴺ = Tᴺ) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
cases h₁
cases h₂
rfl
instance : SMul BasePerm BaseSupport where
smul π S := ⟨π • Sᴬ, π • Sᴺ⟩
@[simp]
theorem smul_atoms (π : BasePerm) (S : BaseSupport) :
(π • S)ᴬ = π • Sᴬ :=
rfl
@[simp]
theorem smul_nearLitters (π : BasePerm) (S : BaseSupport) :
(π • S)ᴺ = π • Sᴺ :=
rfl
@[simp]
theorem smul_atoms_eq_of_smul_eq {π : BasePerm} {S : BaseSupport}
(h : π • S = S) :
π • Sᴬ = Sᴬ := by
rw [← smul_atoms, h]
@[simp]
theorem smul_nearLitters_eq_of_smul_eq {π : BasePerm} {S : BaseSupport}
(h : π • S = S) :
π • Sᴺ = Sᴺ := by
rw [← smul_nearLitters, h]
instance : MulAction BasePerm BaseSupport where
one_smul S := by
apply ext
· rw [smul_atoms, one_smul]
· rw [smul_nearLitters, one_smul]
mul_smul π₁ π₂ S := by
apply ext
· rw [smul_atoms, smul_atoms, smul_atoms, mul_smul]
· rw [smul_nearLitters, smul_nearLitters, smul_nearLitters, mul_smul]
theorem smul_eq_smul_iff (π₁ π₂ : BasePerm) (S : BaseSupport) :
π₁ • S = π₂ • S ↔ (∀ a ∈ Sᴬ, π₁ • a = π₂ • a) ∧ (∀ N ∈ Sᴺ, π₁ • N = π₂ • N) := by
constructor
· intro h
constructor
· rintro a ⟨i, ha⟩
have := congr_arg (·ᴬ.rel i (π₁ • a)) h
simp only [smul_atoms, Enumeration.smul_rel, inv_smul_smul, eq_iff_iff] at this
have := Sᴬ.rel_coinjective.coinjective ha (this.mp ha)
rw [eq_inv_smul_iff] at this
rw [this]
· rintro N ⟨i, hN⟩
have := congr_arg (·ᴺ.rel i (π₁ • N)) h
simp only [smul_nearLitters, Enumeration.smul_rel, inv_smul_smul, eq_iff_iff] at this
have := Sᴺ.rel_coinjective.coinjective hN (this.mp hN)
rw [eq_inv_smul_iff] at this
rw [this]
· intro h
ext : 2
· rfl
· ext i a : 3
rw [smul_atoms, smul_atoms, Enumeration.smul_rel, Enumeration.smul_rel]
constructor
· intro ha
have := h.1 _ ⟨i, ha⟩
rw [smul_inv_smul, ← inv_smul_eq_iff] at this
rwa [this]
· intro ha
have := h.1 _ ⟨i, ha⟩
rw [smul_inv_smul, smul_eq_iff_eq_inv_smul] at this
rwa [← this]
· rfl
· ext i a : 3
rw [smul_nearLitters, smul_nearLitters, Enumeration.smul_rel, Enumeration.smul_rel]
constructor
· intro hN
have := h.2 _ ⟨i, hN⟩
rw [smul_inv_smul, ← inv_smul_eq_iff] at this
rwa [this]
· intro hN
have := h.2 _ ⟨i, hN⟩
rw [smul_inv_smul, smul_eq_iff_eq_inv_smul] at this
rwa [← this]
theorem smul_eq_iff (π : BasePerm) (S : BaseSupport) :
π • S = S ↔ (∀ a ∈ Sᴬ, π • a = a) ∧ (∀ N ∈ Sᴺ, π • N = N) := by
have := smul_eq_smul_iff π 1 S
simp only [one_smul] at this
exact this
noncomputable instance : Add BaseSupport where
add S T := ⟨Sᴬ + Tᴬ, Sᴺ + Tᴺ⟩
@[simp]
theorem add_atoms (S T : BaseSupport) :
(S + T)ᴬ = Sᴬ + Tᴬ :=
rfl
@[simp]
theorem add_nearLitters (S T : BaseSupport) :
(S + T)ᴺ = Sᴺ + Tᴺ :=
rfl
end BaseSupport
def baseSupportEquiv : BaseSupport ≃ Enumeration Atom × Enumeration NearLitter where
toFun S := (Sᴬ, Sᴺ)
invFun S := ⟨S.1, S.2⟩
left_inv _ := rfl
right_inv _ := rfl
theorem card_baseSupport : #BaseSupport = #μ := by
rw [Cardinal.eq.mpr ⟨baseSupportEquiv⟩, mk_prod, lift_id, lift_id,
card_enumeration_eq card_atom, card_enumeration_eq card_nearLitter, mul_eq_self aleph0_lt_μ.le]
/-!
## Structural supports
-/
structure Support (α : TypeIndex) where
atoms : Enumeration (α ↝ ⊥ × Atom)
nearLitters : Enumeration (α ↝ ⊥ × NearLitter)
namespace Support
variable {α β : TypeIndex}
instance : SuperA (Support α) (Enumeration (α ↝ ⊥ × Atom)) where
superA := atoms
instance : SuperN (Support α) (Enumeration (α ↝ ⊥ × NearLitter)) where
superN := nearLitters
@[simp]
theorem mk_atoms (E : Enumeration (α ↝ ⊥ × Atom)) (F : Enumeration (α ↝ ⊥ × NearLitter)) :
(⟨E, F⟩ : Support α)ᴬ = E :=
rfl
@[simp]
theorem mk_nearLitters (E : Enumeration (α ↝ ⊥ × Atom)) (F : Enumeration (α ↝ ⊥ × NearLitter)) :
(⟨E, F⟩ : Support α)ᴺ = F :=
rfl
instance : Derivative (Support α) (Support β) α β where
deriv S A := ⟨Sᴬ ⇘ A, Sᴺ ⇘ A⟩
instance : Coderivative (Support β) (Support α) α β where
coderiv S A := ⟨Sᴬ ⇗ A, Sᴺ ⇗ A⟩
instance : BotDerivative (Support α) BaseSupport α where
botDeriv S A := ⟨Sᴬ ⇘. A, Sᴺ ⇘. A⟩
botSderiv S := ⟨Sᴬ ↘., Sᴺ ↘.⟩
botDeriv_single S h := by dsimp only; rw [botDeriv_single, botDeriv_single]
@[simp]
theorem deriv_atoms {α β : TypeIndex} (S : Support α) (A : α ↝ β) :
Sᴬ ⇘ A = (S ⇘ A)ᴬ :=
rfl
@[simp]
theorem deriv_nearLitters {α β : TypeIndex} (S : Support α) (A : α ↝ β) :
Sᴺ ⇘ A = (S ⇘ A)ᴺ :=
rfl
@[simp]
theorem sderiv_atoms {α β : TypeIndex} (S : Support α) (h : β < α) :
Sᴬ ↘ h = (S ↘ h)ᴬ :=
rfl
@[simp]
theorem sderiv_nearLitters {α β : TypeIndex} (S : Support α) (h : β < α) :
Sᴺ ↘ h = (S ↘ h)ᴺ :=
rfl
@[simp]
theorem coderiv_atoms {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
Sᴬ ⇗ A = (S ⇗ A)ᴬ :=
rfl
@[simp]
theorem coderiv_nearLitters {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
Sᴺ ⇗ A = (S ⇗ A)ᴺ :=
rfl
@[simp]
theorem scoderiv_atoms {α β : TypeIndex} (S : Support β) (h : β < α) :
Sᴬ ↗ h = (S ↗ h)ᴬ :=
rfl
@[simp]
theorem scoderiv_nearLitters {α β : TypeIndex} (S : Support β) (h : β < α) :
Sᴺ ↗ h = (S ↗ h)ᴺ :=
rfl
@[simp]
theorem derivBot_atoms {α : TypeIndex} (S : Support α) (A : α ↝ ⊥) :
Sᴬ ⇘. A = (S ⇘. A)ᴬ :=
rfl
@[simp]
theorem derivBot_nearLitters {α : TypeIndex} (S : Support α) (A : α ↝ ⊥) :
Sᴺ ⇘. A = (S ⇘. A)ᴺ :=
rfl
theorem ext' {S T : Support α} (h₁ : Sᴬ = Tᴬ) (h₂ : Sᴺ = Tᴺ) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
cases h₁
cases h₂
rfl
@[ext]
theorem ext {S T : Support α} (h : ∀ A, S ⇘. A = T ⇘. A) : S = T := by
obtain ⟨SA, SN⟩ := S
obtain ⟨TA, TN⟩ := T
rw [mk.injEq]
constructor
· apply Enumeration.ext_path
intro A
exact BaseSupport.atoms_congr (h A)
· apply Enumeration.ext_path
intro A
exact BaseSupport.nearLitters_congr (h A)
@[simp]
theorem deriv_derivBot {α : TypeIndex} (S : Support α)
(A : α ↝ β) (B : β ↝ ⊥) :
S ⇘ A ⇘. B = S ⇘. (A ⇘ B) :=
rfl
@[simp]
theorem coderiv_deriv_eq {α β : TypeIndex} (S : Support β) (A : α ↝ β) :
S ⇗ A ⇘ A = S :=
ext' (Sᴬ.coderiv_deriv_eq A) (Sᴺ.coderiv_deriv_eq A)
theorem eq_of_atom_mem_scoderiv_botDeriv {α β : TypeIndex} {S : Support β} {A : α ↝ ⊥}
{h : β < α} {a : Atom} (ha : a ∈ (S ↗ h ⇘. A)ᴬ) :
∃ B : β ↝ ⊥, A = B ↗ h :=
Enumeration.eq_of_mem_scoderiv_botDeriv ha
theorem eq_of_nearLitter_mem_scoderiv_botDeriv {α β : TypeIndex} {S : Support β} {A : α ↝ ⊥}
{h : β < α} {N : NearLitter} (hN : N ∈ (S ↗ h ⇘. A)ᴺ) :
∃ B : β ↝ ⊥, A = B ↗ h :=
Enumeration.eq_of_mem_scoderiv_botDeriv hN
@[simp]
theorem scoderiv_botDeriv_eq {α β : TypeIndex} (S : Support β) (A : β ↝ ⊥) (h : β < α) :
S ↗ h ⇘. (A ↗ h) = S ⇘. A :=
BaseSupport.ext (Enumeration.scoderiv_botDeriv_eq _ _ _) (Enumeration.scoderiv_botDeriv_eq _ _ _)
@[simp]
theorem scoderiv_deriv_eq {α β γ : TypeIndex} (S : Support β) (A : β ↝ γ) (h : β < α) :
S ↗ h ⇘ (A ↗ h) = S ⇘ A := by
apply ext
intro B
simp only [deriv_derivBot, ← scoderiv_botDeriv_eq S (A ⇘ B) h, Path.coderiv_deriv']
@[simp]
theorem coderiv_inj {α β : TypeIndex} (S T : Support β) (A : α ↝ β) :
S ⇗ A = T ⇗ A ↔ S = T := by
constructor
swap
· rintro rfl
rfl
intro h
ext B : 1
have : S ⇗ A ⇘ A ⇘. B = T ⇗ A ⇘ A ⇘. B := by rw [h]
rwa [coderiv_deriv_eq, coderiv_deriv_eq] at this
@[simp]
theorem scoderiv_inj {α β : TypeIndex} (S T : Support β) (h : β < α) :
S ↗ h = T ↗ h ↔ S = T :=
coderiv_inj S T (.single h)
instance {α : TypeIndex} : SMul (StrPerm α) (Support α) where
smul π S := ⟨π • Sᴬ, π • Sᴺ⟩
@[simp]
theorem smul_atoms {α : TypeIndex} (π : StrPerm α) (S : Support α) :
(π • S)ᴬ = π • Sᴬ :=
rfl
@[simp]
theorem smul_nearLitters {α : TypeIndex} (π : StrPerm α) (S : Support α) :
(π • S)ᴺ = π • Sᴺ :=
rfl
theorem smul_atoms_eq_of_smul_eq {α : TypeIndex} {π : StrPerm α} {S : Support α}
(h : π • S = S) :
π • Sᴬ = Sᴬ := by
rw [← smul_atoms, h]
theorem smul_nearLitters_eq_of_smul_eq {α : TypeIndex} {π : StrPerm α} {S : Support α}
(h : π • S = S) :
π • Sᴺ = Sᴺ := by
rw [← smul_nearLitters, h]
instance {α : TypeIndex} : MulAction (StrPerm α) (Support α) where
one_smul S := by
apply ext'
· rw [smul_atoms, one_smul]
· rw [smul_nearLitters, one_smul]
mul_smul π₁ π₂ S := by
apply ext'
· rw [smul_atoms, smul_atoms, smul_atoms, mul_smul]
· rw [smul_nearLitters, smul_nearLitters, smul_nearLitters, mul_smul]
@[simp]
theorem smul_derivBot {α : TypeIndex} (π : StrPerm α) (S : Support α) (A : α ↝ ⊥) :
(π • S) ⇘. A = π A • (S ⇘. A) :=
rfl
theorem smul_coderiv {α : TypeIndex} (π : StrPerm α) (S : Support β) (A : α ↝ β) :
π • S ⇗ A = (π ⇘ A • S) ⇗ A := by
ext B i x
· rfl
· constructor
· rintro ⟨⟨C, x⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, x⟩, hS, rfl⟩
· rintro ⟨⟨C, x⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, _⟩, hS, rfl⟩
· rfl
· constructor
· rintro ⟨⟨C, x⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, x⟩, hS, rfl⟩
· rintro ⟨⟨C, a⟩, hS, hx⟩
simp only [Prod.mk.injEq] at hx
obtain ⟨rfl, rfl⟩ := hx
exact ⟨⟨C, _⟩, hS, rfl⟩
theorem smul_scoderiv {α : TypeIndex} (π : StrPerm α) (S : Support β) (h : β < α) :
π • S ↗ h = (π ↘ h • S) ↗ h :=
smul_coderiv π S (Path.single h)
theorem smul_eq_smul_iff (π₁ π₂ : StrPerm β) (S : Support β) :
π₁ • S = π₂ • S ↔
∀ A, (∀ a ∈ (S ⇘. A)ᴬ, π₁ A • a = π₂ A • a) ∧ (∀ N ∈ (S ⇘. A)ᴺ, π₁ A • N = π₂ A • N) := by
constructor
· intro h A
have := congr_arg (· ⇘. A) h
simp only [smul_derivBot, BaseSupport.smul_eq_smul_iff] at this
exact this
· intro h
apply ext
intro A
simp only [smul_derivBot, BaseSupport.smul_eq_smul_iff]
exact h A
theorem smul_eq_iff (π : StrPerm β) (S : Support β) :
π • S = S ↔ ∀ A, (∀ a ∈ (S ⇘. A)ᴬ, π A • a = a) ∧ (∀ N ∈ (S ⇘. A)ᴺ, π A • N = N) := by
have := smul_eq_smul_iff π 1 S
simp only [one_smul, Tree.one_apply] at this
exact this
noncomputable instance : Add (Support α) where
add S T := ⟨Sᴬ + Tᴬ, Sᴺ + Tᴺ⟩
@[simp]
theorem add_derivBot (S T : Support α) (A : α ↝ ⊥) :
(S + T) ⇘. A = (S ⇘. A) + (T ⇘. A) :=
rfl
theorem smul_add (S T : Support α) (π : StrPerm α) :
π • (S + T) = π • S + π • T :=
rfl
theorem add_inj_of_bound_eq_bound {S T U V : Support α}
(ha : Sᴬ.bound = Tᴬ.bound) (hN : Sᴺ.bound = Tᴺ.bound)
(h' : S + U = T + V) : S = T ∧ U = V := by
have ha' := Enumeration.add_inj_of_bound_eq_bound ha (congr_arg (·ᴬ) h')
have hN' := Enumeration.add_inj_of_bound_eq_bound hN (congr_arg (·ᴺ) h')
constructor
· exact Support.ext' ha'.1 hN'.1
· exact Support.ext' ha'.2 hN'.2
end Support
def supportEquiv {α : TypeIndex} : Support α ≃
Enumeration (α ↝ ⊥ × Atom) × Enumeration (α ↝ ⊥ × NearLitter) where
toFun S := (Sᴬ, Sᴺ)
invFun S := ⟨S.1, S.2⟩
left_inv _ := rfl
right_inv _ := rfl
theorem card_support {α : TypeIndex} : #(Support α) = #μ := by
rw [Cardinal.eq.mpr ⟨supportEquiv⟩, mk_prod, lift_id, lift_id,
card_enumeration_eq, card_enumeration_eq, mul_eq_self aleph0_lt_μ.le]
· rw [mk_prod, lift_id, lift_id, card_nearLitter,
mul_eq_right aleph0_lt_μ.le (card_path_lt' α ⊥).le (card_path_ne_zero α)]
· rw [mk_prod, lift_id, lift_id, card_atom,
mul_eq_right aleph0_lt_μ.le (card_path_lt' α ⊥).le (card_path_ne_zero α)]
/-!
## Orders on supports
-/
-- TODO: Is this order used?
instance : LE BaseSupport where
le S T := (∀ a ∈ Sᴬ, a ∈ Tᴬ) ∧ (∀ N ∈ Sᴺ, N ∈ Tᴺ)
instance : Preorder BaseSupport where
le_refl S := ⟨λ _ ↦ id, λ _ ↦ id⟩
le_trans S T U h₁ h₂ := ⟨λ a h ↦ h₂.1 _ (h₁.1 a h), λ N h ↦ h₂.2 _ (h₁.2 N h)⟩
theorem BaseSupport.smul_le_smul {S T : BaseSupport} (h : S ≤ T) (π : BasePerm) :
π • S ≤ π • T := by
constructor
· intro a
exact h.1 (π⁻¹ • a)
· intro N
exact h.2 (π⁻¹ • N)
theorem BaseSupport.le_add_right {S T : BaseSupport} :
S ≤ S + T := by
constructor
· intro a ha
simp only [Support.add_derivBot, BaseSupport.add_atoms, Enumeration.mem_add_iff]
exact Or.inl ha
· intro N hN
simp only [Support.add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
exact Or.inl hN
theorem BaseSupport.le_add_left {S T : BaseSupport} :
S ≤ T + S := by
constructor
· intro a ha
simp only [add_atoms, Enumeration.mem_add_iff]
exact Or.inr ha
· intro N hN
simp only [add_nearLitters, Enumeration.mem_add_iff]
exact Or.inr hN
def BaseSupport.Subsupport (S T : BaseSupport) : Prop :=
Sᴬ.rel ≤ Tᴬ.rel ∧ Sᴺ.rel ≤ Tᴺ.rel
theorem BaseSupport.Subsupport.le {S T : BaseSupport}
(h : S.Subsupport T) : S ≤ T := by
constructor
· rintro a ⟨i, hi⟩
exact ⟨i, h.1 i a hi⟩
· rintro N ⟨i, hi⟩
exact ⟨i, h.2 i N hi⟩
theorem BaseSupport.Subsupport.trans {S T U : BaseSupport}
(h₁ : S.Subsupport T) (h₂ : T.Subsupport U) :
S.Subsupport U :=
⟨h₁.1.trans h₂.1, h₁.2.trans h₂.2⟩
theorem BaseSupport.smul_subsupport_smul {S T : BaseSupport} (h : S.Subsupport T) (π : BasePerm) :
(π • S).Subsupport (π • T) := by
constructor
· intro i a ha
exact h.1 i _ ha
· intro i N hN
exact h.2 i _ hN
instance {α : TypeIndex} : LE (Support α) where
le S T := ∀ A, S ⇘. A ≤ T ⇘. A
instance {α : TypeIndex} : Preorder (Support α) where
le_refl S := λ A ↦ le_rfl
le_trans S T U h₁ h₂ := λ A ↦ (h₁ A).trans (h₂ A)
theorem Support.smul_le_smul {α : TypeIndex} {S T : Support α} (h : S ≤ T) (π : StrPerm α) :
π • S ≤ π • T :=
λ A ↦ BaseSupport.smul_le_smul (h A) (π A)
theorem Support.le_add_right {α : TypeIndex} {S T : Support α} :
S ≤ S + T := by
intro A
rw [add_derivBot]
exact BaseSupport.le_add_right
theorem Support.le_add_left {α : TypeIndex} {S T : Support α} :
S ≤ T + S := by
intro A
rw [add_derivBot]
exact BaseSupport.le_add_left
def Support.Subsupport {α : TypeIndex} (S T : Support α) : Prop :=
∀ A, (S ⇘. A).Subsupport (T ⇘. A)
theorem Support.Subsupport.le {α : TypeIndex} {S T : Support α}
(h : S.Subsupport T) : S ≤ T :=
λ A ↦ (h A).le
theorem Support.Subsupport.trans {α : TypeIndex} {S T U : Support α}
(h₁ : S.Subsupport T) (h₂ : T.Subsupport U) :
S.Subsupport U :=
λ A ↦ (h₁ A).trans (h₂ A)
theorem Support.smul_subsupport_smul {α : TypeIndex} {S T : Support α}
(h : S.Subsupport T) (π : StrPerm α) :
(π • S).Subsupport (π • T) :=
λ A ↦ BaseSupport.smul_subsupport_smul (h A) (π A)
theorem subsupport_add {α : TypeIndex} {S T : Support α} :
S.Subsupport (S + T) := by
intro A
constructor
· intro i a ha
simp only [Support.add_derivBot, BaseSupport.add_atoms, Enumeration.rel_add_iff]
exact Or.inl ha
· intro i N hN
simp only [Support.add_derivBot, BaseSupport.add_atoms, Enumeration.rel_add_iff]
exact Or.inl hN
theorem smul_eq_of_subsupport {α : TypeIndex} {S T : Support α} {π : StrPerm α}
(h₁ : S.Subsupport T) (h₂ : S.Subsupport (π • T)) :
π • S = S := by
rw [Support.smul_eq_iff]
intro A
constructor
· rintro a ⟨i, hi⟩
have hi₁ := (h₁ A).1 i a hi
have hi₂ := (h₂ A).1 i a hi
have := (T ⇘. A)ᴬ.rel_coinjective.coinjective hi₁ hi₂
dsimp only at this
rwa [smul_eq_iff_eq_inv_smul]
· rintro N ⟨i, hi⟩
have hi₁ := (h₁ A).2 i N hi
have hi₂ := (h₂ A).2 i N hi
have := (T ⇘. A)ᴺ.rel_coinjective.coinjective hi₁ hi₂
dsimp only at this
rwa [smul_eq_iff_eq_inv_smul]
| theorem smul_eq_smul_of_le {α : TypeIndex} {S T : Support α} {π₁ π₂ : StrPerm α}
(h : S ≤ T) (h₂ : π₁ • T = π₂ • T) :
π₁ • S = π₂ • S | ConNF.smul_eq_smul_of_le | {
"commit": "39c33b4a743bea62dbcc549548b712ffd38ca65c",
"date": "2024-12-05T00:00:00"
} | {
"commit": "6709914ae7f5cd3e2bb24b413e09aa844554d234",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/ModelData/Support.lean | ConNF.ModelData.Support | ConNF.ModelData.Support.jsonl | {
"lineInFile": 591,
"tokenPositionInFile": 16769,
"theoremPositionInFile": 65
} | {
"inFilePremises": true,
"numInFilePremises": 8,
"repositoryPremises": true,
"numRepositoryPremises": 23,
"numPremises": 39
} | {
"hasProof": true,
"proof": ":= by\n rw [Support.smul_eq_smul_iff] at h₂ ⊢\n intro A\n constructor\n · intro a ha\n exact (h₂ A).1 a ((h A).1 a ha)\n · intro N hN\n exact (h₂ A).2 N ((h A).2 N hN)",
"proofType": "tactic",
"proofLengthLines": 7,
"proofLengthTokens": 171
} |
import ConNF.Model.Result
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
def union (x y : TSet α) : TSet α :=
(xᶜ' ⊓' yᶜ')ᶜ'
notation:68 x:68 " ⊔[" h "] " y:68 => _root_.ConNF.union h x y
notation:68 x:68 " ⊔' " y:68 => x ⊔[by assumption] y
@[simp]
theorem mem_union_iff (x y : TSet α) :
∀ z : TSet β, z ∈' x ⊔' y ↔ z ∈' x ∨ z ∈' y := by
rw [union]
intro z
rw [mem_compl_iff, mem_inter_iff, mem_compl_iff, mem_compl_iff, or_iff_not_and_not]
def higherIndex (α : Λ) : Λ :=
(exists_gt α).choose
theorem lt_higherIndex {α : Λ} :
(α : TypeIndex) < higherIndex α :=
WithBot.coe_lt_coe.mpr (exists_gt α).choose_spec
theorem tSet_nonempty (h : ∃ β : Λ, (β : TypeIndex) < α) : Nonempty (TSet α) := by
obtain ⟨α', hα⟩ := h
constructor
apply typeLower lt_higherIndex lt_higherIndex lt_higherIndex hα
apply cardinalOne lt_higherIndex lt_higherIndex
def empty : TSet α :=
(tSet_nonempty ⟨β, hβ⟩).some ⊓' (tSet_nonempty ⟨β, hβ⟩).someᶜ'
@[simp]
theorem mem_empty_iff :
∀ x : TSet β, ¬x ∈' empty hβ := by
intro x
rw [empty, mem_inter_iff, mem_compl_iff]
exact and_not_self
def univ : TSet α :=
(empty hβ)ᶜ'
@[simp]
theorem mem_univ_iff :
∀ x : TSet β, x ∈' univ hβ := by
intro x
simp only [univ, mem_compl_iff, mem_empty_iff, not_false_eq_true]
/-- The set of all ordered pairs. -/
def orderedPairs : TSet α :=
vCross hβ hγ hδ (univ hδ)
@[simp]
theorem mem_orderedPairs_iff (x : TSet β) :
x ∈' orderedPairs hβ hγ hδ ↔ ∃ a b, x = ⟨a, b⟩' := by
simp only [orderedPairs, vCross_spec, mem_univ_iff, and_true]
def converse (x : TSet α) : TSet α :=
converse' hβ hγ hδ x ⊓' orderedPairs hβ hγ hδ
@[simp]
theorem op_mem_converse_iff (x : TSet α) :
∀ a b, ⟨a, b⟩' ∈' converse hβ hγ hδ x ↔ ⟨b, a⟩' ∈' x := by
intro a b
simp only [converse, mem_inter_iff, converse'_spec, mem_orderedPairs_iff, op_inj, exists_and_left,
exists_eq', and_true]
def cross (x y : TSet γ) : TSet α :=
converse hβ hγ hδ (vCross hβ hγ hδ x) ⊓' vCross hβ hγ hδ y
@[simp]
theorem mem_cross_iff (x y : TSet γ) :
∀ a, a ∈' cross hβ hγ hδ x y ↔ ∃ b c, a = ⟨b, c⟩' ∧ b ∈' x ∧ c ∈' y := by
intro a
rw [cross, mem_inter_iff, vCross_spec]
constructor
· rintro ⟨h₁, b, c, rfl, h₂⟩
simp only [op_mem_converse_iff, vCross_spec, op_inj] at h₁
obtain ⟨b', c', ⟨rfl, rfl⟩, h₁⟩ := h₁
exact ⟨b, c, rfl, h₁, h₂⟩
· rintro ⟨b, c, rfl, h₁, h₂⟩
simp only [op_mem_converse_iff, vCross_spec, op_inj]
exact ⟨⟨c, b, ⟨rfl, rfl⟩, h₁⟩, ⟨b, c, ⟨rfl, rfl⟩, h₂⟩⟩
def singletonImage (x : TSet β) : TSet α :=
singletonImage' hβ hγ hδ hε x ⊓' (cross hβ hγ hδ (cardinalOne hδ hε) (cardinalOne hδ hε))
| @[simp]
theorem singletonImage_spec (x : TSet β) :
∀ z w,
⟨ {z}', {w}' ⟩' ∈' singletonImage hβ hγ hδ hε x ↔ ⟨z, w⟩' ∈' x | ConNF.singletonImage_spec | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | ConNF/ConNF/External/Basic.lean | ConNF.External.Basic | ConNF.External.Basic.jsonl | {
"lineInFile": 107,
"tokenPositionInFile": 2947,
"theoremPositionInFile": 18
} | {
"inFilePremises": true,
"numInFilePremises": 3,
"repositoryPremises": true,
"numRepositoryPremises": 21,
"numPremises": 52
} | {
"hasProof": true,
"proof": ":= by\n intro z w\n rw [singletonImage, mem_inter_iff, singletonImage'_spec, and_iff_left_iff_imp]\n intro hzw\n rw [mem_cross_iff]\n refine ⟨{z}', {w}', rfl, ?_⟩\n simp only [mem_cardinalOne_iff, singleton_inj, exists_eq', and_self]",
"proofType": "tactic",
"proofLengthLines": 6,
"proofLengthTokens": 233
} |
import ConNF.ModelData.Enumeration
import ConNF.Levels.StrPerm
/-!
# Enumerations over paths
In this file, we provide extra features to `Enumeration`s that take values of the form `α ↝ ⊥ × X`.
## Main declarations
* `ConNF.Enumeration.ext_path`: An extensionality principle for such `Enumeration`s.
-/
noncomputable section
universe u
open Cardinal Ordinal
namespace ConNF
variable [Params.{u}]
namespace Enumeration
/-- A helper function for making relations with domain and codomain of the form `α ↝ ⊥ × X`
by defining it on each branch. -/
def relWithPath {X Y : Type u} {α : TypeIndex} (f : α ↝ ⊥ → Rel X Y) :
Rel (α ↝ ⊥ × X) (α ↝ ⊥ × Y) :=
λ x y ↦ x.1 = y.1 ∧ f x.1 x.2 y.2
theorem relWithPath_coinjective {X Y : Type u} {α : TypeIndex} {f : α ↝ ⊥ → Rel X Y}
(hf : ∀ A, (f A).Coinjective) :
(relWithPath f).Coinjective := by
constructor
rintro ⟨_, y₁⟩ ⟨_, y₂⟩ ⟨A, x⟩ ⟨rfl, h₁⟩ ⟨rfl, h₂⟩
cases (hf A).coinjective h₁ h₂
rfl
instance (X : Type u) (α β : TypeIndex) :
Derivative (Enumeration (α ↝ ⊥ × X)) (Enumeration (β ↝ ⊥ × X)) α β where
deriv E A := E.invImage (λ x ↦ (x.1 ⇗ A, x.2))
(λ x y h ↦ Prod.ext (Path.deriv_right_injective
((Prod.mk.injEq _ _ _ _).mp h).1) ((Prod.mk.injEq _ _ _ _).mp h).2)
theorem deriv_rel {X : Type _} {α β : TypeIndex} (E : Enumeration (α ↝ ⊥ × X)) (A : α ↝ β)
(i : κ) (x : β ↝ ⊥ × X) :
(E ⇘ A).rel i x ↔ E.rel i (x.1 ⇗ A, x.2) :=
Iff.rfl
instance (X : Type u) (α β : TypeIndex) :
Coderivative (Enumeration (β ↝ ⊥ × X)) (Enumeration (α ↝ ⊥ × X)) α β where
coderiv E A := E.image (λ x ↦ (x.1 ⇗ A, x.2))
theorem coderiv_rel {X : Type _} {α β : TypeIndex} (E : Enumeration (β ↝ ⊥ × X)) (A : α ↝ β)
(i : κ) (x : α ↝ ⊥ × X) :
(E ⇗ A).rel i x ↔ ∃ B, x.1 = A ⇘ B ∧ E.rel i (B, x.2) := by
constructor
· rintro ⟨x, h, rfl⟩
exact ⟨_, rfl, h⟩
· rintro ⟨B, h₁, h₂⟩
refine ⟨(B, x.2), h₂, ?_⟩
apply Prod.ext
· dsimp only
exact h₁.symm
· rfl
theorem scoderiv_rel {X : Type _} {α β : TypeIndex} (E : Enumeration (β ↝ ⊥ × X)) (h : β < α)
(i : κ) (x : α ↝ ⊥ × X) :
(E ↗ h).rel i x ↔ ∃ B, x.1 = B ↗ h ∧ E.rel i (B, x.2) :=
coderiv_rel E (.single h) i x
theorem eq_of_scoderiv_mem {X : Type _} {α β γ : TypeIndex} (E : Enumeration (β ↝ ⊥ × X))
(h : β < α) (h' : γ < α)
(i : κ) (A : γ ↝ ⊥) (x : X) (h : (E ↗ h).rel i ⟨A ↗ h', x⟩) :
β = γ := by
rw [scoderiv_rel] at h
obtain ⟨B, h₁, h₂⟩ := h
exact Path.scoderiv_index_injective h₁.symm
instance (X : Type u) (α : TypeIndex) :
BotDerivative (Enumeration (α ↝ ⊥ × X)) (Enumeration X) α where
botDeriv E A := E.invImage (λ x ↦ (A, x)) (Prod.mk.inj_left A)
botSderiv E := E.invImage (λ x ↦ (Path.nil ↘., x)) (Prod.mk.inj_left (Path.nil ↘.))
botDeriv_single E h := by
cases α using WithBot.recBotCoe with
| bot => cases lt_irrefl ⊥ h
| coe => rfl
| theorem derivBot_rel {X : Type _} {α : TypeIndex} (E : Enumeration (α ↝ ⊥ × X)) (A : α ↝ ⊥)
(i : κ) (x : X) :
(E ⇘. A).rel i x ↔ E.rel i (A, x) | ConNF.Enumeration.derivBot_rel | {
"commit": "39c33b4a743bea62dbcc549548b712ffd38ca65c",
"date": "2024-12-05T00:00:00"
} | {
"commit": "ce890707e37ede74a2fcd66134d3f403335c5cc1",
"date": "2024-11-30T00:00:00"
} | ConNF/ConNF/ModelData/PathEnumeration.lean | ConNF.ModelData.PathEnumeration | ConNF.ModelData.PathEnumeration.jsonl | {
"lineInFile": 89,
"tokenPositionInFile": 2868,
"theoremPositionInFile": 6
} | {
"inFilePremises": true,
"numInFilePremises": 1,
"repositoryPremises": true,
"numRepositoryPremises": 9,
"numPremises": 15
} | {
"hasProof": true,
"proof": ":=\n Iff.rfl",
"proofType": "term",
"proofLengthLines": 1,
"proofLengthTokens": 12
} |
import ConNF.Model.RaiseStrong
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal
open scoped Pointwise
namespace ConNF
variable [Params.{u}]
/-- A redefinition of the derivative of allowable permutations that is invariant of level,
but still has nice definitional properties. -/
@[default_instance 200]
instance {β γ : TypeIndex} : Derivative (AllPerm β) (AllPerm γ) β γ where
deriv ρ A :=
A.recSderiv
(motive := λ (δ : TypeIndex) (A : β ↝ δ) ↦
letI : Level := ⟨δ.recBotCoe (Nonempty.some inferInstance) id⟩
letI : LeLevel δ := ⟨δ.recBotCoe (λ _ ↦ bot_le) (λ _ h ↦ WithBot.coe_le_coe.mpr h.le)
(show δ.recBotCoe (Nonempty.some inferInstance) id = Level.α from rfl)⟩
AllPerm δ)
ρ (λ δ ε A h ρ ↦
letI : Level := ⟨δ.recBotCoe (Nonempty.some inferInstance) id⟩
letI : LeLevel δ := ⟨δ.recBotCoe (λ _ ↦ bot_le) (λ _ h ↦ WithBot.coe_le_coe.mpr h.le)
(show δ.recBotCoe (Nonempty.some inferInstance) id = Level.α from rfl)⟩
letI : LeLevel ε := ⟨h.le.trans LeLevel.elim⟩
PreCoherentData.allPermSderiv h ρ)
@[simp]
theorem allPerm_deriv_nil' {β : TypeIndex}
(ρ : AllPerm β) :
ρ ⇘ (.nil : β ↝ β) = ρ :=
rfl
@[simp]
theorem allPerm_deriv_sderiv' {β γ δ : TypeIndex}
(ρ : AllPerm β) (A : β ↝ γ) (h : δ < γ) :
ρ ⇘ (A ↘ h) = ρ ⇘ A ↘ h :=
rfl
@[simp]
theorem allPermSderiv_forget' {β γ : TypeIndex} (h : γ < β) (ρ : AllPerm β) :
(ρ ↘ h)ᵁ = ρᵁ ↘ h :=
letI : Level := ⟨β.recBotCoe (Nonempty.some inferInstance) id⟩
letI : LeLevel β := ⟨β.recBotCoe (λ _ ↦ bot_le) (λ _ h ↦ WithBot.coe_le_coe.mpr h.le)
(show β.recBotCoe (Nonempty.some inferInstance) id = Level.α from rfl)⟩
letI : LeLevel γ := ⟨h.le.trans LeLevel.elim⟩
allPermSderiv_forget h ρ
@[simp]
theorem allPerm_inv_sderiv' {β γ : TypeIndex} (h : γ < β) (ρ : AllPerm β) :
ρ⁻¹ ↘ h = (ρ ↘ h)⁻¹ := by
apply allPermForget_injective
rw [allPermSderiv_forget', allPermForget_inv, Tree.inv_sderiv, allPermForget_inv,
allPermSderiv_forget']
def Symmetric {α β : Λ} (s : Set (TSet β)) (hβ : (β : TypeIndex) < α) : Prop :=
∃ S : Support α, ∀ ρ : AllPerm α, ρᵁ • S = S → ρ ↘ hβ • s = s
def newSetEquiv {α : Λ} :
letI : Level := ⟨α⟩
@TSet _ α newModelData.toPreModelData ≃ TSet α :=
letI : Level := ⟨α⟩
castTSet (D₁ := newModelData) (D₂ := globalModelData) rfl
(by rw [globalModelData, motive_eq, constructMotive, globalLtData_eq])
@[simp]
theorem newSetEquiv_forget {α : Λ}
(x : letI : Level := ⟨α⟩; @TSet _ α newModelData.toPreModelData) :
(newSetEquiv x)ᵁ = xᵁ :=
letI : Level := ⟨α⟩
castTSet_forget (D₁ := newModelData) (D₂ := globalModelData) _ x
def allPermEquiv {α : Λ} :
letI : Level := ⟨α⟩
NewPerm ≃ AllPerm α :=
letI : Level := ⟨α⟩
castAllPerm (D₁ := newModelData) (D₂ := globalModelData) rfl
(by rw [globalModelData, motive_eq, constructMotive, globalLtData_eq])
@[simp]
theorem allPermEquiv_forget {α : Λ} (ρ : letI : Level := ⟨α⟩; NewPerm) :
(allPermEquiv ρ)ᵁ = ρᵁ :=
letI : Level := ⟨α⟩
castAllPerm_forget (D₁ := newModelData) (D₂ := globalModelData) _ ρ
theorem allPermEquiv_sderiv {α β : Λ}
(ρ : letI : Level := ⟨α⟩; NewPerm) (hβ : (β : TypeIndex) < α) :
letI : Level := ⟨α⟩
letI : LtLevel β := ⟨hβ⟩
allPermEquiv ρ ↘ hβ = ρ.sderiv β := by
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
letI : LtLevel β := ⟨hβ⟩
apply allPermForget_injective
rw [allPermSderiv_forget, allPermEquiv_forget, NewPerm.forget_sderiv]
theorem TSet.exists_of_symmetric {α β : Λ} (s : Set (TSet β)) (hβ : (β : TypeIndex) < α)
(hs : Symmetric s hβ) :
∃ x : TSet α, ∀ y : TSet β, y ∈[hβ] x ↔ y ∈ s := by
letI : Level := ⟨α⟩
letI : LtLevel β := ⟨hβ⟩
suffices ∃ x : (@TSet _ α newModelData.toPreModelData), ∀ y : TSet β, yᵁ ∈[hβ] xᵁ ↔ y ∈ s by
obtain ⟨x, hx⟩ := this
use newSetEquiv x
intro y
rw [← hx, ← TSet.forget_mem_forget, newSetEquiv_forget]
obtain rfl | hs' := s.eq_empty_or_nonempty
· use none
intro y
simp only [Set.mem_empty_iff_false, iff_false]
exact not_mem_none y
· use some (Code.toSet ⟨β, s, hs'⟩ ?_)
· intro y
erw [mem_some_iff]
exact Code.mem_toSet _
· obtain ⟨S, hS⟩ := hs
use S
intro ρ hρS
have := hS (allPermEquiv ρ) ?_
· simp only [NewPerm.smul_mk, Code.mk.injEq, heq_eq_eq, true_and]
rwa [allPermEquiv_sderiv] at this
· rwa [allPermEquiv_forget]
theorem TSet.exists_support {α : Λ} (x : TSet α) :
∃ S : Support α, ∀ ρ : AllPerm α, ρᵁ • S = S → ρ • x = x := by
letI : Level := ⟨α⟩
obtain ⟨S, hS⟩ := NewSet.exists_support (newSetEquiv.symm x)
use S
intro ρ hρ
have := @Support.Supports.supports _ _ _ newPreModelData _ _ _ hS (allPermEquiv.symm ρ) ?_
· apply tSetForget_injective
have := congr_arg (·ᵁ) this
simp only at this
erw [@smul_forget _ _ newModelData (allPermEquiv.symm ρ) (newSetEquiv.symm x),
← allPermEquiv_forget, ← newSetEquiv_forget, Equiv.apply_symm_apply,
Equiv.apply_symm_apply] at this
rwa [smul_forget]
· rwa [← allPermEquiv_forget, Equiv.apply_symm_apply]
theorem TSet.symmetric {α β : Λ} (x : TSet α) (hβ : (β : TypeIndex) < α) :
Symmetric {y : TSet β | y ∈[hβ] x} hβ := by
obtain ⟨S, hS⟩ := exists_support x
use S
intro ρ hρ
conv_rhs => rw [← hS ρ hρ]
simp only [← forget_mem_forget, smul_forget, StrSet.mem_smul_iff]
ext y
rw [Set.mem_smul_set_iff_inv_smul_mem, Set.mem_setOf_eq, Set.mem_setOf_eq,
smul_forget, allPermForget_inv, allPermSderiv_forget']
theorem tSet_ext' {α β : Λ} (hβ : (β : TypeIndex) < α) (x y : TSet α)
(h : ∀ z : TSet β, z ∈[hβ] x ↔ z ∈[hβ] y) : x = y :=
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
letI : LtLevel β := ⟨hβ⟩
tSet_ext hβ x y h
@[simp]
theorem TSet.mem_smul_iff' {α β : TypeIndex}
{x : TSet β} {y : TSet α} (h : β < α) (ρ : AllPerm α) :
x ∈[h] ρ • y ↔ ρ⁻¹ ↘ h • x ∈[h] y := by
letI : Level := ⟨α.recBotCoe (Nonempty.some inferInstance) id⟩
letI : LeLevel α := ⟨α.recBotCoe (λ _ ↦ bot_le) (λ _ h ↦ WithBot.coe_le_coe.mpr h.le)
(show α.recBotCoe (Nonempty.some inferInstance) id = Level.α from rfl)⟩
letI : LtLevel β := ⟨h.trans_le LeLevel.elim⟩
exact mem_smul_iff h ρ -- For some reason, using `exact` instead of term mode speeds this up!
def singleton {α β : Λ} (hβ : (β : TypeIndex) < α) (x : TSet β) : TSet α :=
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
letI : LtLevel β := ⟨hβ⟩
PreCoherentData.singleton hβ x
@[simp]
theorem typedMem_singleton_iff' {α β : Λ} (hβ : (β : TypeIndex) < α) (x y : TSet β) :
y ∈[hβ] singleton hβ x ↔ y = x :=
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
letI : LtLevel β := ⟨hβ⟩
typedMem_singleton_iff hβ x y
@[simp]
theorem smul_singleton {α β : Λ} (hβ : (β : TypeIndex) < α) (x : TSet β) (ρ : AllPerm α) :
ρ • singleton hβ x = singleton hβ (ρ ↘ hβ • x) := by
apply tSet_ext' hβ
intro z
rw [TSet.mem_smul_iff', allPerm_inv_sderiv', typedMem_singleton_iff', typedMem_singleton_iff',
inv_smul_eq_iff]
theorem singleton_injective {α β : Λ} (hβ : (β : TypeIndex) < α) :
Function.Injective (singleton hβ) := by
intro x y hxy
have := typedMem_singleton_iff' hβ x y
rw [hxy, typedMem_singleton_iff'] at this
exact (this.mp rfl).symm
@[simp]
theorem singleton_inj {α β : Λ} {hβ : (β : TypeIndex) < α} {x y : TSet β} :
singleton hβ x = singleton hβ y ↔ x = y :=
(singleton_injective hβ).eq_iff
theorem sUnion_singleton_symmetric_aux' {α β γ : Λ}
(hγ : (γ : TypeIndex) < β) (hβ : (β : TypeIndex) < α) (s : Set (TSet γ)) (S : Support α)
(hS : ∀ ρ : AllPerm α, ρᵁ • S = S → ρ ↘ hβ • singleton hγ '' s = singleton hγ '' s) :
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
∀ (ρ : AllPerm β), ρᵁ • S.strong ↘ hβ = S.strong ↘ hβ → ρ ↘ hγ • s ⊆ s := by
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
letI : LtLevel β := ⟨hβ⟩
rintro ρ hρ _ ⟨x, hx, rfl⟩
obtain ⟨T, hT⟩ := exists_support x
obtain ⟨ρ', hρ'₁, hρ'₂⟩ := Support.exists_allowable_of_fixes S.strong S.strong_strong T ρ hγ hρ
have hρ's := hS ρ' (smul_eq_of_le (S.subsupport_strong.le) hρ'₁)
have hρ'x : ρ' ↘ hβ ↘ hγ • x = ρ ↘ hγ • x := by
apply hT.smul_eq_smul
simp only [allPermSderiv_forget', allPermSderiv_forget, WithBot.recBotCoe_coe, id_eq, hρ'₂]
dsimp only
rw [← hρ'x]
have := (Set.ext_iff.mp hρ's (ρ' ↘ hβ • singleton hγ x)).mp ⟨_, Set.mem_image_of_mem _ hx, rfl⟩
rw [smul_singleton] at this
rwa [(singleton_injective hγ).mem_set_image] at this
theorem sUnion_singleton_symmetric_aux {α β γ : Λ}
(hγ : (γ : TypeIndex) < β) (hβ : (β : TypeIndex) < α) (s : Set (TSet γ)) (S : Support α)
(hS : ∀ ρ : AllPerm α, ρᵁ • S = S → ρ ↘ hβ • singleton hγ '' s = singleton hγ '' s) :
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
∀ (ρ : AllPerm β), ρᵁ • S.strong ↘ hβ = S.strong ↘ hβ → ρ ↘ hγ • s = s := by
intro ρ hρ
apply subset_antisymm
· exact sUnion_singleton_symmetric_aux' hγ hβ s S hS ρ hρ
· have := sUnion_singleton_symmetric_aux' hγ hβ s S hS ρ⁻¹ ?_
· rwa [allPerm_inv_sderiv', Set.set_smul_subset_iff, inv_inv] at this
· rw [allPermForget_inv, inv_smul_eq_iff, hρ]
| theorem sUnion_singleton_symmetric {α β γ : Λ} (hγ : (γ : TypeIndex) < β) (hβ : (β : TypeIndex) < α)
(s : Set (TSet γ)) (hs : Symmetric (singleton hγ '' s) hβ) :
Symmetric s hγ | ConNF.sUnion_singleton_symmetric | {
"commit": "6fdc87c6b30b73931407a372f1430ecf0fef7601",
"date": "2024-12-03T00:00:00"
} | {
"commit": "2e25ffbc94af48261308cea0d8c55205cc388ef0",
"date": "2024-12-01T00:00:00"
} | ConNF/ConNF/Model/TTT.lean | ConNF.Model.TTT | ConNF.Model.TTT.jsonl | {
"lineInFile": 251,
"tokenPositionInFile": 9233,
"theoremPositionInFile": 22
} | {
"inFilePremises": true,
"numInFilePremises": 4,
"repositoryPremises": true,
"numRepositoryPremises": 27,
"numPremises": 49
} | {
"hasProof": true,
"proof": ":= by\n letI : Level := ⟨α⟩\n letI : LeLevel α := ⟨le_rfl⟩\n obtain ⟨S, hS⟩ := hs\n use S.strong ↘ hβ\n exact sUnion_singleton_symmetric_aux hγ hβ s S hS",
"proofType": "tactic",
"proofLengthLines": 5,
"proofLengthTokens": 153
} |
import ConNF.Model.TTT
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
namespace TSet
theorem exists_inter (x y : TSet α) :
∃ w : TSet α, ∀ z : TSet β, z ∈[hβ] w ↔ z ∈[hβ] x ∧ z ∈[hβ] y := by
refine exists_of_symmetric {z | z ∈[hβ] x ∧ z ∈[hβ] y} hβ ?_
obtain ⟨S, hS⟩ := symmetric x hβ
obtain ⟨T, hT⟩ := symmetric y hβ
use S + T
intro ρ hρ
specialize hS ρ (smul_eq_of_le Support.le_add_right hρ)
specialize hT ρ (smul_eq_of_le Support.le_add_left hρ)
simp [Set.ext_iff, Set.mem_smul_set_iff_inv_smul_mem] at hS hT ⊢
aesop
theorem exists_compl (x : TSet α) :
∃ y : TSet α, ∀ z : TSet β, z ∈[hβ] y ↔ ¬z ∈[hβ] x := by
refine exists_of_symmetric {z | ¬z ∈[hβ] x} hβ ?_
obtain ⟨S, hS⟩ := symmetric x hβ
use S
intro ρ hρ
specialize hS ρ hρ
simp [Set.ext_iff, Set.mem_smul_set_iff_inv_smul_mem] at hS ⊢
aesop
theorem exists_up (x y : TSet β) :
∃ w : TSet α, ∀ z : TSet β, z ∈[hβ] w ↔ z = x ∨ z = y := by
refine exists_of_symmetric {x, y} hβ ?_
obtain ⟨S, hS⟩ := exists_support x
obtain ⟨T, hT⟩ := exists_support y
use (S + T) ↗ hβ
intro ρ hρ
rw [Support.smul_scoderiv, Support.scoderiv_inj, ← allPermSderiv_forget'] at hρ
specialize hS (ρ ↘ hβ) (smul_eq_of_le Support.le_add_right hρ)
specialize hT (ρ ↘ hβ) (smul_eq_of_le Support.le_add_left hρ)
simp only [Set.smul_set_def, Set.image, Set.mem_insert_iff, Set.mem_singleton_iff,
exists_eq_or_imp, hS, exists_eq_left, hT]
ext z
rw [Set.mem_insert_iff, Set.mem_singleton_iff, Set.mem_setOf_eq]
aesop
/-- The unordered pair. -/
def up (x y : TSet β) : TSet α :=
(exists_up hβ x y).choose
@[simp]
theorem mem_up_iff (x y z : TSet β) :
z ∈[hβ] up hβ x y ↔ z = x ∨ z = y :=
(exists_up hβ x y).choose_spec z
/-- The Kuratowski ordered pair. -/
def op (x y : TSet γ) : TSet α :=
up hβ (singleton hγ x) (up hγ x y)
theorem up_injective {x y z w : TSet β} (h : up hβ x y = up hβ z w) :
(x = z ∧ y = w) ∨ (x = w ∧ y = z) := by
have h₁ := mem_up_iff hβ x y z
have h₂ := mem_up_iff hβ x y w
have h₃ := mem_up_iff hβ z w x
have h₄ := mem_up_iff hβ z w y
rw [h, mem_up_iff] at h₁ h₂
rw [← h, mem_up_iff] at h₃ h₄
aesop
@[simp]
theorem up_inj (x y z w : TSet β) :
up hβ x y = up hβ z w ↔ (x = z ∧ y = w) ∨ (x = w ∧ y = z) := by
constructor
· exact up_injective hβ
· rintro (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)
· rfl
· apply tSet_ext' hβ
aesop
@[simp]
theorem up_self {x : TSet β} :
up hβ x x = singleton hβ x := by
apply tSet_ext' hβ
aesop
@[simp]
theorem up_eq_singleton_iff (x y z : TSet β) :
up hβ x y = singleton hβ z ↔ x = z ∧ y = z := by
constructor
· intro h
have h₁ := typedMem_singleton_iff' hβ z x
have h₂ := typedMem_singleton_iff' hβ z y
rw [← h, mem_up_iff] at h₁ h₂
aesop
· rintro ⟨rfl, rfl⟩
rw [up_self]
@[simp]
theorem singleton_eq_up_iff (x y z : TSet β) :
singleton hβ z = up hβ x y ↔ x = z ∧ y = z := by
rw [← up_eq_singleton_iff hβ x y z, eq_comm]
theorem op_injective {x y z w : TSet γ} (h : op hβ hγ x y = op hβ hγ z w) :
x = z ∧ y = w := by
rw [op, op] at h
simp only [up_inj, singleton_inj, singleton_eq_up_iff, up_eq_singleton_iff] at h
obtain (⟨rfl, ⟨h, rfl⟩ | ⟨rfl, rfl⟩⟩ | ⟨⟨rfl, rfl⟩, ⟨h, rfl⟩⟩) := h <;> simp only [and_self]
@[simp]
theorem op_inj (x y z w : TSet γ) :
op hβ hγ x y = op hβ hγ z w ↔ x = z ∧ y = w := by
constructor
· exact op_injective hβ hγ
· rintro ⟨rfl, rfl⟩
rfl
@[simp]
theorem op_eq_singleton_iff (x y : TSet γ) (z : TSet β) :
op hβ hγ x y = singleton hβ z ↔ singleton hγ x = z ∧ singleton hγ y = z := by
rw [op, up_eq_singleton_iff, and_congr_right_iff]
rintro rfl
simp only [up_eq_singleton_iff, true_and, singleton_inj]
@[simp]
theorem smul_up (x y : TSet β) (ρ : AllPerm α) :
ρ • up hβ x y = up hβ (ρ ↘ hβ • x) (ρ ↘ hβ • y) := by
apply tSet_ext' hβ
aesop
@[simp]
theorem smul_op (x y : TSet γ) (ρ : AllPerm α) :
ρ • op hβ hγ x y = op hβ hγ (ρ ↘ hβ ↘ hγ • x) (ρ ↘ hβ ↘ hγ • y) := by
apply tSet_ext' hβ
simp only [op, smul_up, smul_singleton, mem_up_iff, implies_true]
theorem exists_singletonImage (x : TSet β) :
∃ y : TSet α, ∀ z w,
op hγ hδ (singleton hε z) (singleton hε w) ∈[hβ] y ↔ op hδ hε z w ∈[hγ] x := by
have := exists_of_symmetric {u | ∃ z w : TSet ε, op hδ hε z w ∈[hγ] x ∧
u = op hγ hδ (singleton hε z) (singleton hε w)} hβ ?_
· obtain ⟨y, hy⟩ := this
use y
intro z w
rw [hy]
simp only [Set.mem_setOf_eq, op_inj, singleton_inj, exists_eq_right_right', exists_eq_right']
· obtain ⟨S, hS⟩ := exists_support x
use S ↗ hβ
intro ρ hρ
rw [Support.smul_scoderiv, Support.scoderiv_inj, ← allPermSderiv_forget'] at hρ
specialize hS (ρ ↘ hβ) hρ
ext z
constructor
· rintro ⟨_, ⟨z, w, hab, rfl⟩, rfl⟩
refine ⟨ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε • z, ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε • w, ?_, ?_⟩
· rwa [← hS, mem_smul_iff', smul_op, allPerm_inv_sderiv', allPerm_inv_sderiv',
allPerm_inv_sderiv', inv_smul_smul, inv_smul_smul]
· simp only [smul_op, smul_singleton]
· rintro ⟨z, w, hab, rfl⟩
refine ⟨ρ⁻¹ ↘ hβ • op hγ hδ (singleton hε z) (singleton hε w), ?_, ?_⟩
· simp only [allPerm_inv_sderiv', smul_op, smul_singleton, Set.mem_setOf_eq, op_inj,
singleton_inj, exists_eq_right_right', exists_eq_right']
rw [smul_eq_iff_eq_inv_smul] at hS
rw [hS]
simp only [mem_smul_iff', inv_inv, smul_op, smul_inv_smul]
exact hab
· simp only [allPerm_inv_sderiv', smul_inv_smul]
theorem exists_insertion2 (x : TSet γ) :
∃ y : TSet α, ∀ a b c, op hγ hδ (singleton hε (singleton hζ a)) (op hε hζ b c) ∈[hβ] y ↔
op hε hζ a c ∈[hδ] x := by
have := exists_of_symmetric {u | ∃ a b c : TSet ζ, op hε hζ a c ∈[hδ] x ∧
u = op hγ hδ (singleton hε (singleton hζ a)) (op hε hζ b c)} hβ ?_
· obtain ⟨y, hy⟩ := this
use y
intro a b c
rw [hy]
constructor
· rintro ⟨a', b', c', h₁, h₂⟩
simp only [op_inj, singleton_inj] at h₂
obtain ⟨rfl, rfl, rfl⟩ := h₂
exact h₁
· intro h
exact ⟨a, b, c, h, rfl⟩
· obtain ⟨S, hS⟩ := exists_support x
use S ↗ hγ ↗ hβ
intro ρ hρ
simp only [Support.smul_scoderiv, Support.scoderiv_inj, ← allPermSderiv_forget'] at hρ
specialize hS (ρ ↘ hβ ↘ hγ) hρ
ext z
constructor
· rintro ⟨_, ⟨a, b, c, hx, rfl⟩, rfl⟩
refine ⟨ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • a, ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • b,
ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • c, ?_, ?_⟩
· rw [← hS]
simp only [mem_smul_iff', allPerm_inv_sderiv', smul_op, inv_smul_smul]
exact hx
· simp only [smul_op, smul_singleton]
· rintro ⟨a, b, c, hx, rfl⟩
rw [Set.mem_smul_set_iff_inv_smul_mem]
refine ⟨ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • a, ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • b,
ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • c, ?_, ?_⟩
· rw [smul_eq_iff_eq_inv_smul] at hS
rw [hS, mem_smul_iff']
simp only [inv_inv, allPerm_inv_sderiv', smul_op, smul_inv_smul]
exact hx
· simp only [smul_op, allPerm_inv_sderiv', smul_singleton]
theorem exists_insertion3 (x : TSet γ) :
∃ y : TSet α, ∀ a b c, op hγ hδ (singleton hε (singleton hζ a)) (op hε hζ b c) ∈[hβ] y ↔
op hε hζ a b ∈[hδ] x := by
have := exists_of_symmetric {u | ∃ a b c : TSet ζ, op hε hζ a b ∈[hδ] x ∧
u = op hγ hδ (singleton hε (singleton hζ a)) (op hε hζ b c)} hβ ?_
· obtain ⟨y, hy⟩ := this
use y
intro a b c
rw [hy]
constructor
· rintro ⟨a', b', c', h₁, h₂⟩
simp only [op_inj, singleton_inj] at h₂
obtain ⟨rfl, rfl, rfl⟩ := h₂
exact h₁
· intro h
exact ⟨a, b, c, h, rfl⟩
· obtain ⟨S, hS⟩ := exists_support x
use S ↗ hγ ↗ hβ
intro ρ hρ
simp only [Support.smul_scoderiv, Support.scoderiv_inj, ← allPermSderiv_forget'] at hρ
specialize hS (ρ ↘ hβ ↘ hγ) hρ
ext z
constructor
· rintro ⟨_, ⟨a, b, c, hx, rfl⟩, rfl⟩
refine ⟨ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • a, ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • b,
ρ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • c, ?_, ?_⟩
· rw [← hS]
simp only [mem_smul_iff', allPerm_inv_sderiv', smul_op, inv_smul_smul]
exact hx
· simp only [smul_op, smul_singleton]
· rintro ⟨a, b, c, hx, rfl⟩
rw [Set.mem_smul_set_iff_inv_smul_mem]
refine ⟨ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • a, ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • b,
ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ ↘ hε ↘ hζ • c, ?_, ?_⟩
· rw [smul_eq_iff_eq_inv_smul] at hS
rw [hS, mem_smul_iff']
simp only [inv_inv, allPerm_inv_sderiv', smul_op, smul_inv_smul]
exact hx
· simp only [smul_op, allPerm_inv_sderiv', smul_singleton]
theorem exists_cross (x : TSet γ) :
∃ y : TSet α, ∀ a, a ∈[hβ] y ↔ ∃ b c, a = op hγ hδ b c ∧ c ∈[hδ] x := by
have := exists_of_symmetric {a | ∃ b c, a = op hγ hδ b c ∧ c ∈[hδ] x} hβ ?_
· obtain ⟨y, hy⟩ := this
use y
intro a
rw [hy]
rfl
· obtain ⟨S, hS⟩ := exists_support x
use S ↗ hγ ↗ hβ
intro ρ hρ
simp only [Support.smul_scoderiv, Support.scoderiv_inj, ← allPermSderiv_forget'] at hρ
specialize hS (ρ ↘ hβ ↘ hγ) hρ
ext z
constructor
· rintro ⟨_, ⟨a, b, rfl, hab⟩, rfl⟩
refine ⟨ρ ↘ hβ ↘ hγ ↘ hδ • a, ρ ↘ hβ ↘ hγ ↘ hδ • b, ?_, ?_⟩
· simp only [smul_op]
· rw [← hS]
simp only [mem_smul_iff', allPerm_inv_sderiv', inv_smul_smul]
exact hab
· rintro ⟨a, b, rfl, hab⟩
rw [Set.mem_smul_set_iff_inv_smul_mem]
refine ⟨ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ • a, ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ • b, ?_, ?_⟩
· simp only [smul_op, allPerm_inv_sderiv']
· rw [smul_eq_iff_eq_inv_smul] at hS
rw [hS]
simp only [allPerm_inv_sderiv', mem_smul_iff', inv_inv, smul_inv_smul]
exact hab
theorem exists_typeLower (x : TSet α) :
∃ y : TSet δ, ∀ a, a ∈[hε] y ↔ ∀ b, op hγ hδ b (singleton hε a) ∈[hβ] x := by
have := exists_of_symmetric {a | ∀ b, op hγ hδ b (singleton hε a) ∈[hβ] x} hε ?_
· obtain ⟨y, hy⟩ := this
use y
intro a
rw [hy]
rfl
· apply sUnion_singleton_symmetric hε hδ
apply sUnion_singleton_symmetric hδ hγ
apply sUnion_singleton_symmetric hγ hβ
obtain ⟨S, hS⟩ := exists_support x
use S
intro ρ hρ
specialize hS ρ hρ
ext z
constructor
· rintro ⟨_, ⟨_, ⟨a, ⟨b, hb, rfl⟩, rfl⟩, rfl⟩, rfl⟩
simp only [smul_singleton, Set.mem_image, Set.mem_setOf_eq, exists_exists_and_eq_and,
singleton_inj, exists_eq_right]
intro c
have := hb (ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ • c)
rw [smul_eq_iff_eq_inv_smul] at hS
rw [hS] at this
simp only [allPerm_inv_sderiv', mem_smul_iff', inv_inv, smul_op, smul_inv_smul,
smul_singleton] at this
exact this
· rintro ⟨_, ⟨a, ⟨b, hb, rfl⟩, rfl⟩, rfl⟩
rw [Set.mem_smul_set_iff_inv_smul_mem]
simp only [smul_singleton, allPerm_inv_sderiv', Set.mem_image, Set.mem_setOf_eq,
exists_exists_and_eq_and, singleton_inj, exists_eq_right]
intro c
have := hb (ρ ↘ hβ ↘ hγ ↘ hδ • c)
rw [← hS] at this
simp only [mem_smul_iff', allPerm_inv_sderiv', smul_op, inv_smul_smul, smul_singleton] at this
exact this
theorem exists_converse (x : TSet α) :
∃ y : TSet α, ∀ a b, op hγ hδ a b ∈[hβ] y ↔ op hγ hδ b a ∈[hβ] x := by
have := exists_of_symmetric {a | ∃ b c, a = op hγ hδ b c ∧ op hγ hδ c b ∈[hβ] x} hβ ?_
· obtain ⟨y, hy⟩ := this
use y
intro a b
rw [hy]
simp only [Set.mem_setOf_eq, op_inj]
constructor
· rintro ⟨a', b', ⟨rfl, rfl⟩, h⟩
exact h
· intro h
exact ⟨a, b, ⟨rfl, rfl⟩, h⟩
· obtain ⟨S, hS⟩ := exists_support x
use S
intro ρ hρ
specialize hS ρ hρ
ext z
constructor
· rintro ⟨_, ⟨a, b, rfl, hab⟩, rfl⟩
refine ⟨ρ ↘ hβ ↘ hγ ↘ hδ • a, ρ ↘ hβ ↘ hγ ↘ hδ • b, ?_, ?_⟩
· simp only [smul_op]
· rw [← hS]
simp only [mem_smul_iff', allPerm_inv_sderiv', smul_op, inv_smul_smul]
exact hab
· rintro ⟨a, b, rfl, hab⟩
rw [Set.mem_smul_set_iff_inv_smul_mem]
refine ⟨ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ • a, ρ⁻¹ ↘ hβ ↘ hγ ↘ hδ • b, ?_, ?_⟩
· simp only [smul_op, allPerm_inv_sderiv']
· rw [smul_eq_iff_eq_inv_smul] at hS
rw [hS]
simp only [allPerm_inv_sderiv', mem_smul_iff', inv_inv, smul_op, smul_inv_smul]
exact hab
| theorem exists_cardinalOne :
∃ x : TSet α, ∀ a : TSet β, a ∈[hβ] x ↔ ∃ b, a = singleton hγ b | ConNF.TSet.exists_cardinalOne | {
"commit": "f804f5c71cfaa98223fc227dd822801e8bf77004",
"date": "2024-03-30T00:00:00"
} | {
"commit": "f7c233c7f7fd9d8b74595bbfa2bbbd49d538ef59",
"date": "2024-12-02T00:00:00"
} | ConNF/ConNF/Model/Hailperin.lean | ConNF.Model.Hailperin | ConNF.Model.Hailperin.jsonl | {
"lineInFile": 365,
"tokenPositionInFile": 12537,
"theoremPositionInFile": 22
} | {
"inFilePremises": false,
"numInFilePremises": 0,
"repositoryPremises": true,
"numRepositoryPremises": 31,
"numPremises": 83
} | {
"hasProof": true,
"proof": ":= by\n have := exists_of_symmetric {a | ∃ b, a = singleton hγ b} hβ ?_\n · obtain ⟨y, hy⟩ := this\n use y\n intro a\n rw [hy]\n rfl\n · use ⟨.empty, .empty⟩\n intro ρ hρ\n ext z\n constructor\n · rintro ⟨z, ⟨a, ha⟩, rfl⟩\n refine ⟨ρ ↘ hβ ↘ hγ • a, ?_⟩\n simp only [ha, smul_singleton]\n · rintro ⟨a, ha⟩\n rw [Set.mem_smul_set_iff_inv_smul_mem]\n refine ⟨ρ⁻¹ ↘ hβ ↘ hγ • a, ?_⟩\n simp only [ha, smul_singleton, allPerm_inv_sderiv']",
"proofType": "tactic",
"proofLengthLines": 17,
"proofLengthTokens": 470
} |
import ConNF.Model.Result
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
def union (x y : TSet α) : TSet α :=
(xᶜ' ⊓' yᶜ')ᶜ'
notation:68 x:68 " ⊔[" h "] " y:68 => _root_.ConNF.union h x y
notation:68 x:68 " ⊔' " y:68 => x ⊔[by assumption] y
@[simp]
theorem mem_union_iff (x y : TSet α) :
∀ z : TSet β, z ∈' x ⊔' y ↔ z ∈' x ∨ z ∈' y := by
rw [union]
intro z
rw [mem_compl_iff, mem_inter_iff, mem_compl_iff, mem_compl_iff, or_iff_not_and_not]
def higherIndex (α : Λ) : Λ :=
(exists_gt α).choose
| theorem lt_higherIndex {α : Λ} :
(α : TypeIndex) < higherIndex α | ConNF.lt_higherIndex | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | ConNF/ConNF/External/Basic.lean | ConNF.External.Basic | ConNF.External.Basic.jsonl | {
"lineInFile": 39,
"tokenPositionInFile": 817,
"theoremPositionInFile": 5
} | {
"inFilePremises": true,
"numInFilePremises": 1,
"repositoryPremises": true,
"numRepositoryPremises": 6,
"numPremises": 21
} | {
"hasProof": true,
"proof": ":=\n WithBot.coe_lt_coe.mpr (exists_gt α).choose_spec",
"proofType": "term",
"proofLengthLines": 1,
"proofLengthTokens": 53
} |
import ConNF.External.Basic
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
/-- A set in our model that is a well-order. Internal well-orders are exactly external well-orders,
so we externalise the definition for convenience. -/
def InternalWellOrder (r : TSet α) : Prop :=
IsWellOrder (ExternalRel hβ hγ hδ r).field
(InvImage (ExternalRel hβ hγ hδ r) Subtype.val)
def InternallyWellOrdered (x : TSet γ) : Prop :=
{y : TSet δ | y ∈' x}.Subsingleton ∨ (∃ r, InternalWellOrder hβ hγ hδ r ∧ x = field hβ hγ hδ r)
@[simp]
theorem externalRel_smul (r : TSet α) (ρ : AllPerm α) :
ExternalRel hβ hγ hδ (ρ • r) =
InvImage (ExternalRel hβ hγ hδ r) ((ρ ↘ hβ ↘ hγ ↘ hδ)⁻¹ • ·) := by
ext a b
simp only [ExternalRel, mem_smul_iff', allPerm_inv_sderiv', smul_op, InvImage]
omit [Params] in
/-- Well-orders are rigid. -/
theorem apply_eq_of_isWellOrder {X : Type _} {r : Rel X X} {f : X → X}
(hr : IsWellOrder X r) (hf : Function.Bijective f) (hf' : ∀ x y, r x y ↔ r (f x) (f y)) :
∀ x, f x = x := by
let emb : r ≼i r := ⟨⟨⟨f, hf.injective⟩, λ {a b} ↦ (hf' a b).symm⟩, ?_⟩
· have : emb = InitialSeg.refl r := Subsingleton.elim _ _
intro x
exact congr_arg (λ f ↦ f x) this
· intro a b h
exact hf.surjective _
omit [Params] in
theorem apply_eq_of_isWellOrder' {X : Type _} {r : Rel X X} {f : X → X}
(hr : IsWellOrder r.field (InvImage r Subtype.val)) (hf : Function.Bijective f)
(hf' : ∀ x y, r x y ↔ r (f x) (f y)) :
∀ x ∈ r.field, f x = x := by
have : ∀ x ∈ r.field, f x ∈ r.field := by
rintro x (⟨y, h⟩ | ⟨y, h⟩)
· exact Or.inl ⟨f y, (hf' x y).mp h⟩
· exact Or.inr ⟨f y, (hf' y x).mp h⟩
have := apply_eq_of_isWellOrder (f := λ x ↦ ⟨f x.val, this x.val x.prop⟩) hr ⟨?_, ?_⟩ ?_
· intro x hx
exact congr_arg Subtype.val (this ⟨x, hx⟩)
· intro x y h
rw [Subtype.mk.injEq] at h
exact Subtype.val_injective (hf.injective h)
· intro x
obtain ⟨y, hy⟩ := hf.surjective x.val
refine ⟨⟨y, ?_⟩, ?_⟩
· obtain (⟨z, h⟩ | ⟨z, h⟩) := x.prop <;>
rw [← hy] at h <;>
obtain ⟨z, rfl⟩ := hf.surjective z
· exact Or.inl ⟨z, (hf' y z).mpr h⟩
· exact Or.inr ⟨z, (hf' z y).mpr h⟩
· simp only [hy]
· intros
apply hf'
theorem exists_common_support_of_internallyWellOrdered' {x : TSet δ}
(h : InternallyWellOrdered hγ hδ hε x) :
∃ S : Support β, ∀ y, y ∈' x → S.Supports { { {y}' }' }[hγ] := by
obtain (h | ⟨r, h, rfl⟩) := h
· obtain (h | ⟨y, hy⟩) := h.eq_empty_or_singleton
· use ⟨Enumeration.empty, Enumeration.empty⟩
intro y hy
rw [Set.eq_empty_iff_forall_not_mem] at h
cases h y hy
· obtain ⟨S, hS⟩ := TSet.exists_support y
use S ↗ hε ↗ hδ ↗ hγ
intro z hz
rw [Set.eq_singleton_iff_unique_mem] at hy
cases hy.2 z hz
refine ⟨?_, λ h ↦ by cases h⟩
intro ρ hρ
simp only [Support.smul_scoderiv, ← allPermSderiv_forget', Support.scoderiv_inj] at hρ
simp only [smul_singleton, singleton_inj]
exact hS _ hρ
obtain ⟨S, hS⟩ := TSet.exists_support r
use S
intro a ha
refine ⟨?_, λ h ↦ by cases h⟩
intro ρ hρ
have := hS ρ hρ
simp only [smul_singleton, singleton_inj]
apply apply_eq_of_isWellOrder' (r := ExternalRel hγ hδ hε r)
· exact h
· exact MulAction.bijective (ρ ↘ hγ ↘ hδ ↘ hε)
· intro x y
conv_rhs => rw [← this]
simp only [externalRel_smul, InvImage, inv_smul_smul]
· rwa [mem_field_iff] at ha
include hγ in
theorem Support.Supports.ofSingleton {S : Support α} {x : TSet β}
(h : S.Supports {x}') :
letI : Level := ⟨α⟩
letI : LeLevel α := ⟨le_rfl⟩
(S.strong ↘ hβ).Supports x := by
refine ⟨?_, λ h ↦ by cases h⟩
intro ρ hρ
open scoped Pointwise in
have := sUnion_singleton_symmetric_aux hγ hβ {y | y ∈' x} S ?_ ρ hρ
· apply ConNF.ext hγ
intro z
simp only [Set.ext_iff, Set.mem_setOf_eq, Set.mem_smul_set_iff_inv_smul_mem] at this
rw [mem_smul_iff', allPerm_inv_sderiv', this]
· intro ρ hρ
ext z
simp only [Set.mem_smul_set_iff_inv_smul_mem, Set.mem_image, Set.mem_setOf_eq]
have := h.supports ρ hρ
simp only [smul_singleton, singleton_inj] at this
constructor
· rintro ⟨y, h₁, h₂⟩
rw [← smul_eq_iff_eq_inv_smul, smul_singleton] at h₂
refine ⟨_, ?_, h₂⟩
rw [← this]
simp only [mem_smul_iff', allPerm_inv_sderiv', inv_smul_smul]
exact h₁
· rintro ⟨y, h, rfl⟩
refine ⟨(ρ ↘ hβ ↘ hγ)⁻¹ • y, ?_, ?_⟩
· rwa [← allPerm_inv_sderiv', ← mem_smul_iff', this]
· simp only [smul_singleton, allPerm_inv_sderiv']
include hγ in
theorem supports_of_supports_singletons {S : Support α} {s : Set (TSet β)}
(h : ∀ x ∈ s, S.Supports {x}') :
∃ S : Support β, ∀ x ∈ s, S.Supports x :=
⟨_, λ x hx ↦ (h x hx).ofSingleton hβ hγ⟩
theorem exists_common_support_of_internallyWellOrdered {x : TSet δ}
(h : InternallyWellOrdered hγ hδ hε x) :
∃ S : Support δ, ∀ y, y ∈' x → S.Supports {y}' := by
obtain ⟨S, hS⟩ := exists_common_support_of_internallyWellOrdered' hγ hδ hε h
have := supports_of_supports_singletons (S := S)
(s := singleton hδ '' (singleton hε '' {y | y ∈' x})) hγ hδ ?_
swap
· simp only [Set.mem_image, Set.mem_setOf_eq, exists_exists_and_eq_and, forall_exists_index,
and_imp, forall_apply_eq_imp_iff₂]
exact hS
obtain ⟨T, hT⟩ := this
have := supports_of_supports_singletons (S := T)
(s := singleton hε '' {y | y ∈' x}) hδ hε ?_
swap
· simp only [Set.mem_image, Set.mem_setOf_eq, forall_exists_index, and_imp,
forall_apply_eq_imp_iff₂] at hT ⊢
exact hT
simp only [Set.mem_image, Set.mem_setOf_eq, forall_exists_index, and_imp,
forall_apply_eq_imp_iff₂] at this
exact this
theorem internallyWellOrdered_of_common_support_of_nontrivial {x : TSet γ}
(hx : {y : TSet δ | y ∈' x}.Nontrivial)
(S : Support δ) (hS : ∀ y : TSet δ, y ∈' x → S.Supports y) :
InternallyWellOrdered hβ hγ hδ x := by
have := exists_of_symmetric
{p : TSet β | ∃ a b : TSet δ, p = ⟨a, b⟩' ∧ a ∈' x ∧ b ∈' x ∧ WellOrderingRel a b} hβ ?_
swap
· use S ↗ hδ ↗ hγ ↗ hβ
intro ρ hρ
ext z
simp only [Support.smul_scoderiv, ← allPermSderiv_forget', Support.scoderiv_inj] at hρ
simp only [Set.mem_smul_set_iff_inv_smul_mem, Set.mem_setOf_eq]
constructor
· rintro ⟨a, b, h₁, h₂, h₃, h₄⟩
refine ⟨a, b, ?_, h₂, h₃, h₄⟩
rw [inv_smul_eq_iff] at h₁
rw [h₁, smul_op, op_inj]
exact ⟨(hS a h₂).supports _ hρ, (hS b h₃).supports _ hρ⟩
· rintro ⟨a, b, h₁, h₂, h₃, h₄⟩
refine ⟨a, b, ?_, h₂, h₃, h₄⟩
rw [h₁, smul_op, op_inj]
simp only [allPerm_inv_sderiv', inv_smul_eq_iff]
rw [(hS a h₂).supports _ hρ, (hS b h₃).supports _ hρ]
exact ⟨rfl, rfl⟩
obtain ⟨r, hr⟩ := this
right
use r
have hr' : ∀ a b, ExternalRel hβ hγ hδ r a b ↔ a ∈' x ∧ b ∈' x ∧ WellOrderingRel a b := by
intro a b
rw [ExternalRel, hr]
simp only [Set.mem_setOf_eq, op_inj]
constructor
· rintro ⟨a, b, ⟨rfl, rfl⟩, h⟩
exact h
· intro h
exact ⟨a, b, ⟨rfl, rfl⟩, h⟩
have hrx : ∀ a, a ∈ (ExternalRel hβ hγ hδ r).field ↔ a ∈' x := by
intro a
constructor
· rintro (⟨b, h⟩ | ⟨b, h⟩)
· rw [hr'] at h
exact h.1
· rw [hr'] at h
exact h.2.1
· intro h
obtain ⟨b, h₁, h₂⟩ := hx.exists_ne a
obtain (h₃ | h₃ | h₃) := WellOrderingRel.isWellOrder.trichotomous a b
· refine Or.inl ⟨b, ?_⟩
rw [hr']
exact ⟨h, h₁, h₃⟩
· cases h₂ h₃.symm
· refine Or.inr ⟨b, ?_⟩
rw [hr']
exact ⟨h₁, h, h₃⟩
refine ⟨?_, ?_⟩
swap
· apply ext hδ
intro z
rw [mem_field_iff, hrx]
refine @IsWellOrder.mk _ _ ?_ ?_ ?_
· constructor
intro a b
obtain (h | h | h) := WellOrderingRel.isWellOrder.trichotomous a.val b.val
· apply Or.inl
rw [InvImage, hr']
exact ⟨(hrx a).mp a.prop, (hrx b).mp b.prop, h⟩
· exact Or.inr (Or.inl (Subtype.val_injective h))
· apply Or.inr ∘ Or.inr
rw [InvImage, hr']
exact ⟨(hrx b).mp b.prop, (hrx a).mp a.prop, h⟩
· constructor
intro a b c h₁ h₂
rw [InvImage, hr'] at h₁ h₂ ⊢
exact ⟨h₁.1, h₂.2.1, WellOrderingRel.isWellOrder.trans _ _ _ h₁.2.2 h₂.2.2⟩
· constructor
apply InvImage.wf
refine Subrelation.wf ?_ WellOrderingRel.isWellOrder.wf
intro a b h
rw [hr'] at h
exact h.2.2
| theorem internallyWellOrdered_of_common_support {x : TSet γ}
(S : Support δ) (hS : ∀ y : TSet δ, y ∈' x → S.Supports y) :
InternallyWellOrdered hβ hγ hδ x | ConNF.internallyWellOrdered_of_common_support | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | {
"commit": "1c08486feb882444888c228ce1501e92bb85e0e2",
"date": "2025-01-07T00:00:00"
} | ConNF/ConNF/External/WellOrder.lean | ConNF.External.WellOrder | ConNF.External.WellOrder.jsonl | {
"lineInFile": 251,
"tokenPositionInFile": 8640,
"theoremPositionInFile": 10
} | {
"inFilePremises": true,
"numInFilePremises": 3,
"repositoryPremises": true,
"numRepositoryPremises": 16,
"numPremises": 36
} | {
"hasProof": true,
"proof": ":= by\n obtain (hx | hx) := Set.subsingleton_or_nontrivial {y : TSet δ | y ∈' x}\n · exact Or.inl hx\n · exact internallyWellOrdered_of_common_support_of_nontrivial hβ hγ hδ hx S hS",
"proofType": "tactic",
"proofLengthLines": 3,
"proofLengthTokens": 181
} |
import ConNF.Model.Result
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
def union (x y : TSet α) : TSet α :=
(xᶜ' ⊓' yᶜ')ᶜ'
notation:68 x:68 " ⊔[" h "] " y:68 => _root_.ConNF.union h x y
notation:68 x:68 " ⊔' " y:68 => x ⊔[by assumption] y
@[simp]
theorem mem_union_iff (x y : TSet α) :
∀ z : TSet β, z ∈' x ⊔' y ↔ z ∈' x ∨ z ∈' y := by
rw [union]
intro z
rw [mem_compl_iff, mem_inter_iff, mem_compl_iff, mem_compl_iff, or_iff_not_and_not]
def higherIndex (α : Λ) : Λ :=
(exists_gt α).choose
theorem lt_higherIndex {α : Λ} :
(α : TypeIndex) < higherIndex α :=
WithBot.coe_lt_coe.mpr (exists_gt α).choose_spec
theorem tSet_nonempty (h : ∃ β : Λ, (β : TypeIndex) < α) : Nonempty (TSet α) := by
obtain ⟨α', hα⟩ := h
constructor
apply typeLower lt_higherIndex lt_higherIndex lt_higherIndex hα
apply cardinalOne lt_higherIndex lt_higherIndex
def empty : TSet α :=
(tSet_nonempty ⟨β, hβ⟩).some ⊓' (tSet_nonempty ⟨β, hβ⟩).someᶜ'
@[simp]
theorem mem_empty_iff :
∀ x : TSet β, ¬x ∈' empty hβ := by
intro x
rw [empty, mem_inter_iff, mem_compl_iff]
exact and_not_self
def univ : TSet α :=
(empty hβ)ᶜ'
@[simp]
theorem mem_univ_iff :
∀ x : TSet β, x ∈' univ hβ := by
intro x
simp only [univ, mem_compl_iff, mem_empty_iff, not_false_eq_true]
/-- The set of all ordered pairs. -/
def orderedPairs : TSet α :=
vCross hβ hγ hδ (univ hδ)
@[simp]
theorem mem_orderedPairs_iff (x : TSet β) :
x ∈' orderedPairs hβ hγ hδ ↔ ∃ a b, x = ⟨a, b⟩' := by
simp only [orderedPairs, vCross_spec, mem_univ_iff, and_true]
def converse (x : TSet α) : TSet α :=
converse' hβ hγ hδ x ⊓' orderedPairs hβ hγ hδ
@[simp]
theorem op_mem_converse_iff (x : TSet α) :
∀ a b, ⟨a, b⟩' ∈' converse hβ hγ hδ x ↔ ⟨b, a⟩' ∈' x := by
intro a b
simp only [converse, mem_inter_iff, converse'_spec, mem_orderedPairs_iff, op_inj, exists_and_left,
exists_eq', and_true]
def cross (x y : TSet γ) : TSet α :=
converse hβ hγ hδ (vCross hβ hγ hδ x) ⊓' vCross hβ hγ hδ y
@[simp]
theorem mem_cross_iff (x y : TSet γ) :
∀ a, a ∈' cross hβ hγ hδ x y ↔ ∃ b c, a = ⟨b, c⟩' ∧ b ∈' x ∧ c ∈' y := by
intro a
rw [cross, mem_inter_iff, vCross_spec]
constructor
· rintro ⟨h₁, b, c, rfl, h₂⟩
simp only [op_mem_converse_iff, vCross_spec, op_inj] at h₁
obtain ⟨b', c', ⟨rfl, rfl⟩, h₁⟩ := h₁
exact ⟨b, c, rfl, h₁, h₂⟩
· rintro ⟨b, c, rfl, h₁, h₂⟩
simp only [op_mem_converse_iff, vCross_spec, op_inj]
exact ⟨⟨c, b, ⟨rfl, rfl⟩, h₁⟩, ⟨b, c, ⟨rfl, rfl⟩, h₂⟩⟩
def singletonImage (x : TSet β) : TSet α :=
singletonImage' hβ hγ hδ hε x ⊓' (cross hβ hγ hδ (cardinalOne hδ hε) (cardinalOne hδ hε))
@[simp]
theorem singletonImage_spec (x : TSet β) :
∀ z w,
⟨ {z}', {w}' ⟩' ∈' singletonImage hβ hγ hδ hε x ↔ ⟨z, w⟩' ∈' x := by
intro z w
rw [singletonImage, mem_inter_iff, singletonImage'_spec, and_iff_left_iff_imp]
intro hzw
rw [mem_cross_iff]
refine ⟨{z}', {w}', rfl, ?_⟩
simp only [mem_cardinalOne_iff, singleton_inj, exists_eq', and_self]
theorem exists_of_mem_singletonImage {x : TSet β} {z w : TSet δ}
(h : ⟨z, w⟩' ∈' singletonImage hβ hγ hδ hε x) :
∃ a b, z = {a}' ∧ w = {b}' := by
simp only [singletonImage, mem_inter_iff, mem_cross_iff, op_inj, mem_cardinalOne_iff] at h
obtain ⟨-, _, _, ⟨rfl, rfl⟩, ⟨a, rfl⟩, ⟨b, rfl⟩⟩ := h
exact ⟨a, b, rfl, rfl⟩
/-- Turn a model element encoding a relation into an actual relation. -/
def ExternalRel (r : TSet α) : Rel (TSet δ) (TSet δ) :=
λ x y ↦ ⟨x, y⟩' ∈' r
@[simp]
theorem externalRel_converse (r : TSet α) :
ExternalRel hβ hγ hδ (converse hβ hγ hδ r) = (ExternalRel hβ hγ hδ r).inv := by
ext
simp only [ExternalRel, op_mem_converse_iff, Rel.inv_apply]
/-- The codomain of a relation. -/
def codom (r : TSet α) : TSet γ :=
(typeLower lt_higherIndex hβ hγ hδ (singletonImage lt_higherIndex hβ hγ hδ r)ᶜ[lt_higherIndex])ᶜ'
@[simp]
theorem mem_codom_iff (r : TSet α) (x : TSet δ) :
x ∈' codom hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).codom := by
simp only [codom, mem_compl_iff, mem_typeLower_iff, not_forall, not_not]
constructor
· rintro ⟨y, hy⟩
obtain ⟨a, b, rfl, hb⟩ := exists_of_mem_singletonImage lt_higherIndex hβ hγ hδ hy
rw [singleton_inj] at hb
subst hb
rw [singletonImage_spec] at hy
exact ⟨a, hy⟩
· rintro ⟨a, ha⟩
use {a}'
rw [singletonImage_spec]
exact ha
/-- The domain of a relation. -/
def dom (r : TSet α) : TSet γ :=
codom hβ hγ hδ (converse hβ hγ hδ r)
@[simp]
theorem mem_dom_iff (r : TSet α) (x : TSet δ) :
x ∈' dom hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).dom := by
rw [dom, mem_codom_iff, externalRel_converse, Rel.inv_codom]
/-- The field of a relation. -/
def field (r : TSet α) : TSet γ :=
dom hβ hγ hδ r ⊔' codom hβ hγ hδ r
@[simp]
theorem mem_field_iff (r : TSet α) (x : TSet δ) :
x ∈' field hβ hγ hδ r ↔ x ∈ (ExternalRel hβ hγ hδ r).field := by
rw [field, mem_union_iff, mem_dom_iff, mem_codom_iff, Rel.field, Set.mem_union]
def subset : TSet α :=
subset' hβ hγ hδ hε ⊓' orderedPairs hβ hγ hδ
@[simp]
theorem subset_spec :
∀ a b, ⟨a, b⟩' ∈' subset hβ hγ hδ hε ↔ a ⊆[TSet ε] b := by
intro a b
simp only [subset, mem_inter_iff, subset'_spec, mem_orderedPairs_iff, op_inj, exists_and_left,
exists_eq', and_true]
def membership : TSet α :=
subset hβ hγ hδ hε ⊓' cross hβ hγ hδ (cardinalOne hδ hε) (univ hδ)
@[simp]
theorem membership_spec :
∀ a b, ⟨{a}', b⟩' ∈' membership hβ hγ hδ hε ↔ a ∈' b := by
intro a b
rw [membership, mem_inter_iff, subset_spec]
simp only [mem_cross_iff, op_inj, mem_cardinalOne_iff, mem_univ_iff, and_true, exists_and_right,
exists_and_left, exists_eq', exists_eq_left', singleton_inj]
constructor
· intro h
exact h a ((typedMem_singleton_iff' hε a a).mpr rfl)
· intro h c hc
simp only [typedMem_singleton_iff'] at hc
cases hc
exact h
def powerset (x : TSet β) : TSet α :=
dom lt_higherIndex lt_higherIndex hβ
(subset lt_higherIndex lt_higherIndex hβ hγ ⊓[lt_higherIndex]
vCross lt_higherIndex lt_higherIndex hβ {x}')
@[simp]
theorem mem_powerset_iff (x y : TSet β) :
x ∈' powerset hβ hγ y ↔ x ⊆[TSet γ] y := by
rw [powerset, mem_dom_iff]
constructor
· rintro ⟨z, h⟩
simp only [ExternalRel, mem_inter_iff, subset_spec, vCross_spec, op_inj,
typedMem_singleton_iff', exists_eq_right, exists_and_right, exists_eq', true_and] at h
cases h.2
exact h.1
· intro h
refine ⟨y, ?_⟩
simp only [ExternalRel, mem_inter_iff, subset_spec, h, vCross_spec, op_inj,
typedMem_singleton_iff', exists_eq_right, and_true, exists_eq', and_self]
/-- The set `ι²''x = {{{a}} | a ∈ x}`. -/
def doubleSingleton (x : TSet γ) : TSet α :=
cross hβ hγ hδ x x ⊓' cardinalOne hβ hγ
@[simp]
theorem mem_doubleSingleton_iff (x : TSet γ) :
∀ y : TSet β, y ∈' doubleSingleton hβ hγ hδ x ↔
∃ z : TSet δ, z ∈' x ∧ y = { {z}' }' := by
intro y
rw [doubleSingleton, mem_inter_iff, mem_cross_iff, mem_cardinalOne_iff]
constructor
· rintro ⟨⟨b, c, h₁, h₂, h₃⟩, ⟨a, rfl⟩⟩
obtain ⟨hbc, rfl⟩ := (op_eq_singleton_iff _ _ _ _ _).mp h₁.symm
exact ⟨c, h₃, rfl⟩
· rintro ⟨z, h, rfl⟩
constructor
· refine ⟨z, z, ?_⟩
rw [eq_comm, op_eq_singleton_iff]
tauto
· exact ⟨_, rfl⟩
/-- The union of a set of *singletons*: `ι⁻¹''x = {a | {a} ∈ x}`. -/
def singletonUnion (x : TSet α) : TSet β :=
typeLower lt_higherIndex lt_higherIndex hβ hγ
(vCross lt_higherIndex lt_higherIndex hβ x)
@[simp]
theorem mem_singletonUnion_iff (x : TSet α) :
∀ y : TSet γ, y ∈' singletonUnion hβ hγ x ↔ {y}' ∈' x := by
intro y
simp only [singletonUnion, mem_typeLower_iff, vCross_spec, op_inj]
constructor
· intro h
obtain ⟨a, b, ⟨rfl, rfl⟩, hy⟩ := h {y}'
exact hy
· intro h b
exact ⟨b, _, ⟨rfl, rfl⟩, h⟩
/--
The union of a set of sets.
```
singletonUnion dom {⟨{a}, b⟩ | a ∈ b} ∩ (1 × x) =
singletonUnion dom {⟨{a}, b⟩ | a ∈ b ∧ b ∈ x} =
singletonUnion {{a} | a ∈ b ∧ b ∈ x} =
{a | a ∈ b ∧ b ∈ x} =
⋃ x
```
-/
def sUnion (x : TSet α) : TSet β :=
singletonUnion hβ hγ
(dom lt_higherIndex lt_higherIndex hβ
(membership lt_higherIndex lt_higherIndex hβ hγ ⊓[lt_higherIndex]
cross lt_higherIndex lt_higherIndex hβ (cardinalOne hβ hγ) x))
@[simp]
theorem mem_sUnion_iff (x : TSet α) :
∀ y : TSet γ, y ∈' sUnion hβ hγ x ↔ ∃ t : TSet β, t ∈' x ∧ y ∈' t := by
intro y
simp only [sUnion, mem_singletonUnion_iff, mem_dom_iff, Rel.dom, ExternalRel, mem_inter_iff,
mem_cross_iff, op_inj, mem_cardinalOne_iff, Set.mem_setOf_eq, membership_spec]
constructor
· rintro ⟨z, h₁, a, b, ⟨rfl, rfl⟩, ⟨c, h₂⟩, h₃⟩
rw [singleton_inj] at h₂
cases h₂
exact ⟨z, h₃, h₁⟩
· rintro ⟨z, h₂, h₃⟩
exact ⟨z, h₃, _, _, ⟨rfl, rfl⟩, ⟨y, rfl⟩, h₂⟩
theorem exists_smallUnion (s : Set (TSet α)) (hs : Small s) :
∃ x : TSet α, ∀ y : TSet β, y ∈' x ↔ ∃ t ∈ s, y ∈' t := by
apply exists_of_symmetric
have := exists_support (α := α)
choose S hS using this
refine ⟨⟨Enumeration.ofSet (⋃ t ∈ s, (S t)ᴬ) ?_, Enumeration.ofSet (⋃ t ∈ s, (S t)ᴺ) ?_⟩, ?_⟩
· apply small_biUnion hs
intros
exact (S _)ᴬ.coe_small
· apply small_biUnion hs
intros
exact (S _)ᴺ.coe_small
intro ρ hρ
suffices ∀ t ∈ s, ρ • t = t by
ext y
rw [Set.mem_smul_set_iff_inv_smul_mem]
constructor
· rintro ⟨t, h₁, h₂⟩
refine ⟨t, h₁, ?_⟩
rw [← this t h₁]
rwa [mem_smul_iff', allPerm_inv_sderiv']
· rintro ⟨t, h₁, h₂⟩
refine ⟨t, h₁, ?_⟩
have := this t h₁
rw [smul_eq_iff_eq_inv_smul] at this
rwa [this, mem_smul_iff', inv_inv, smul_inv_smul]
intro t ht
apply (hS t).supports ρ
refine smul_eq_of_le ?_ hρ
intro A
constructor
· intro a ha
rw [← Support.derivBot_atoms, Support.mk_atoms, ← Enumeration.mem_path_iff,
Enumeration.mem_ofSet_iff, Set.mem_iUnion]
use t
rw [Set.mem_iUnion]
use ht
exact ha
· intro a ha
rw [← Support.derivBot_nearLitters, Support.mk_nearLitters, ← Enumeration.mem_path_iff,
Enumeration.mem_ofSet_iff, Set.mem_iUnion]
use t
rw [Set.mem_iUnion]
use ht
exact ha
/-- Our model is `κ`-complete; small unions exist.
In particular, the model knows the correct natural numbers. -/
def smallUnion (s : Set (TSet α)) (hs : Small s) : TSet α :=
(exists_smallUnion hβ s hs).choose
| @[simp]
theorem mem_smallUnion_iff (s : Set (TSet α)) (hs : Small s) :
∀ x : TSet β, x ∈' smallUnion hβ s hs ↔ ∃ t ∈ s, x ∈' t | ConNF.mem_smallUnion_iff | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | {
"commit": "6dd8406a01cc28b071bb26965294469664a1b592",
"date": "2025-01-07T00:00:00"
} | ConNF/ConNF/External/Basic.lean | ConNF.External.Basic | ConNF.External.Basic.jsonl | {
"lineInFile": 341,
"tokenPositionInFile": 10620,
"theoremPositionInFile": 42
} | {
"inFilePremises": true,
"numInFilePremises": 2,
"repositoryPremises": true,
"numRepositoryPremises": 12,
"numPremises": 29
} | {
"hasProof": true,
"proof": ":=\n (exists_smallUnion hβ s hs).choose_spec",
"proofType": "term",
"proofLengthLines": 1,
"proofLengthTokens": 44
} |
import ConNF.External.Basic
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal ConNF.TSet
namespace ConNF
variable [Params.{u}] {α β γ δ ε ζ : Λ} (hβ : (β : TypeIndex) < α) (hγ : (γ : TypeIndex) < β)
(hδ : (δ : TypeIndex) < γ) (hε : (ε : TypeIndex) < δ) (hζ : (ζ : TypeIndex) < ε)
/-- A set in our model that is a well-order. Internal well-orders are exactly external well-orders,
so we externalise the definition for convenience. -/
def InternalWellOrder (r : TSet α) : Prop :=
IsWellOrder (ExternalRel hβ hγ hδ r).field
(InvImage (ExternalRel hβ hγ hδ r) Subtype.val)
def InternallyWellOrdered (x : TSet γ) : Prop :=
{y : TSet δ | y ∈' x}.Subsingleton ∨ (∃ r, InternalWellOrder hβ hγ hδ r ∧ x = field hβ hγ hδ r)
@[simp]
theorem externalRel_smul (r : TSet α) (ρ : AllPerm α) :
ExternalRel hβ hγ hδ (ρ • r) =
InvImage (ExternalRel hβ hγ hδ r) ((ρ ↘ hβ ↘ hγ ↘ hδ)⁻¹ • ·) := by
ext a b
simp only [ExternalRel, mem_smul_iff', allPerm_inv_sderiv', smul_op, InvImage]
omit [Params] in
/-- Well-orders are rigid. -/
theorem apply_eq_of_isWellOrder {X : Type _} {r : Rel X X} {f : X → X}
(hr : IsWellOrder X r) (hf : Function.Bijective f) (hf' : ∀ x y, r x y ↔ r (f x) (f y)) :
∀ x, f x = x := by
let emb : r ≼i r := ⟨⟨⟨f, hf.injective⟩, λ {a b} ↦ (hf' a b).symm⟩, ?_⟩
· have : emb = InitialSeg.refl r := Subsingleton.elim _ _
intro x
exact congr_arg (λ f ↦ f x) this
· intro a b h
exact hf.surjective _
omit [Params] in
| theorem apply_eq_of_isWellOrder' {X : Type _} {r : Rel X X} {f : X → X}
(hr : IsWellOrder r.field (InvImage r Subtype.val)) (hf : Function.Bijective f)
(hf' : ∀ x y, r x y ↔ r (f x) (f y)) :
∀ x ∈ r.field, f x = x | ConNF.apply_eq_of_isWellOrder' | {
"commit": "66f4e3291020d4198ca6ede816acae5cee584a07",
"date": "2025-01-06T00:00:00"
} | {
"commit": "1c08486feb882444888c228ce1501e92bb85e0e2",
"date": "2025-01-07T00:00:00"
} | ConNF/ConNF/External/WellOrder.lean | ConNF.External.WellOrder | ConNF.External.WellOrder.jsonl | {
"lineInFile": 52,
"tokenPositionInFile": 1567,
"theoremPositionInFile": 4
} | {
"inFilePremises": true,
"numInFilePremises": 1,
"repositoryPremises": true,
"numRepositoryPremises": 2,
"numPremises": 45
} | {
"hasProof": true,
"proof": ":= by\n have : ∀ x ∈ r.field, f x ∈ r.field := by\n rintro x (⟨y, h⟩ | ⟨y, h⟩)\n · exact Or.inl ⟨f y, (hf' x y).mp h⟩\n · exact Or.inr ⟨f y, (hf' y x).mp h⟩\n have := apply_eq_of_isWellOrder (f := λ x ↦ ⟨f x.val, this x.val x.prop⟩) hr ⟨?_, ?_⟩ ?_\n · intro x hx\n exact congr_arg Subtype.val (this ⟨x, hx⟩)\n · intro x y h\n rw [Subtype.mk.injEq] at h\n exact Subtype.val_injective (hf.injective h)\n · intro x\n obtain ⟨y, hy⟩ := hf.surjective x.val\n refine ⟨⟨y, ?_⟩, ?_⟩\n · obtain (⟨z, h⟩ | ⟨z, h⟩) := x.prop <;>\n rw [← hy] at h <;>\n obtain ⟨z, rfl⟩ := hf.surjective z\n · exact Or.inl ⟨z, (hf' y z).mpr h⟩\n · exact Or.inr ⟨z, (hf' z y).mpr h⟩\n · simp only [hy]\n · intros\n apply hf'",
"proofType": "tactic",
"proofLengthLines": 21,
"proofLengthTokens": 739
} |
import ConNF.Model.Externalise
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal
namespace ConNF
variable [Params.{u}] {β γ : Λ} {hγ : (γ : TypeIndex) < β}
namespace Support
theorem not_mem_scoderiv_botDeriv (S : Support γ) (N : NearLitter) :
N ∉ (S ↗ hγ ⇘. (Path.nil ↘.))ᴺ := by
rintro ⟨i, ⟨A, N'⟩, h₁, h₂⟩
simp only [Prod.mk.injEq] at h₂
cases A
case sderiv δ A hδ _ =>
simp only [Path.deriv_sderiv] at h₂
cases A
case nil => cases h₂.1
case sderiv ζ A hζ _ =>
simp only [Path.deriv_sderiv] at h₂
cases h₂.1
variable [Level] [LtLevel β]
theorem not_mem_strong_botDeriv (S : Support γ) (N : NearLitter) :
N ∉ ((S ↗ hγ).strong ⇘. (Path.nil ↘.))ᴺ := by
rintro h
rw [strong, close_nearLitters, preStrong_nearLitters, Enumeration.mem_add_iff] at h
obtain h | h := h
· exact not_mem_scoderiv_botDeriv S N h
· rw [mem_constrainsNearLitters_nearLitters] at h
obtain ⟨B, N', hN', h⟩ := h
cases h using Relation.ReflTransGen.head_induction_on
case refl => exact not_mem_scoderiv_botDeriv S N hN'
case head x hx₁ hx₂ _ =>
obtain ⟨⟨γ, δ, ε, hδ, hε, hδε, A⟩, t, B, hB, hN, ht⟩ := hx₂
simp only at hB
cases B
case nil =>
cases hB
obtain ⟨C, N''⟩ := x
simp only at ht
cases ht.1
change _ ∈ t.supportᴺ at hN
rw [t.support_supports.2 rfl] at hN
obtain ⟨i, hN⟩ := hN
cases hN
case sderiv δ B hδ _ _ =>
cases B
case nil => cases hB
case sderiv ζ B hζ _ _ => cases hB
theorem raise_preStrong' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).PreStrong := by
apply hS.toPreStrong.add
constructor
intro A N hN P t hA ht
obtain ⟨A, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN
simp only [scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, interferenceSupport_nearLitters,
Enumeration.mem_add_iff, Enumeration.mem_smul, Enumeration.not_mem_empty, or_false] at hN
obtain ⟨δ, ε, ζ, hε, hζ, hεζ, B⟩ := P
dsimp only at *
cases A
case sderiv ζ' A hζ' _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_left_inj.mp at hA
cases A
case nil =>
cases hA
cases not_mem_strong_botDeriv T _ hN
case sderiv ι A hι _ _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
cases hA
haveI : LtLevel δ := ⟨A.le.trans_lt LtLevel.elim⟩
haveI : LtLevel ε := ⟨hε.trans LtLevel.elim⟩
haveI : LtLevel ζ := ⟨hζ.trans LtLevel.elim⟩
have := (T ↗ hγ).strong_strong.support_le hN ⟨δ, ε, ζ, hε, hζ, hεζ, A⟩
(ρ⁻¹ ⇘ A ↘ hε • t) rfl ?_
· simp only [Tangle.smul_support, allPermSderiv_forget, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv] at this
have := smul_le_smul this (ρᵁ ⇘ A ↘ hε)
simp only [smul_inv_smul] at this
apply le_trans this
intro B
constructor
· intro a ha
simp only [smul_derivBot, Tree.sderiv_apply, Tree.deriv_apply, Path.deriv_scoderiv,
deriv_derivBot, Enumeration.mem_smul] at ha
rw [deriv_derivBot, ← Path.deriv_scoderiv, Path.coderiv_deriv', scoderiv_botDeriv_eq,]
simp only [Path.deriv_scoderiv, add_derivBot, smul_derivBot,
BaseSupport.add_atoms, BaseSupport.smul_atoms, Enumeration.mem_add_iff,
Enumeration.mem_smul]
exact Or.inl ha
· intro N hN
simp only [smul_derivBot, Tree.sderiv_apply, Tree.deriv_apply, Path.deriv_scoderiv,
deriv_derivBot, Enumeration.mem_smul] at hN
rw [deriv_derivBot, ← Path.deriv_scoderiv, Path.coderiv_deriv', scoderiv_botDeriv_eq,]
simp only [Path.deriv_scoderiv, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul]
exact Or.inl hN
· rw [← smul_fuzz hε hζ hεζ, ← ht]
simp only [Path.botSderiv_coe_eq, BasePerm.smul_nearLitter_litter, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.inv_sderivBot]
rfl
theorem raise_closed' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β)
(hρ : ρᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).Closed := by
constructor
intro A
constructor
intro N₁ N₂ hN₁ hN₂ a ha
simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff,
BaseSupport.add_atoms] at hN₁ hN₂ ⊢
obtain hN₁ | hN₁ := hN₁
· obtain hN₂ | hN₂ := hN₂
· exact Or.inl ((hS.closed A).interference_subset hN₁ hN₂ a ha)
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN₂
simp only [smul_add, scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul, BaseSupport.add_atoms, BaseSupport.smul_atoms] at hN₁ hN₂ ⊢
refine Or.inr (Or.inr ?_)
rw [mem_interferenceSupport_atoms]
refine ⟨(ρᵁ B)⁻¹ • N₁, ?_, (ρᵁ B)⁻¹ • N₂, ?_, ?_⟩
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
rw [← Enumeration.mem_smul, ← BaseSupport.smul_nearLitters, ← smul_derivBot, hρ]
exact Or.inl hN₁
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₂
exact Or.inr hN₂
· rw [← BasePerm.smul_interference]
exact Set.smul_mem_smul_set ha
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv hN₁
simp only [smul_add, scoderiv_botDeriv_eq, add_derivBot, smul_derivBot,
BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters, Enumeration.mem_add_iff,
Enumeration.mem_smul, BaseSupport.add_atoms, BaseSupport.smul_atoms] at hN₁ hN₂ ⊢
refine Or.inr (Or.inr ?_)
rw [mem_interferenceSupport_atoms]
refine ⟨(ρᵁ B)⁻¹ • N₁, ?_, (ρᵁ B)⁻¹ • N₂, ?_, ?_⟩
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₁
exact Or.inr hN₁
· simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.mem_add_iff]
simp only [interferenceSupport_nearLitters, Enumeration.not_mem_empty, or_false] at hN₂
obtain hN₂ | hN₂ := hN₂
· rw [← Enumeration.mem_smul, ← BaseSupport.smul_nearLitters, ← smul_derivBot, hρ]
exact Or.inl hN₂
· exact Or.inr hN₂
· rw [← BasePerm.smul_interference]
exact Set.smul_mem_smul_set ha
theorem raise_strong' (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β)
(hρ : ρᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).Strong :=
⟨raise_preStrong' S hS T ρ hγ, raise_closed' S hS T ρ hγ hρ⟩
theorem convAtoms_injective_of_fixes {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(A : ↑α ↝ ⊥) :
(convAtoms
(S + (ρ₁ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim) A).Injective := by
rw [Support.smul_eq_iff] at hρ₁ hρ₂
constructor
rintro a₁ a₂ a₃ ⟨i, hi₁, hi₂⟩ ⟨j, hj₁, hj₂⟩
simp only [add_derivBot, BaseSupport.add_atoms, Rel.inv_apply,
Enumeration.rel_add_iff] at hi₁ hi₂ hj₁ hj₂
obtain hi₁ | ⟨i, rfl, hi₁⟩ := hi₁
· obtain hi₂ | ⟨i', rfl, _⟩ := hi₂
swap
· have := Enumeration.lt_bound _ _ ⟨_, hi₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i').not_lt this
cases (Enumeration.rel_coinjective _).coinjective hi₁ hi₂
obtain hj₁ | ⟨j, rfl, hj₁⟩ := hj₁
· obtain hj₂ | ⟨j', rfl, _⟩ := hj₂
· exact (Enumeration.rel_coinjective _).coinjective hj₂ hj₁
· have := Enumeration.lt_bound _ _ ⟨_, hj₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j').not_lt this
· obtain hj₂ | hj₂ := hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
· simp only [add_right_inj, exists_eq_left] at hj₂
obtain ⟨B, rfl⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨j, hj₁⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,
BaseSupport.add_atoms, Enumeration.smul_rel, add_right_inj, exists_eq_left] at hj₁ hj₂
have := (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
rw [← (hρ₂ B).1 a₁ ⟨_, hi₁⟩, inv_smul_smul, inv_smul_eq_iff, (hρ₁ B).1 a₁ ⟨_, hi₁⟩] at this
exact this.symm
· obtain ⟨B, rfl⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨i, hi₁⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,
BaseSupport.add_atoms, Enumeration.smul_rel, add_right_inj, exists_eq_left] at hi₁ hi₂ hj₁ hj₂
obtain hi₂ | hi₂ := hi₂
· have := Enumeration.lt_bound _ _ ⟨_, hi₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i).not_lt this
have hi := (Enumeration.rel_coinjective _).coinjective hi₁ hi₂
suffices hj : (ρ₁ᵁ B)⁻¹ • a₂ = (ρ₂ᵁ B)⁻¹ • a₃ by
rwa [← hj, smul_left_cancel_iff] at hi
obtain hj₁ | ⟨j, rfl, hj₁⟩ := hj₁
· obtain hj₂ | ⟨j', rfl, _⟩ := hj₂
· rw [← (hρ₁ B).1 a₂ ⟨_, hj₁⟩, ← (hρ₂ B).1 a₃ ⟨_, hj₂⟩, inv_smul_smul, inv_smul_smul]
exact (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j').not_lt this
· obtain hj₂ | hj₂ := hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
· simp only [add_right_inj, exists_eq_left] at hj₂
exact (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
theorem atomMemRel_le_of_fixes {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(A : ↑α ↝ ⊥) :
atomMemRel (S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A ≤
atomMemRel (S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A := by
rw [Support.smul_eq_iff] at hρ₁ hρ₂
rintro i j ⟨N, hN, a, haN, ha⟩
simp only [add_derivBot, BaseSupport.add_atoms, Rel.inv_apply, Enumeration.rel_add_iff,
BaseSupport.add_nearLitters] at ha hN
obtain hN | ⟨i, rfl, hi⟩ := hN
· obtain ha | ⟨j, rfl, hj⟩ := ha
· exact ⟨N, Or.inl hN, a, haN, Or.inl ha⟩
· obtain ⟨B, rfl⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨j, hj⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,
BaseSupport.add_atoms, Enumeration.smul_rel] at hj hN
refine ⟨N, Or.inl hN, ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • a, ?_, ?_⟩
· dsimp only
rw [← (hρ₂ B).2 N ⟨_, hN⟩, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]
have := (hρ₁ B).2 N ⟨_, hN⟩
rw [smul_eq_iff_eq_inv_smul] at this
rwa [this, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]
· rw [Rel.inv_apply, add_derivBot, BaseSupport.add_atoms, Enumeration.rel_add_iff]
simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,
BaseSupport.smul_atoms, BaseSupport.add_atoms, Enumeration.smul_rel, inv_smul_smul,
exists_eq_left]
exact Or.inr hj
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv ⟨i, hi⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_atoms,
BaseSupport.add_atoms, Enumeration.smul_rel] at hi ha
obtain ha | ⟨j, rfl, hj⟩ := ha
· refine ⟨ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • N, ?_, a, ?_, Or.inl ha⟩
· rw [add_derivBot, BaseSupport.add_nearLitters, Enumeration.rel_add_iff]
simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,
BaseSupport.smul_nearLitters, BaseSupport.add_nearLitters, Enumeration.smul_rel,
inv_smul_smul, exists_eq_left]
exact Or.inr hi
· dsimp only
rw [← (hρ₂ B).1 a ⟨_, ha⟩, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]
have := (hρ₁ B).1 a ⟨_, ha⟩
rw [smul_eq_iff_eq_inv_smul] at this
rwa [this, BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]
· refine ⟨ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • N, ?_, ρ₂ᵁ B • (ρ₁ᵁ B)⁻¹ • a, ?_, ?_⟩
· rw [add_derivBot, BaseSupport.add_nearLitters, Enumeration.rel_add_iff]
simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,
BaseSupport.smul_nearLitters, BaseSupport.add_nearLitters, Enumeration.smul_rel,
inv_smul_smul, exists_eq_left]
exact Or.inr hi
· simp only [BasePerm.smul_nearLitter_atoms, Set.smul_mem_smul_set_iff]
exact haN
· rw [Rel.inv_apply, add_derivBot, BaseSupport.add_atoms, Enumeration.rel_add_iff]
simp only [add_right_inj, scoderiv_botDeriv_eq, smul_derivBot, add_derivBot,
BaseSupport.smul_atoms, BaseSupport.add_atoms, Enumeration.smul_rel, inv_smul_smul,
exists_eq_left]
exact Or.inr hj
theorem convNearLitters_cases {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
{A : α ↝ ⊥} {N₁ N₂ : NearLitter} :
convNearLitters
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A N₁ N₂ →
N₁ = N₂ ∧ N₁ ∈ (S ⇘. A)ᴺ ∨
∃ B : β ↝ ⊥, A = B ↗ LtLevel.elim ∧ (ρ₁ᵁ B)⁻¹ • N₁ = (ρ₂ᵁ B)⁻¹ • N₂ ∧
(ρ₁ᵁ B)⁻¹ • N₁ ∈ (((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport) ⇘. B)ᴺ := by
rintro ⟨i, hN₁, hN₂⟩
simp only [add_derivBot, BaseSupport.add_nearLitters, Rel.inv_apply,
Enumeration.rel_add_iff] at hN₁ hN₂
obtain hN₁ | ⟨i, rfl, hN₁⟩ := hN₁
· obtain hN₂ | ⟨i, rfl, hN₂⟩ := hN₂
swap
· have := Enumeration.lt_bound _ _ ⟨_, hN₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i).not_lt this
exact Or.inl ⟨(Enumeration.rel_coinjective _).coinjective hN₁ hN₂, _, hN₁⟩
· obtain ⟨B, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv ⟨i, hN₁⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_nearLitters,
BaseSupport.add_nearLitters, Enumeration.smul_rel, add_right_inj, exists_eq_left] at hN₁ hN₂
obtain hN₂ | hN₂ := hN₂
· have := Enumeration.lt_bound _ _ ⟨_, hN₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i).not_lt this
exact Or.inr ⟨B, rfl, (Enumeration.rel_coinjective _).coinjective hN₁ hN₂, _, hN₁⟩
theorem inflexible_of_inflexible_of_fixes {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
{A : α ↝ ⊥} {N₁ N₂ : NearLitter} :
convNearLitters
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A N₁ N₂ →
∀ (P : InflexiblePath ↑α) (t : Tangle P.δ), A = P.A ↘ P.hε ↘. → N₁ᴸ = fuzz P.hδε t →
∃ ρ : AllPerm P.δ, N₂ᴸ = fuzz P.hδε (ρ • t) := by
rintro hN ⟨γ, δ, ε, hδ, hε, hδε, A⟩ t hA ht
haveI : LeLevel γ := ⟨A.le⟩
haveI : LtLevel δ := ⟨hδ.trans_le LeLevel.elim⟩
haveI : LtLevel ε := ⟨hε.trans_le LeLevel.elim⟩
obtain ⟨rfl, _⟩ | ⟨B, rfl, hN'⟩ := convNearLitters_cases hN
· use 1
rw [one_smul, ht]
· clear hN
cases B
case sderiv ε B hε' _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_path_injective at hA
cases B
case nil =>
simp only [Path.botSderiv_coe_eq, add_derivBot, BaseSupport.add_nearLitters,
interferenceSupport_nearLitters, Enumeration.add_empty] at hN'
cases not_mem_strong_botDeriv _ _ hN'.2
case sderiv ζ B hζ _ _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_path_injective at hA
dsimp only at hA hζ hε' B t
cases hA
use (ρ₂ * ρ₁⁻¹) ⇘ B ↘ hδ
rw [inv_smul_eq_iff] at hN'
rw [← smul_fuzz hδ hε hδε, ← ht, hN'.1]
simp only [allPermDeriv_forget, allPermForget_mul, allPermForget_inv, Tree.mul_deriv,
Tree.inv_deriv, Tree.mul_sderiv, Tree.inv_sderiv, Tree.mul_sderivBot, Tree.inv_sderivBot,
Path.botSderiv_coe_eq, BasePerm.smul_nearLitter_litter, mul_smul]
erw [inv_smul_smul, smul_inv_smul]
theorem atoms_of_inflexible_of_fixes {S : Support α} (hS : S.Strong) {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(A : α ↝ ⊥) (N₁ N₂ : NearLitter) (P : InflexiblePath ↑α) (t : Tangle P.δ) (ρ : AllPerm P.δ) :
A = P.A ↘ P.hε ↘. → N₁ᴸ = fuzz P.hδε t → N₂ᴸ = fuzz P.hδε (ρ • t) →
convNearLitters
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A N₁ N₂ →
∀ (B : P.δ ↝ ⊥), ∀ a ∈ (t.support ⇘. B)ᴬ, ∀ (i : κ),
((S + (ρ₁ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim) ⇘. (P.A ↘ P.hδ ⇘ B))ᴬ.rel i a →
((S + (ρ₂ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim) ⇘. (P.A ↘ P.hδ ⇘ B))ᴬ.rel i (ρᵁ B • a) := by
rw [Support.smul_eq_iff] at hρ₁ hρ₂
obtain ⟨γ, δ, ε, hδ, hε, hδε, B⟩ := P
haveI : LeLevel γ := ⟨B.le⟩
haveI : LtLevel δ := ⟨hδ.trans_le LeLevel.elim⟩
haveI : LtLevel ε := ⟨hε.trans_le LeLevel.elim⟩
dsimp only at t ρ ⊢
intro hA hN₁ hN₂ hN C a ha i hi
obtain ⟨rfl, hN'⟩ | ⟨A, rfl, hN₁', hN₂'⟩ := convNearLitters_cases hN
· have haS := (hS.support_le hN' ⟨γ, δ, ε, hδ, hε, hδε, _⟩ t hA hN₁ _).1 a ha
rw [hN₂] at hN₁
have hρt := congr_arg Tangle.support (fuzz_injective hN₁)
rw [Tangle.smul_support, Support.smul_eq_iff] at hρt
simp only [add_derivBot, BaseSupport.add_atoms, Enumeration.rel_add_iff] at hi ⊢
rw [(hρt C).1 a ha]
obtain hi | ⟨i, rfl, hi⟩ := hi
· exact Or.inl hi
· simp only [add_right_inj, exists_eq_left]
obtain ⟨D, hD⟩ := eq_of_atom_mem_scoderiv_botDeriv ⟨i, hi⟩
cases B using Path.recScoderiv
case nil =>
cases Path.scoderiv_index_injective hD
cases Path.scoderiv_left_inj.mp hD
simp only [hD, Path.coderiv_deriv, Path.coderiv_deriv', scoderiv_botDeriv_eq, smul_derivBot,
add_derivBot, BaseSupport.smul_atoms, BaseSupport.add_atoms, Enumeration.smul_rel] at hi ⊢
rw [deriv_derivBot, hD] at haS
rw [← (hρ₂ _).1 a haS, inv_smul_smul]
rw [← (hρ₁ _).1 a haS, inv_smul_smul] at hi
exact Or.inr hi
case scoderiv ζ B hζ' _ =>
rw [Path.coderiv_deriv, Path.coderiv_deriv'] at hD
cases Path.scoderiv_index_injective hD
rw [Path.scoderiv_left_inj] at hD
cases hD
simp only [Path.coderiv_deriv, Path.coderiv_deriv', scoderiv_botDeriv_eq, smul_derivBot,
add_derivBot, BaseSupport.smul_atoms, BaseSupport.add_atoms, Enumeration.smul_rel] at hi ⊢
rw [deriv_derivBot, Path.coderiv_deriv, Path.coderiv_deriv'] at haS
rw [← (hρ₂ _).1 a haS, inv_smul_smul]
rw [← (hρ₁ _).1 a haS, inv_smul_smul] at hi
exact Or.inr hi
· simp only [add_derivBot, BaseSupport.add_nearLitters, interferenceSupport_nearLitters,
Enumeration.add_empty] at hN₂'
cases A
case sderiv ζ A hζ' _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_path_injective at hA
cases A
case nil =>
cases hA
cases not_mem_strong_botDeriv _ _ hN₂'
case sderiv ζ A hζ _ _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_path_injective at hA
cases hA
simp only [Path.coderiv_deriv, Path.coderiv_deriv', add_derivBot, scoderiv_botDeriv_eq,
smul_derivBot, BaseSupport.add_atoms, BaseSupport.smul_atoms] at hi ⊢
have : N₂ᴸ = (ρ₂ ⇘ A)ᵁ ↘ hζ ↘. • (ρ₁⁻¹ ⇘ A)ᵁ ↘ hζ ↘. • fuzz hδε t := by
rw [inv_smul_eq_iff] at hN₁'
rw [hN₁', Path.botSderiv_coe_eq, BasePerm.smul_nearLitter_litter,
BasePerm.smul_nearLitter_litter, smul_smul, smul_eq_iff_eq_inv_smul,
mul_inv_rev, inv_inv, mul_smul, ← Tree.inv_apply, ← allPermForget_inv] at hN₁
rw [hN₁]
simp only [allPermForget_inv, Tree.inv_apply, allPermDeriv_forget, Tree.inv_deriv,
Tree.inv_sderiv, Tree.inv_sderivBot]
rfl
rw [smul_fuzz hδ hε hδε, smul_fuzz hδ hε hδε] at this
have := fuzz_injective (hN₂.symm.trans this)
rw [smul_smul] at this
rw [t.smul_atom_eq_of_mem_support this ha]
rw [Enumeration.rel_add_iff] at hi ⊢
obtain hi | ⟨i, rfl, hi⟩ := hi
· left
simp only [allPermForget_mul, allPermSderiv_forget, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.mul_apply, Tree.sderiv_apply,
Tree.deriv_apply, Path.deriv_scoderiv, Tree.inv_apply, mul_smul]
rwa [← (hρ₁ _).1 a ⟨i, hi⟩, inv_smul_smul, (hρ₂ _).1 a ⟨i, hi⟩]
· refine Or.inr ⟨i, rfl, ?_⟩
simp only [allPermForget_mul, allPermSderiv_forget, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.mul_apply, Tree.sderiv_apply,
Tree.deriv_apply, Path.deriv_scoderiv, Tree.inv_apply, mul_smul, Enumeration.smul_rel,
inv_smul_smul]
exact hi
theorem nearLitters_of_inflexible_of_fixes {S : Support α} (hS : S.Strong) {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(A : α ↝ ⊥) (N₁ N₂ : NearLitter) (P : InflexiblePath ↑α) (t : Tangle P.δ) (ρ : AllPerm P.δ) :
A = P.A ↘ P.hε ↘. → N₁ᴸ = fuzz P.hδε t → N₂ᴸ = fuzz P.hδε (ρ • t) →
convNearLitters
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A N₁ N₂ →
∀ (B : P.δ ↝ ⊥), ∀ N ∈ (t.support ⇘. B)ᴺ, ∀ (i : κ),
((S + (ρ₁ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim) ⇘. (P.A ↘ P.hδ ⇘ B))ᴺ.rel i N →
((S + (ρ₂ᵁ • ((T ↗ hγ).strong + (S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗
LtLevel.elim) ⇘. (P.A ↘ P.hδ ⇘ B))ᴺ.rel i (ρᵁ B • N) := by
rw [Support.smul_eq_iff] at hρ₁ hρ₂
obtain ⟨γ, δ, ε, hδ, hε, hδε, B⟩ := P
haveI : LeLevel γ := ⟨B.le⟩
haveI : LtLevel δ := ⟨hδ.trans_le LeLevel.elim⟩
haveI : LtLevel ε := ⟨hε.trans_le LeLevel.elim⟩
dsimp only at t ρ ⊢
intro hA hN₁ hN₂ hN C N₀ hN₀ i hi
obtain ⟨rfl, hN'⟩ | ⟨A, rfl, hN₁', hN₂'⟩ := convNearLitters_cases hN
· have haS := (hS.support_le hN' ⟨γ, δ, ε, hδ, hε, hδε, _⟩ t hA hN₁ _).2 N₀ hN₀
rw [hN₂] at hN₁
have hρt := congr_arg Tangle.support (fuzz_injective hN₁)
rw [Tangle.smul_support, Support.smul_eq_iff] at hρt
simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.rel_add_iff] at hi ⊢
rw [(hρt C).2 N₀ hN₀]
obtain hi | ⟨i, rfl, hi⟩ := hi
· exact Or.inl hi
· simp only [add_right_inj, exists_eq_left]
obtain ⟨D, hD⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv ⟨i, hi⟩
cases B using Path.recScoderiv
case nil =>
cases Path.scoderiv_index_injective hD
cases Path.scoderiv_left_inj.mp hD
simp only [hD, Path.coderiv_deriv, Path.coderiv_deriv', scoderiv_botDeriv_eq, smul_derivBot,
add_derivBot, BaseSupport.smul_nearLitters, BaseSupport.add_nearLitters, Enumeration.smul_rel] at hi ⊢
rw [deriv_derivBot, hD] at haS
rw [← (hρ₂ _).2 N₀ haS, inv_smul_smul]
rw [← (hρ₁ _).2 N₀ haS, inv_smul_smul] at hi
exact Or.inr hi
case scoderiv ζ B hζ' _ =>
rw [Path.coderiv_deriv, Path.coderiv_deriv'] at hD
cases Path.scoderiv_index_injective hD
rw [Path.scoderiv_left_inj] at hD
cases hD
simp only [Path.coderiv_deriv, Path.coderiv_deriv', scoderiv_botDeriv_eq, smul_derivBot,
add_derivBot, BaseSupport.smul_nearLitters, BaseSupport.add_nearLitters, Enumeration.smul_rel] at hi ⊢
rw [deriv_derivBot, Path.coderiv_deriv, Path.coderiv_deriv'] at haS
rw [← (hρ₂ _).2 N₀ haS, inv_smul_smul]
rw [← (hρ₁ _).2 N₀ haS, inv_smul_smul] at hi
exact Or.inr hi
· simp only [add_derivBot, BaseSupport.add_nearLitters, interferenceSupport_nearLitters,
Enumeration.add_empty] at hN₂'
cases A
case sderiv ζ A hζ' _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_path_injective at hA
cases A
case nil =>
cases hA
cases not_mem_strong_botDeriv _ _ hN₂'
case sderiv ζ A hζ _ _ =>
rw [← Path.coderiv_deriv] at hA
cases Path.sderiv_index_injective hA
apply Path.sderiv_path_injective at hA
cases hA
simp only [Path.coderiv_deriv, Path.coderiv_deriv', add_derivBot, scoderiv_botDeriv_eq,
smul_derivBot, BaseSupport.add_nearLitters, BaseSupport.smul_nearLitters] at hi ⊢
have : N₂ᴸ = (ρ₂ ⇘ A)ᵁ ↘ hζ ↘. • (ρ₁⁻¹ ⇘ A)ᵁ ↘ hζ ↘. • fuzz hδε t := by
rw [inv_smul_eq_iff] at hN₁'
rw [hN₁', Path.botSderiv_coe_eq, BasePerm.smul_nearLitter_litter,
BasePerm.smul_nearLitter_litter, smul_smul, smul_eq_iff_eq_inv_smul,
mul_inv_rev, inv_inv, mul_smul, ← Tree.inv_apply, ← allPermForget_inv] at hN₁
rw [hN₁]
simp only [allPermForget_inv, Tree.inv_apply, allPermDeriv_forget, Tree.inv_deriv,
Tree.inv_sderiv, Tree.inv_sderivBot]
rfl
rw [smul_fuzz hδ hε hδε, smul_fuzz hδ hε hδε] at this
have := fuzz_injective (hN₂.symm.trans this)
rw [smul_smul] at this
rw [t.smul_nearLitter_eq_of_mem_support this hN₀]
rw [Enumeration.rel_add_iff] at hi ⊢
obtain hi | ⟨i, rfl, hi⟩ := hi
· left
simp only [allPermForget_mul, allPermSderiv_forget, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.mul_apply, Tree.sderiv_apply,
Tree.deriv_apply, Path.deriv_scoderiv, Tree.inv_apply, mul_smul]
rwa [← (hρ₁ _).2 N₀ ⟨i, hi⟩, inv_smul_smul, (hρ₂ _).2 N₀ ⟨i, hi⟩]
· refine Or.inr ⟨i, rfl, ?_⟩
simp only [allPermForget_mul, allPermSderiv_forget, allPermDeriv_forget,
allPermForget_inv, Tree.inv_deriv, Tree.inv_sderiv, Tree.mul_apply, Tree.sderiv_apply,
Tree.deriv_apply, Path.deriv_scoderiv, Tree.inv_apply, mul_smul, Enumeration.smul_rel,
inv_smul_smul]
exact hi
theorem litter_eq_of_flexible_of_fixes {S : Support α} {T : Support γ}
{ρ₁ ρ₂ : AllPerm β} {hγ : (γ : TypeIndex) < β}
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
{A : ↑α ↝ ⊥} {N₁ N₂ N₃ N₄ : NearLitter} :
convNearLitters
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A N₁ N₂ →
convNearLitters
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) A N₃ N₄ →
¬Inflexible A N₁ᴸ → ¬Inflexible A N₂ᴸ → ¬Inflexible A N₃ᴸ → ¬Inflexible A N₄ᴸ →
N₁ᴸ = N₃ᴸ → N₂ᴸ = N₄ᴸ := by
rw [Support.smul_eq_iff] at hρ₁ hρ₂
rintro ⟨i, hi₁, hi₂⟩ ⟨j, hj₁, hj₂⟩ hN₁ hN₂ hN₃ hN₄ hN₁₃
simp only [add_derivBot, BaseSupport.add_nearLitters, Rel.inv_apply,
Enumeration.rel_add_iff] at hi₁ hi₂ hj₁ hj₂
obtain hi₁ | ⟨i, rfl, hi₁⟩ := hi₁
· obtain hi₂ | ⟨i, rfl, hi₂⟩ := hi₂
swap
· have := Enumeration.lt_bound _ _ ⟨_, hi₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i).not_lt this
cases (Enumeration.rel_coinjective _).coinjective hi₁ hi₂
obtain hj₁ | ⟨j, rfl, hj₁⟩ := hj₁
· obtain hj₂ | ⟨j, rfl, hj₂⟩ := hj₂
swap
· have := Enumeration.lt_bound _ _ ⟨_, hj₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
cases (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
exact hN₁₃
· simp only [add_right_inj, exists_eq_left] at hj₂
obtain hj₂ | hj₂ := hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
obtain ⟨A, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv ⟨j, hj₁⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_nearLitters,
BaseSupport.add_nearLitters, Enumeration.smul_rel] at hj₁ hj₂
have := congr_arg (·ᴸ) ((Enumeration.rel_coinjective _).coinjective hj₁ hj₂)
simp only [BasePerm.smul_nearLitter_litter] at this
rw [← hN₁₃, ← (hρ₁ A).2 N₁ ⟨i, hi₁⟩, BasePerm.smul_nearLitter_litter, inv_smul_smul] at this
have hN₁' := (hρ₂ A).2 N₁ ⟨i, hi₁⟩
rw [smul_eq_iff_eq_inv_smul] at hN₁'
rwa [hN₁', BasePerm.smul_nearLitter_litter, smul_left_cancel_iff] at this
· obtain hi₂ | hi₂ := hi₂
· have := Enumeration.lt_bound _ _ ⟨_, hi₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le i).not_lt this
simp only [add_right_inj, exists_eq_left] at hi₂
obtain ⟨A, rfl⟩ := eq_of_nearLitter_mem_scoderiv_botDeriv ⟨i, hi₁⟩
simp only [scoderiv_botDeriv_eq, smul_derivBot, add_derivBot, BaseSupport.smul_nearLitters,
BaseSupport.add_nearLitters, Enumeration.smul_rel] at hi₁ hi₂ hj₁ hj₂
have hN₁₂ := congr_arg (·ᴸ) ((Enumeration.rel_coinjective _).coinjective hi₁ hi₂)
obtain hj₁ | ⟨j, rfl, hj₁⟩ := hj₁
· obtain hj₂ | ⟨j, rfl, hj₂⟩ := hj₂
swap
· have := Enumeration.lt_bound _ _ ⟨_, hj₁⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
cases (Enumeration.rel_coinjective _).coinjective hj₁ hj₂
simp only [BasePerm.smul_nearLitter_litter] at hN₁₂
rw [hN₁₃, ← (hρ₁ A).2 N₃ ⟨j, hj₁⟩, BasePerm.smul_nearLitter_litter, inv_smul_smul,
eq_inv_smul_iff, ← BasePerm.smul_nearLitter_litter, (hρ₂ A).2 N₃ ⟨j, hj₁⟩] at hN₁₂
rw [hN₁₂]
· simp only [add_right_inj, exists_eq_left] at hj₂
obtain hj₂ | hj₂ := hj₂
· have := Enumeration.lt_bound _ _ ⟨_, hj₂⟩
simp only [add_lt_iff_neg_left] at this
cases (κ_zero_le j).not_lt this
have hN₃₄ := congr_arg (·ᴸ) ((Enumeration.rel_coinjective _).coinjective hj₁ hj₂)
simp only [BasePerm.smul_nearLitter_litter] at hN₁₂ hN₃₄
rw [hN₁₃] at hN₁₂
rwa [hN₁₂, smul_left_cancel_iff] at hN₃₄
theorem sameSpecLe_of_fixes (S : Support α) (hS : S.Strong) (T : Support γ) (ρ₁ ρ₂ : AllPerm β)
(hγ : (γ : TypeIndex) < β)
(hρ₁ : ρ₁ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim)
(hρ₂ : ρ₂ᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
SameSpecLE
(S + (ρ₁ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim)
(S + (ρ₂ᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim) := by
constructor
case atoms_bound_eq => intro; rfl
case nearLitters_bound_eq => intro; rfl
case atoms_dom_subset =>
simp only [add_derivBot, BaseSupport.add_atoms, Enumeration.add_rel_dom,
Set.union_subset_iff, Set.subset_union_left, true_and]
rintro A _ ⟨i, ⟨a, ⟨A, a⟩, h₁, h₂⟩, rfl⟩
cases h₂
right
apply Set.mem_image_of_mem
refine ⟨ρ₂ᵁ A • (ρ₁ᵁ A)⁻¹ • a, ⟨A, ρ₂ᵁ A • (ρ₁ᵁ A)⁻¹ • a⟩, ?_, rfl⟩
rw [smul_atoms, Enumeration.smulPath_rel] at h₁ ⊢
simp only [inv_smul_smul]
exact h₁
case nearLitters_dom_subset =>
simp only [add_derivBot, BaseSupport.add_nearLitters, Enumeration.add_rel_dom,
Set.union_subset_iff, Set.subset_union_left, true_and]
rintro A _ ⟨i, ⟨N, ⟨A, N⟩, h₁, h₂⟩, rfl⟩
cases h₂
right
apply Set.mem_image_of_mem
refine ⟨ρ₂ᵁ A • (ρ₁ᵁ A)⁻¹ • N, ⟨A, ρ₂ᵁ A • (ρ₁ᵁ A)⁻¹ • N⟩, ?_, rfl⟩
rw [smul_nearLitters, Enumeration.smulPath_rel] at h₁ ⊢
simp only [inv_smul_smul]
exact h₁
case convAtoms_injective => exact convAtoms_injective_of_fixes hρ₁ hρ₂
case atomMemRel_le => exact atomMemRel_le_of_fixes hρ₁ hρ₂
case inflexible_of_inflexible => exact inflexible_of_inflexible_of_fixes hρ₁ hρ₂
case atoms_of_inflexible => exact atoms_of_inflexible_of_fixes hS hρ₁ hρ₂
case nearLitters_of_inflexible => exact nearLitters_of_inflexible_of_fixes hS hρ₁ hρ₂
case litter_eq_of_flexible => exact litter_eq_of_flexible_of_fixes hρ₁ hρ₂
theorem spec_same_of_fixes (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hρ : ρᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
(S + ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport) ↗ LtLevel.elim).spec =
(S + (ρᵁ • ((T ↗ hγ).strong +
(S ↘ LtLevel.elim + (T ↗ hγ).strong).interferenceSupport)) ↗ LtLevel.elim).spec := by
rw [Support.spec_eq_spec_iff]
apply sameSpec_antisymm
· have := sameSpecLe_of_fixes S hS T 1 ρ hγ ?_ hρ
· simp only [allPermForget_one, one_smul, smul_add] at this
exact this
· simp only [allPermForget_one, one_smul]
· have := sameSpecLe_of_fixes S hS T ρ 1 hγ hρ ?_
· simp only [allPermForget_one, one_smul, smul_add] at this
exact this
· simp only [allPermForget_one, one_smul]
| theorem exists_allowable_of_fixes (S : Support α) (hS : S.Strong) (T : Support γ) (ρ : AllPerm β)
(hγ : (γ : TypeIndex) < β)
(hρ : ρᵁ • (S ↘ LtLevel.elim : Support β) = S ↘ LtLevel.elim) :
∃ ρ' : AllPerm α, ρ'ᵁ • S = S ∧ ρ'ᵁ ↘ LtLevel.elim ↘ hγ • T = ρᵁ ↘ hγ • T | ConNF.Support.exists_allowable_of_fixes | {
"commit": "abf71bc79c407ceb462cc2edd2d994cda9cdef05",
"date": "2024-04-04T00:00:00"
} | {
"commit": "2e25ffbc94af48261308cea0d8c55205cc388ef0",
"date": "2024-12-01T00:00:00"
} | ConNF/ConNF/Model/RaiseStrong.lean | ConNF.Model.RaiseStrong | ConNF.Model.RaiseStrong.jsonl | {
"lineInFile": 716,
"tokenPositionInFile": 35436,
"theoremPositionInFile": 14
} | {
"inFilePremises": true,
"numInFilePremises": 2,
"repositoryPremises": true,
"numRepositoryPremises": 66,
"numPremises": 110
} | {
"hasProof": true,
"proof": ":= by\n have := spec_same_of_fixes (hγ := hγ) S hS T ρ hρ\n have := exists_conv this ?_ ?_\n · obtain ⟨ρ', hρ'⟩ := this\n use ρ'\n simp only [Support.smul_add] at hρ'\n obtain ⟨hρ'₁, hρ'₂⟩ := add_inj_of_bound_eq_bound (by rfl) (by rfl) hρ'\n rw [Support.smul_scoderiv, scoderiv_inj, smul_add] at hρ'₂\n obtain ⟨hρ'₃, -⟩ := add_inj_of_bound_eq_bound (by rfl) (by rfl) hρ'₂\n have := smul_eq_smul_of_le (T ↗ hγ).subsupport_strong.le hρ'₃\n rw [Support.smul_scoderiv, smul_scoderiv, scoderiv_inj] at this\n exact ⟨hρ'₁, this⟩\n · have := raise_strong' S hS T 1 hγ (by simp only [allPermForget_one, one_smul])\n simp only [allPermForget_one, one_smul] at this\n exact this\n · exact raise_strong' S hS T ρ hγ hρ",
"proofType": "tactic",
"proofLengthLines": 15,
"proofLengthTokens": 727
} |
import ConNF.Model.RaiseStrong
/-!
# New file
In this file...
## Main declarations
* `ConNF.foo`: Something new.
-/
noncomputable section
universe u
open Cardinal Ordinal
open scoped Pointwise
namespace ConNF
variable [Params.{u}]
/-- A redefinition of the derivative of allowable permutations that is invariant of level,
but still has nice definitional properties. -/
@[default_instance 200]
instance {β γ : TypeIndex} : Derivative (AllPerm β) (AllPerm γ) β γ where
deriv ρ A :=
A.recSderiv
(motive := λ (δ : TypeIndex) (A : β ↝ δ) ↦
letI : Level := ⟨δ.recBotCoe (Nonempty.some inferInstance) id⟩
letI : LeLevel δ := ⟨δ.recBotCoe (λ _ ↦ bot_le) (λ _ h ↦ WithBot.coe_le_coe.mpr h.le)
(show δ.recBotCoe (Nonempty.some inferInstance) id = Level.α from rfl)⟩
AllPerm δ)
ρ (λ δ ε A h ρ ↦
letI : Level := ⟨δ.recBotCoe (Nonempty.some inferInstance) id⟩
letI : LeLevel δ := ⟨δ.recBotCoe (λ _ ↦ bot_le) (λ _ h ↦ WithBot.coe_le_coe.mpr h.le)
(show δ.recBotCoe (Nonempty.some inferInstance) id = Level.α from rfl)⟩
letI : LeLevel ε := ⟨h.le.trans LeLevel.elim⟩
PreCoherentData.allPermSderiv h ρ)
@[simp]
theorem allPerm_deriv_nil' {β : TypeIndex}
(ρ : AllPerm β) :
ρ ⇘ (.nil : β ↝ β) = ρ :=
rfl
@[simp]
theorem allPerm_deriv_sderiv' {β γ δ : TypeIndex}
(ρ : AllPerm β) (A : β ↝ γ) (h : δ < γ) :
ρ ⇘ (A ↘ h) = ρ ⇘ A ↘ h :=
rfl
@[simp]
theorem allPermSderiv_forget' {β γ : TypeIndex} (h : γ < β) (ρ : AllPerm β) :
(ρ ↘ h)ᵁ = ρᵁ ↘ h :=
letI : Level := ⟨β.recBotCoe (Nonempty.some inferInstance) id⟩
letI : LeLevel β := ⟨β.recBotCoe (λ _ ↦ bot_le) (λ _ h ↦ WithBot.coe_le_coe.mpr h.le)
(show β.recBotCoe (Nonempty.some inferInstance) id = Level.α from rfl)⟩
letI : LeLevel γ := ⟨h.le.trans LeLevel.elim⟩
allPermSderiv_forget h ρ
| @[simp]
theorem allPerm_inv_sderiv' {β γ : TypeIndex} (h : γ < β) (ρ : AllPerm β) :
ρ⁻¹ ↘ h = (ρ ↘ h)⁻¹ | ConNF.allPerm_inv_sderiv' | {
"commit": "6fdc87c6b30b73931407a372f1430ecf0fef7601",
"date": "2024-12-03T00:00:00"
} | {
"commit": "2e25ffbc94af48261308cea0d8c55205cc388ef0",
"date": "2024-12-01T00:00:00"
} | ConNF/ConNF/Model/TTT.lean | ConNF.Model.TTT | ConNF.Model.TTT.jsonl | {
"lineInFile": 63,
"tokenPositionInFile": 1837,
"theoremPositionInFile": 3
} | {
"inFilePremises": true,
"numInFilePremises": 2,
"repositoryPremises": true,
"numRepositoryPremises": 24,
"numPremises": 42
} | {
"hasProof": true,
"proof": ":= by\n apply allPermForget_injective\n rw [allPermSderiv_forget', allPermForget_inv, Tree.inv_sderiv, allPermForget_inv,\n allPermSderiv_forget']",
"proofType": "tactic",
"proofLengthLines": 3,
"proofLengthTokens": 148
} |
Subsets and Splits