text
stringlengths 0
3.34M
|
---|
function result = warpAffine3B(in,A,badVal,B,interpMethod)
%
% function result = warpAffine3B(in,A,badVal,B)
%
% in: input volume, 3D array
% A: 3x4 affine transform matrix or a 4x4 matrix with [0 0 0 1]
% for the last row.
% badVal: if a transformed point is outside of the volume, badVal is used
% B: number of voxels to put in the border (default =0, no border)
%
% result: output volume, same size as in
%
% 10/99, on - added Border parameter to permit nearest neighbor interpolation at the edges
%
if ( ~exist('badVal') | isempty(badVal) )
badVal=NaN;
end
if ( ~exist('B') | isempty(B) )
B = 0;
end
if(ieNotDefined('interpMethod'))
interpMethod = '*linear';
end
if (size(A,1)>3)
A=A(1:3,:);
end
% original size
[NyO NxO NzO] = size(in);
% if B~=0, put a border by replicating edge voxels
if B~=0
% put border at each slice
for k =1:size(in,3)
inB(:,:,k) = putborde(in(:,:,k),B,B,3);
end
% repeat the first and last slices
in = cat(3,repmat(inB(:,:,1),[1 1 B]), inB, repmat(inB(:,:,end),[1 1 B]));
end
% coordinates corresponding to the volume with borders
[xB,yB,zB]=meshgrid(1-B:size(in,2)-B,1-B:size(in,1)-B,1-B:size(in,3)-B);
% Compute coordinates corresponding to input volume
% and transformed coordinates for result
[xgrid,ygrid,zgrid]=meshgrid(1:NxO,1:NyO,1:NzO);
coords=[xgrid(:)'; ygrid(:)'; zgrid(:)'];
homogeneousCoords=[coords; ones(1,size(coords,2))];
warpedCoords=A*homogeneousCoords;
% Compute result using interp3
result = interp3(xB,yB,zB,in,warpedCoords(1,:),warpedCoords(2,:),warpedCoords(3,:),interpMethod);
result = reshape(result,[NyO NxO NzO]);
% replace NaNs with badval
if(~isnan(badVal))
NaNIndices = find(isnan(result));
result(NaNIndices)=badVal*ones(size(NaNIndices));
end
return;
%%% Debug
slice=[1 2 3; 4 5 6; 7 8 9]';
slice=[1 1 1; 3 3 3; 5 5 5]';
input=ones(3,3,4);
for z=1:4
input(:,:,z)=slice;
end
A= [1 0 0 .5;
0 1 0 0;
0 0 1 0;
0 0 0 1];
A= [1 0 0 .5;
0 1 0 .5;
0 0 1 0];
res=warpAffine3(input,A)
resB=warpAffine3B(input,A,NaN,1)
for z=1:4
input(:,:,z)=z*ones(3,3);
end
A= [1 0 0 0;
0 1 0 0;
0 0 1 .5;
0 0 0 1];
res=warpAffine3(input,A)
resB=warpAffine3B(input,A,NaN,1)
input=rand(5,5,5);
res=warpAffine3(input,eye(4));
resB=warpAffine3B(input,eye(4),NaN,1);
|
module Issue118Comment9 where
open import Common.Level
open import Common.Coinduction
data Box (A : Set) : Set where
[_] : A → Box A
postulate I : Set
data P : I → Set where
c : ∀ {i} → Box (∞ (P i)) → P i
F : ∀ {i} → P i → I
F (c x) = _
G : ∀ {i} → Box (∞ (P i)) → I
G [ x ] = _
mutual
f : ∀ {i} (x : P i) → P (F x)
f (c x) = c (g x)
g : ∀ {i} (x : Box (∞ (P i))) → Box (∞ (P (G x)))
g [ x ] = [ ♯ f (♭ x) ]
-- The code above type checks, but the termination checker should
-- complain because the inferred definitions of F and G are
-- F (c x) = G x and G [ x ] = F (♭ x), respectively.
-- 2011-04-12 freezing: now the meta-variables remain uninstantiated.
-- good.
|
{-# OPTIONS --safe --warning=error --without-K #-}
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Functions.Definition
module Orders.WellFounded.Definition {a b : _} {A : Set a} (_<_ : Rel {a} {b} A) where
data Accessible (x : A) : Set (lsuc a ⊔ b) where
access : (∀ y → y < x → Accessible y) → Accessible x
WellFounded : Set (lsuc a ⊔ b)
WellFounded = ∀ x → Accessible x
|
Saprang was considered a strong contender to lead the junta given the mandatory retirement of Army commander @-@ in @-@ chief and CNS President Sonthi Boonyaratkalin in September 2007 . He unofficially competed with fellow Assistant Army Commander Anupong Paochinda , who , as 1st Army Area Commander , secured Bangkok on the night of the coup . The Bangkok Post reported in October 2006 that Sonthi was grooming Anupong to be his successor by giving him responsibilities over coup logistics , a greater task than had been assigned to Saprang . The Asia Times quoted a former MP as saying that " Anupong is seen as the real force behind the coup . Saprang is more vocal , but he has no real base . The only way he could be seen as a promising leader is by pushing the country to the brink . "
|
/-
Copyright (c) 2020 Jeremy Avigad. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jeremy Avigad, Mario Carneiro, Yury G. Kudryashov
! This file was ported from Lean 3 source module order.rel_classes
! leanprover-community/mathlib commit bc7d81beddb3d6c66f71449c5bc76c38cb77cf9e
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathlib.Order.Basic
import Mathlib.Logic.IsEmpty
import Mathlib.Tactic.MkIffOfInductiveProp
/-!
# Unbundled relation classes
In this file we prove some properties of `Is*` classes defined in `Init.Algebra.Classes`. The main
difference between these classes and the usual order classes (`Preorder` etc) is that usual classes
extend `LE` and/or `LT` while these classes take a relation as an explicit argument.
-/
universe u v
variable {α : Type u} {β : Type v} {r : α → α → Prop} {s : β → β → Prop}
open Function
theorem of_eq [IsRefl α r] : ∀ {a b}, a = b → r a b
| _, _, .refl _ => refl _
#align of_eq of_eq
theorem comm [IsSymm α r] {a b : α} : r a b ↔ r b a :=
⟨symm, symm⟩
#align comm comm
theorem antisymm' [IsAntisymm α r] {a b : α} : r a b → r b a → b = a := fun h h' => antisymm h' h
#align antisymm' antisymm'
theorem antisymm_iff [IsRefl α r] [IsAntisymm α r] {a b : α} : r a b ∧ r b a ↔ a = b :=
⟨fun h => antisymm h.1 h.2, by
rintro rfl
exact ⟨refl _, refl _⟩⟩
#align antisymm_iff antisymm_iff
/-- A version of `antisymm` with `r` explicit.
This lemma matches the lemmas from lean core in `Init.Algebra.Classes`, but is missing there. -/
@[elab_without_expected_type]
theorem antisymm_of (r : α → α → Prop) [IsAntisymm α r] {a b : α} : r a b → r b a → a = b :=
antisymm
#align antisymm_of antisymm_of
/-- A version of `antisymm'` with `r` explicit.
This lemma matches the lemmas from lean core in `Init.Algebra.Classes`, but is missing there. -/
@[elab_without_expected_type]
theorem antisymm_of' (r : α → α → Prop) [IsAntisymm α r] {a b : α} : r a b → r b a → b = a :=
antisymm'
#align antisymm_of' antisymm_of'
/-- A version of `comm` with `r` explicit.
This lemma matches the lemmas from lean core in `Init.Algebra.Classes`, but is missing there. -/
theorem comm_of (r : α → α → Prop) [IsSymm α r] {a b : α} : r a b ↔ r b a :=
comm
#align comm_of comm_of
theorem IsRefl.swap (r) [IsRefl α r] : IsRefl α (swap r) :=
⟨refl_of r⟩
#align is_refl.swap IsRefl.swap
theorem IsIrrefl.swap (r) [IsIrrefl α r] : IsIrrefl α (swap r) :=
⟨irrefl_of r⟩
#align is_irrefl.swap IsIrrefl.swap
theorem IsTrans.swap (r) [IsTrans α r] : IsTrans α (swap r) :=
⟨fun _ _ _ h₁ h₂ => trans_of r h₂ h₁⟩
#align is_trans.swap IsTrans.swap
theorem IsAntisymm.swap (r) [IsAntisymm α r] : IsAntisymm α (swap r) :=
⟨fun _ _ h₁ h₂ => _root_.antisymm h₂ h₁⟩
#align is_antisymm.swap IsAntisymm.swap
theorem IsAsymm.swap (r) [IsAsymm α r] : IsAsymm α (swap r) :=
⟨fun _ _ h₁ h₂ => asymm_of r h₂ h₁⟩
#align is_asymm.swap IsAsymm.swap
theorem IsTotal.swap (r) [IsTotal α r] : IsTotal α (swap r) :=
⟨fun a b => (total_of r a b).symm⟩
#align is_total.swap IsTotal.swap
theorem IsTrichotomous.swap (r) [IsTrichotomous α r] : IsTrichotomous α (swap r) :=
⟨fun a b => by simpa [Function.swap, or_comm, or_left_comm] using trichotomous_of r a b⟩
#align is_trichotomous.swap IsTrichotomous.swap
theorem IsPreorder.swap (r) [IsPreorder α r] : IsPreorder α (swap r) :=
{ @IsRefl.swap α r _, @IsTrans.swap α r _ with }
#align is_preorder.swap IsPreorder.swap
theorem IsStrictOrder.swap (r) [IsStrictOrder α r] : IsStrictOrder α (swap r) :=
{ @IsIrrefl.swap α r _, @IsTrans.swap α r _ with }
#align is_strict_order.swap IsStrictOrder.swap
theorem IsPartialOrder.swap (r) [IsPartialOrder α r] : IsPartialOrder α (swap r) :=
{ @IsPreorder.swap α r _, @IsAntisymm.swap α r _ with }
#align is_partial_order.swap IsPartialOrder.swap
theorem IsTotalPreorder.swap (r) [IsTotalPreorder α r] : IsTotalPreorder α (swap r) :=
{ @IsPreorder.swap α r _, @IsTotal.swap α r _ with }
#align is_total_preorder.swap IsTotalPreorder.swap
theorem IsLinearOrder.swap (r) [IsLinearOrder α r] : IsLinearOrder α (swap r) :=
{ @IsPartialOrder.swap α r _, @IsTotal.swap α r _ with }
#align is_linear_order.swap IsLinearOrder.swap
protected theorem IsAsymm.isAntisymm (r) [IsAsymm α r] : IsAntisymm α r :=
⟨fun _ _ h₁ h₂ => (_root_.asymm h₁ h₂).elim⟩
#align is_asymm.is_antisymm IsAsymm.isAntisymm
protected theorem IsAsymm.isIrrefl [IsAsymm α r] : IsIrrefl α r :=
⟨fun _ h => _root_.asymm h h⟩
#align is_asymm.is_irrefl IsAsymm.isIrrefl
protected theorem IsTotal.isTrichotomous (r) [IsTotal α r] : IsTrichotomous α r :=
⟨fun a b => or_left_comm.1 (Or.inr <| total_of r a b)⟩
#align is_total.is_trichotomous IsTotal.isTrichotomous
-- see Note [lower instance priority]
instance (priority := 100) IsTotal.to_isRefl (r) [IsTotal α r] : IsRefl α r :=
⟨fun a => (or_self_iff _).1 <| total_of r a a⟩
theorem ne_of_irrefl {r} [IsIrrefl α r] : ∀ {x y : α}, r x y → x ≠ y
| _, _, h, rfl => irrefl _ h
#align ne_of_irrefl ne_of_irrefl
theorem ne_of_irrefl' {r} [IsIrrefl α r] : ∀ {x y : α}, r x y → y ≠ x
| _, _, h, rfl => irrefl _ h
#align ne_of_irrefl' ne_of_irrefl'
theorem not_rel_of_subsingleton (r) [IsIrrefl α r] [Subsingleton α] (x y) : ¬r x y :=
Subsingleton.elim x y ▸ irrefl x
#align not_rel_of_subsingleton not_rel_of_subsingleton
theorem rel_of_subsingleton (r) [IsRefl α r] [Subsingleton α] (x y) : r x y :=
Subsingleton.elim x y ▸ refl x
#align rel_of_subsingleton rel_of_subsingleton
@[simp]
theorem empty_relation_apply (a b : α) : EmptyRelation a b ↔ False :=
Iff.rfl
#align empty_relation_apply empty_relation_apply
theorem eq_empty_relation (r) [IsIrrefl α r] [Subsingleton α] : r = EmptyRelation :=
funext₂ <| by simpa using not_rel_of_subsingleton r
#align eq_empty_relation eq_empty_relation
instance : IsIrrefl α EmptyRelation :=
⟨fun _ => id⟩
theorem trans_trichotomous_left [IsTrans α r] [IsTrichotomous α r] {a b c : α} :
¬r b a → r b c → r a c := by
intro h₁ h₂
rcases trichotomous_of r a b with (h₃ | rfl | h₃)
exacts [_root_.trans h₃ h₂, h₂, absurd h₃ h₁]
#align trans_trichotomous_left trans_trichotomous_left
theorem trans_trichotomous_right [IsTrans α r] [IsTrichotomous α r] {a b c : α} :
r a b → ¬r c b → r a c := by
intro h₁ h₂
rcases trichotomous_of r b c with (h₃ | rfl | h₃)
exacts [_root_.trans h₁ h₃, h₁, absurd h₃ h₂]
#align trans_trichotomous_right trans_trichotomous_right
theorem transitive_of_trans (r : α → α → Prop) [IsTrans α r] : Transitive r := IsTrans.trans
#align transitive_of_trans transitive_of_trans
/-- In a trichotomous irreflexive order, every element is determined by the set of predecessors. -/
theorem extensional_of_trichotomous_of_irrefl (r : α → α → Prop) [IsTrichotomous α r] [IsIrrefl α r]
{a b : α} (H : ∀ x, r x a ↔ r x b) : a = b :=
((@trichotomous _ r _ a b).resolve_left <| mt (H _).2 <| irrefl a).resolve_right <| mt (H _).1
<| irrefl b
#align extensional_of_trichotomous_of_irrefl extensional_of_trichotomous_of_irrefl
/-- Construct a partial order from a `isStrictOrder` relation.
See note [reducible non-instances]. -/
@[reducible]
def partialOrderOfSO (r) [IsStrictOrder α r] : PartialOrder α where
le x y := x = y ∨ r x y
lt := r
le_refl x := Or.inl rfl
le_trans x y z h₁ h₂ :=
match y, z, h₁, h₂ with
| _, _, Or.inl rfl, h₂ => h₂
| _, _, h₁, Or.inl rfl => h₁
| _, _, Or.inr h₁, Or.inr h₂ => Or.inr (_root_.trans h₁ h₂)
le_antisymm x y h₁ h₂ :=
match y, h₁, h₂ with
| _, Or.inl rfl, _ => rfl
| _, _, Or.inl rfl => rfl
| _, Or.inr h₁, Or.inr h₂ => (asymm h₁ h₂).elim
lt_iff_le_not_le x y :=
⟨fun h => ⟨Or.inr h, not_or_of_not (fun e => by rw [e] at h; exact irrefl _ h) (asymm h)⟩,
fun ⟨h₁, h₂⟩ => h₁.resolve_left fun e => h₂ <| e ▸ Or.inl rfl⟩
set_option linter.uppercaseLean3 false in
#align partial_order_of_SO partialOrderOfSO
/-- Construct a linear order from an `IsStrictTotalOrder` relation.
See note [reducible non-instances]. -/
@[reducible]
def linearOrderOfSTO (r) [IsStrictTotalOrder α r] [∀ x y, Decidable ¬r x y] : LinearOrder α :=
let hD : DecidableRel (fun x y => x = y ∨ r x y) := fun x y =>
decidable_of_iff (¬r y x)
⟨fun h => ((trichotomous_of r y x).resolve_left h).imp Eq.symm id, fun h =>
h.elim (fun h => h ▸ irrefl_of _ _) (asymm_of r)⟩
{ partialOrderOfSO r with
le_total := fun x y =>
match y, trichotomous_of r x y with
| y, Or.inl h => Or.inl (Or.inr h)
| _, Or.inr (Or.inl rfl) => Or.inl (Or.inl rfl)
| _, Or.inr (Or.inr h) => Or.inr (Or.inr h),
toMin := minOfLe,
toMax := maxOfLe,
decidable_le := hD }
set_option linter.uppercaseLean3 false in
#align linear_order_of_STO linearOrderOfSTO
theorem IsStrictTotalOrder.swap (r) [IsStrictTotalOrder α r] : IsStrictTotalOrder α (swap r) :=
{ IsTrichotomous.swap r, IsStrictOrder.swap r with }
#align is_strict_total_order.swap IsStrictTotalOrder.swap
/-! ### Order connection -/
/-- A connected order is one satisfying the condition `a < c → a < b ∨ b < c`.
This is recognizable as an intuitionistic substitute for `a ≤ b ∨ b ≤ a` on
the constructive reals, and is also known as negative transitivity,
since the contrapositive asserts transitivity of the relation `¬ a < b`. -/
class IsOrderConnected (α : Type u) (lt : α → α → Prop) : Prop where
/-- A connected order is one satisfying the condition `a < c → a < b ∨ b < c`. -/
conn : ∀ a b c, lt a c → lt a b ∨ lt b c
#align is_order_connected IsOrderConnected
theorem IsOrderConnected.neg_trans {r : α → α → Prop} [IsOrderConnected α r] {a b c}
(h₁ : ¬r a b) (h₂ : ¬r b c) : ¬r a c :=
mt (IsOrderConnected.conn a b c) <| by simp [h₁, h₂]
#align is_order_connected.neg_trans IsOrderConnected.neg_trans
theorem isStrictWeakOrder_of_isOrderConnected [IsAsymm α r] [IsOrderConnected α r] :
IsStrictWeakOrder α r :=
{ @IsAsymm.isIrrefl α r _ with
trans := fun _ _ c h₁ h₂ => (IsOrderConnected.conn _ c _ h₁).resolve_right (asymm h₂),
incomp_trans := fun _ _ _ ⟨h₁, h₂⟩ ⟨h₃, h₄⟩ =>
⟨IsOrderConnected.neg_trans h₁ h₃, IsOrderConnected.neg_trans h₄ h₂⟩ }
#align is_strict_weak_order_of_is_order_connected isStrictWeakOrder_of_isOrderConnected
-- see Note [lower instance priority]
instance (priority := 100) isStrictOrderConnected_of_isStrictTotalOrder [IsStrictTotalOrder α r] :
IsOrderConnected α r :=
⟨λ _ _ _ h => (trichotomous _ _).imp_right
fun o => o.elim (fun e => e ▸ h) fun h' => _root_.trans h' h⟩
#align is_order_connected_of_is_strict_total_order isStrictOrderConnected_of_isStrictTotalOrder
-- see Note [lower instance priority]
instance (priority := 100) isStrictTotalOrder_of_isStrictTotalOrder [IsStrictTotalOrder α r] :
IsStrictWeakOrder α r :=
{ isStrictWeakOrder_of_isOrderConnected with }
#align is_strict_weak_order_of_is_strict_total_order isStrictTotalOrder_of_isStrictTotalOrder
/-! ### Well-order -/
/-- A well-founded relation. Not to be confused with `isWellOrder`. -/
@[mk_iff] class IsWellFounded (α : Type u) (r : α → α → Prop) : Prop where
/-- The relation is `WellFounded`, as a proposition. -/
wf : WellFounded r
#align is_well_founded IsWellFounded
#align is_well_founded_iff IsWellFounded_iff
#align has_well_founded WellFoundedRelation
set_option linter.uppercaseLean3 false in
#align has_well_founded.R WellFoundedRelation.rel
instance [h : WellFoundedRelation α] : IsWellFounded α WellFoundedRelation.rel :=
{ h with }
theorem WellFoundedRelation.asymmetric {α : Sort _} [WellFoundedRelation α] {a b : α} :
WellFoundedRelation.rel a b → ¬ WellFoundedRelation.rel b a :=
fun hab hba => WellFoundedRelation.asymmetric hba hab
termination_by _ => a
lemma WellFounded.prod_lex {ra : α → α → Prop} {rb : β → β → Prop} (ha : WellFounded ra)
(hb : WellFounded rb) : WellFounded (Prod.Lex ra rb) :=
(Prod.lex ⟨_, ha⟩ ⟨_, hb⟩).wf
#align prod.lex_wf WellFounded.prod_lex
namespace IsWellFounded
variable (r) [IsWellFounded α r]
/-- Induction on a well-founded relation. -/
theorem induction {C : α → Prop} : ∀ a, (∀ x, (∀ y, r y x → C y) → C x) → C a :=
wf.induction
#align is_well_founded.induction IsWellFounded.induction
/-- All values are accessible under the well-founded relation. -/
theorem apply : ∀ a, Acc r a :=
wf.apply
#align is_well_founded.apply IsWellFounded.apply
-- Porting note: WellFounded.fix is noncomputable, at 2022-10-29 lean
/-- Creates data, given a way to generate a value from all that compare as less under a well-founded
relation. See also `IsWellFounded.fix_eq`. -/
noncomputable
def fix {C : α → Sort _} : (∀ x : α, (∀ y : α, r y x → C y) → C x) → ∀ x : α, C x :=
wf.fix
#align is_well_founded.fix IsWellFounded.fix
/-- The value from `IsWellFounded.fix` is built from the previous ones as specified. -/
theorem fix_eq {C : α → Sort _} (F : ∀ x : α, (∀ y : α, r y x → C y) → C x) :
∀ x, fix r F x = F x fun y _ => fix r F y :=
wf.fix_eq F
#align is_well_founded.fix_eq IsWellFounded.fix_eq
/-- Derive a `WellFoundedRelation` instance from an `isWellFounded` instance. -/
def toWellFoundedRelation : WellFoundedRelation α :=
⟨r, IsWellFounded.wf⟩
end IsWellFounded
theorem WellFounded.asymmetric {α : Sort _} {r : α → α → Prop} (h : WellFounded r) (a b) :
r a b → ¬r b a :=
@WellFoundedRelation.asymmetric _ ⟨_, h⟩ _ _
#align well_founded.asymmetric WellFounded.asymmetric
-- see Note [lower instance priority]
instance (priority := 100) (r : α → α → Prop) [IsWellFounded α r] : IsAsymm α r :=
⟨IsWellFounded.wf.asymmetric⟩
-- see Note [lower instance priority]
instance (priority := 100) (r : α → α → Prop) [IsWellFounded α r] : IsIrrefl α r :=
IsAsymm.isIrrefl
/-- A class for a well founded relation `<`. -/
@[reducible]
def WellFoundedLT (α : Type _) [LT α] : Prop :=
IsWellFounded α (· < ·)
#align well_founded_lt WellFoundedLT
/-- A class for a well founded relation `>`. -/
@[reducible]
def WellFoundedGT (α : Type _) [LT α] : Prop :=
IsWellFounded α (· > ·)
#align well_founded_gt WellFoundedGT
-- See note [lower instance priority]
instance (priority := 100) (α : Type _) [LT α] [h : WellFoundedLT α] : WellFoundedGT αᵒᵈ :=
h
-- See note [lower instance priority]
instance (priority := 100) (α : Type _) [LT α] [h : WellFoundedGT α] : WellFoundedLT αᵒᵈ :=
h
theorem wellFoundedGT_dual_iff (α : Type _) [LT α] : WellFoundedGT αᵒᵈ ↔ WellFoundedLT α :=
⟨fun h => ⟨h.wf⟩, fun h => ⟨h.wf⟩⟩
#align well_founded_gt_dual_iff wellFoundedGT_dual_iff
theorem wellFoundedLT_dual_iff (α : Type _) [LT α] : WellFoundedLT αᵒᵈ ↔ WellFoundedGT α :=
⟨fun h => ⟨h.wf⟩, fun h => ⟨h.wf⟩⟩
#align well_founded_lt_dual_iff wellFoundedLT_dual_iff
/-- A well order is a well-founded linear order. -/
class IsWellOrder (α : Type u) (r : α → α → Prop) extends
IsTrichotomous α r, IsTrans α r, IsWellFounded α r : Prop
#align is_well_order IsWellOrder
-- see Note [lower instance priority]
instance (priority := 100) {α} (r : α → α → Prop) [IsWellOrder α r] :
IsStrictTotalOrder α r where
-- see Note [lower instance priority]
instance (priority := 100) {α} (r : α → α → Prop) [IsWellOrder α r] : IsTrichotomous α r :=
by infer_instance
-- see Note [lower instance priority]
instance (priority := 100) {α} (r : α → α → Prop) [IsWellOrder α r] : IsTrans α r := by
infer_instance
-- see Note [lower instance priority]
instance (priority := 100) {α} (r : α → α → Prop) [IsWellOrder α r] : IsIrrefl α r := by
infer_instance
-- see Note [lower instance priority]
instance (priority := 100) {α} (r : α → α → Prop) [IsWellOrder α r] : IsAsymm α r := by
infer_instance
namespace WellFoundedLT
variable [LT α] [WellFoundedLT α]
/-- Inducts on a well-founded `<` relation. -/
theorem induction {C : α → Prop} : ∀ a, (∀ x, (∀ y, y < x → C y) → C x) → C a :=
IsWellFounded.induction _
#align well_founded_lt.induction WellFoundedLT.induction
/-- All values are accessible under the well-founded `<`. -/
theorem apply : ∀ a : α, Acc (· < ·) a :=
IsWellFounded.apply _
#align well_founded_lt.apply WellFoundedLT.apply
-- Porting note: WellFounded.fix is noncomputable, at 2022-10-29 lean
/-- Creates data, given a way to generate a value from all that compare as lesser. See also
`WellFoundedLT.fix_eq`. -/
noncomputable
def fix {C : α → Sort _} : (∀ x : α, (∀ y : α, y < x → C y) → C x) → ∀ x : α, C x :=
IsWellFounded.fix (· < ·)
#align well_founded_lt.fix WellFoundedLT.fix
/-- The value from `WellFoundedLT.fix` is built from the previous ones as specified. -/
theorem fix_eq {C : α → Sort _} (F : ∀ x : α, (∀ y : α, y < x → C y) → C x) :
∀ x, fix F x = F x fun y _ => fix F y :=
IsWellFounded.fix_eq _ F
#align well_founded_lt.fix_eq WellFoundedLT.fix_eq
/-- Derive a `WellFoundedRelation` instance from a `WellFoundedLT` instance. -/
def toWellFoundedRelation : WellFoundedRelation α :=
IsWellFounded.toWellFoundedRelation (· < ·)
end WellFoundedLT
namespace WellFoundedGT
variable [LT α] [WellFoundedGT α]
/-- Inducts on a well-founded `>` relation. -/
theorem induction {C : α → Prop} : ∀ a, (∀ x, (∀ y, x < y → C y) → C x) → C a :=
IsWellFounded.induction _
#align well_founded_gt.induction WellFoundedGT.induction
/-- All values are accessible under the well-founded `>`. -/
theorem apply : ∀ a : α, Acc (· > ·) a :=
IsWellFounded.apply _
#align well_founded_gt.apply WellFoundedGT.apply
-- Porting note: WellFounded.fix is noncomputable, at 2022-10-29 lean
/-- Creates data, given a way to generate a value from all that compare as greater. See also
`WellFoundedGT.fix_eq`. -/
noncomputable
def fix {C : α → Sort _} : (∀ x : α, (∀ y : α, x < y → C y) → C x) → ∀ x : α, C x :=
IsWellFounded.fix (· > ·)
#align well_founded_gt.fix WellFoundedGT.fix
/-- The value from `WellFoundedGT.fix` is built from the successive ones as specified. -/
theorem fix_eq {C : α → Sort _} (F : ∀ x : α, (∀ y : α, x < y → C y) → C x) :
∀ x, fix F x = F x fun y _ => fix F y :=
IsWellFounded.fix_eq _ F
#align well_founded_gt.fix_eq WellFoundedGT.fix_eq
/-- Derive a `WellFoundedRelation` instance from a `WellFoundedGT` instance. -/
def toWellFoundedRelation : WellFoundedRelation α :=
IsWellFounded.toWellFoundedRelation (· > ·)
end WellFoundedGT
/-- Construct a decidable linear order from a well-founded linear order. -/
noncomputable def IsWellOrder.linearOrder (r : α → α → Prop) [IsWellOrder α r] : LinearOrder α :=
letI := fun x y => Classical.dec ¬r x y
linearOrderOfSTO r
#align is_well_order.linear_order IsWellOrder.linearOrder
/-- Derive a `WellFoundedRelation` instance from a `IsWellOrder` instance. -/
def IsWellOrder.toHasWellFounded [LT α] [hwo : IsWellOrder α (· < ·)] : WellFoundedRelation α where
rel := (· < ·)
wf := hwo.wf
#align is_well_order.to_has_well_founded IsWellOrder.toHasWellFounded
-- This isn't made into an instance as it loops with `IsIrrefl α r`.
theorem Subsingleton.isWellOrder [Subsingleton α] (r : α → α → Prop) [hr : IsIrrefl α r] :
IsWellOrder α r :=
{ hr with
trichotomous := fun a b => Or.inr <| Or.inl <| Subsingleton.elim a b,
trans := fun a b _ h => (not_rel_of_subsingleton r a b h).elim,
wf := ⟨fun a => ⟨_, fun y h => (not_rel_of_subsingleton r y a h).elim⟩⟩ }
#align subsingleton.is_well_order Subsingleton.isWellOrder
instance [Subsingleton α] : IsWellOrder α EmptyRelation :=
Subsingleton.isWellOrder _
instance (priority := 100) [IsEmpty α] (r : α → α → Prop) : IsWellOrder α r where
trichotomous := isEmptyElim
trans := isEmptyElim
wf := wellFounded_of_isEmpty r
instance [IsWellFounded α r] [IsWellFounded β s] : IsWellFounded (α × β) (Prod.Lex r s) :=
⟨IsWellFounded.wf.prod_lex IsWellFounded.wf⟩
instance [IsWellOrder α r] [IsWellOrder β s] : IsWellOrder (α × β) (Prod.Lex r s) where
trichotomous := fun ⟨a₁, a₂⟩ ⟨b₁, b₂⟩ =>
match @trichotomous _ r _ a₁ b₁ with
| Or.inl h₁ => Or.inl <| Prod.Lex.left _ _ h₁
| Or.inr (Or.inr h₁) => Or.inr <| Or.inr <| Prod.Lex.left _ _ h₁
| Or.inr (Or.inl (.refl _)) =>
match @trichotomous _ s _ a₂ b₂ with
| Or.inl h => Or.inl <| Prod.Lex.right _ h
| Or.inr (Or.inr h) => Or.inr <| Or.inr <| Prod.Lex.right _ h
| Or.inr (Or.inl (.refl _)) => Or.inr <| Or.inl rfl
trans a b c h₁ h₂ := by
cases' h₁ with a₁ a₂ b₁ b₂ ab a₁ b₁ b₂ ab <;> cases' h₂ with _ _ c₁ c₂ bc _ _ c₂ bc
exacts [.left _ _ (_root_.trans ab bc), .left _ _ ab, .left _ _ bc,
.right _ (_root_.trans ab bc)]
instance (r : α → α → Prop) [IsWellFounded α r] (f : β → α) : IsWellFounded _ (InvImage r f) :=
⟨InvImage.wf f IsWellFounded.wf⟩
instance (f : α → ℕ) : IsWellFounded _ (Measure f) :=
⟨(measure f).wf⟩
theorem Subrelation.isWellFounded (r : α → α → Prop) [IsWellFounded α r] {s : α → α → Prop}
(h : Subrelation s r) : IsWellFounded α s :=
⟨h.wf IsWellFounded.wf⟩
#align subrelation.is_well_founded Subrelation.isWellFounded
namespace Set
/-- An unbounded or cofinal set. -/
def Unbounded (r : α → α → Prop) (s : Set α) : Prop :=
∀ a, ∃ b ∈ s, ¬r b a
#align set.unbounded Set.Unbounded
/-- A bounded or final set. Not to be confused with `Metric.bounded`. -/
def Bounded (r : α → α → Prop) (s : Set α) : Prop :=
∃ a, ∀ b ∈ s, r b a
#align set.bounded Set.Bounded
@[simp]
theorem not_bounded_iff {r : α → α → Prop} (s : Set α) : ¬Bounded r s ↔ Unbounded r s := by
simp only [Bounded, Unbounded, not_forall, not_exists, exists_prop, not_and, not_not]
#align set.not_bounded_iff Set.not_bounded_iff
@[simp]
theorem not_unbounded_iff {r : α → α → Prop} (s : Set α) : ¬Unbounded r s ↔ Bounded r s := by
rw [not_iff_comm, not_bounded_iff]
#align set.not_unbounded_iff Set.not_unbounded_iff
theorem unbounded_of_isEmpty [IsEmpty α] {r : α → α → Prop} (s : Set α) : Unbounded r s :=
isEmptyElim
#align set.unbounded_of_is_empty Set.unbounded_of_isEmpty
end Set
namespace Prod
instance isRefl_preimage_fst {r : α → α → Prop} [IsRefl α r] : IsRefl (α × α) (Prod.fst ⁻¹'o r) :=
⟨fun a => refl_of r a.1⟩
instance isRefl_preimage_snd {r : α → α → Prop} [IsRefl α r] : IsRefl (α × α) (Prod.snd ⁻¹'o r) :=
⟨fun a => refl_of r a.2⟩
instance isTrans_preimage_fst {r : α → α → Prop} [IsTrans α r] :
IsTrans (α × α) (Prod.fst ⁻¹'o r) :=
⟨fun _ _ _ => trans_of r⟩
instance isTrans_preimage_snd {r : α → α → Prop} [IsTrans α r] :
IsTrans (α × α) (Prod.snd ⁻¹'o r) :=
⟨fun _ _ _ => trans_of r⟩
end Prod
/-! ### Strict-non strict relations -/
/-- An unbundled relation class stating that `r` is the nonstrict relation corresponding to the
strict relation `s`. Compare `Preorder.lt_iff_le_not_le`. This is mostly meant to provide dot
notation on `(⊆)` and `(⊂)`. -/
class IsNonstrictStrictOrder (α : Type _) (r s : α → α → Prop) where
/-- The relation `r` is the nonstrict relation corresponding to the strict relation `s`. -/
right_iff_left_not_left (a b : α) : s a b ↔ r a b ∧ ¬r b a
#align is_nonstrict_strict_order IsNonstrictStrictOrder
theorem right_iff_left_not_left {r s : α → α → Prop} [IsNonstrictStrictOrder α r s] {a b : α} :
s a b ↔ r a b ∧ ¬r b a :=
IsNonstrictStrictOrder.right_iff_left_not_left _ _
#align right_iff_left_not_left right_iff_left_not_left
/-- A version of `right_iff_left_not_left` with explicit `r` and `s`. -/
theorem right_iff_left_not_left_of (r s : α → α → Prop) [IsNonstrictStrictOrder α r s] {a b : α} :
s a b ↔ r a b ∧ ¬r b a :=
right_iff_left_not_left
#align right_iff_left_not_left_of right_iff_left_not_left_of
-- The free parameter `r` is strictly speaking not uniquely determined by `s`, but in practice it
-- always has a unique instance, so this is not dangerous.
@[nolint dangerousInstance]
instance {s : α → α → Prop} [IsNonstrictStrictOrder α r s] : IsIrrefl α s :=
⟨fun _ h => ((right_iff_left_not_left_of r s).1 h).2 ((right_iff_left_not_left_of r s).1 h).1⟩
/-! #### `⊆` and `⊂` -/
section Subset
variable [HasSubset α] {a b c : α}
lemma subset_of_eq_of_subset (hab : a = b) (hbc : b ⊆ c) : a ⊆ c := by rwa [hab]
#align subset_of_eq_of_subset subset_of_eq_of_subset
lemma subset_of_subset_of_eq (hab : a ⊆ b) (hbc : b = c) : a ⊆ c := by rwa [←hbc]
#align subset_of_subset_of_eq subset_of_subset_of_eq
@[refl]
lemma subset_refl [IsRefl α (· ⊆ ·)] (a : α) : a ⊆ a := refl _
#align subset_refl subset_refl
lemma subset_rfl [IsRefl α (· ⊆ ·)] : a ⊆ a := refl _
#align subset_rfl subset_rfl
lemma subset_of_eq [IsRefl α (· ⊆ ·)] : a = b → a ⊆ b := fun h => h ▸ subset_rfl
#align subset_of_eq subset_of_eq
lemma superset_of_eq [IsRefl α (· ⊆ ·)] : a = b → b ⊆ a := fun h => h ▸ subset_rfl
#align superset_of_eq superset_of_eq
lemma ne_of_not_subset [IsRefl α (· ⊆ ·)] : ¬a ⊆ b → a ≠ b := mt subset_of_eq
#align ne_of_not_subset ne_of_not_subset
lemma ne_of_not_superset [IsRefl α (· ⊆ ·)] : ¬a ⊆ b → b ≠ a := mt superset_of_eq
#align ne_of_not_superset ne_of_not_superset
@[trans]
lemma subset_trans [IsTrans α (· ⊆ ·)] {a b c : α} : a ⊆ b → b ⊆ c → a ⊆ c := _root_.trans
#align subset_trans subset_trans
lemma subset_antisymm [IsAntisymm α (· ⊆ ·)] : a ⊆ b → b ⊆ a → a = b := antisymm
#align subset_antisymm subset_antisymm
lemma superset_antisymm [IsAntisymm α (· ⊆ ·)] : a ⊆ b → b ⊆ a → b = a := antisymm'
#align superset_antisymm superset_antisymm
alias subset_of_eq_of_subset ← Eq.trans_subset
#align eq.trans_subset Eq.trans_subset
alias subset_of_subset_of_eq ← HasSubset.subset.trans_eq
#align has_subset.subset.trans_eq HasSubset.subset.trans_eq
alias subset_of_eq ← Eq.subset' --TODO: Fix it and kill `Eq.subset`
#align eq.subset' Eq.subset'
alias superset_of_eq ← Eq.superset
#align eq.superset Eq.superset
alias subset_trans ← HasSubset.Subset.trans
#align has_subset.subset.trans HasSubset.Subset.trans
alias subset_antisymm ← HasSubset.Subset.antisymm
#align has_subset.subset.antisymm HasSubset.Subset.antisymm
alias superset_antisymm ← HasSubset.Subset.antisymm'
#align has_subset.subset.antisymm' HasSubset.Subset.antisymm'
theorem subset_antisymm_iff [IsRefl α (· ⊆ ·)] [IsAntisymm α (· ⊆ ·)] : a = b ↔ a ⊆ b ∧ b ⊆ a :=
⟨fun h => ⟨h.subset', h.superset⟩, fun h => h.1.antisymm h.2⟩
#align subset_antisymm_iff subset_antisymm_iff
theorem superset_antisymm_iff [IsRefl α (· ⊆ ·)] [IsAntisymm α (· ⊆ ·)] : a = b ↔ b ⊆ a ∧ a ⊆ b :=
⟨fun h => ⟨h.superset, h.subset'⟩, fun h => h.1.antisymm' h.2⟩
#align superset_antisymm_iff superset_antisymm_iff
end Subset
section Ssubset
variable [HasSSubset α] {a b c : α}
lemma ssubset_of_eq_of_ssubset (hab : a = b) (hbc : b ⊂ c) : a ⊂ c := by rwa [hab]
#align ssubset_of_eq_of_ssubset ssubset_of_eq_of_ssubset
lemma ssubset_of_ssubset_of_eq (hab : a ⊂ b) (hbc : b = c) : a ⊂ c := by rwa [←hbc]
#align ssubset_of_ssubset_of_eq ssubset_of_ssubset_of_eq
lemma ssubset_irrefl [IsIrrefl α (· ⊂ ·)] (a : α) : ¬a ⊂ a := irrefl _
#align ssubset_irrefl ssubset_irrefl
lemma ssubset_irrfl [IsIrrefl α (· ⊂ ·)] {a : α} : ¬a ⊂ a := irrefl _
#align ssubset_irrfl ssubset_irrfl
lemma ne_of_ssubset [IsIrrefl α (· ⊂ ·)] {a b : α} : a ⊂ b → a ≠ b := ne_of_irrefl
#align ne_of_ssubset ne_of_ssubset
lemma ne_of_ssuperset [IsIrrefl α (· ⊂ ·)] {a b : α} : a ⊂ b → b ≠ a := ne_of_irrefl'
#align ne_of_ssuperset ne_of_ssuperset
@[trans]
lemma ssubset_trans [IsTrans α (· ⊂ ·)] {a b c : α} : a ⊂ b → b ⊂ c → a ⊂ c := _root_.trans
#align ssubset_trans ssubset_trans
lemma ssubset_asymm [IsAsymm α (· ⊂ ·)] {a b : α} : a ⊂ b → ¬b ⊂ a := asymm
#align ssubset_asymm ssubset_asymm
alias ssubset_of_eq_of_ssubset ← Eq.trans_ssubset
#align eq.trans_ssubset Eq.trans_ssubset
alias ssubset_of_ssubset_of_eq ← HasSSubset.SSubset.trans_eq
#align has_ssubset.ssubset.trans_eq HasSSubset.SSubset.trans_eq
alias ssubset_irrfl ← HasSSubset.SSubset.false
#align has_ssubset.ssubset.false HasSSubset.SSubset.false
alias ne_of_ssubset ← HasSSubset.SSubset.ne
#align has_ssubset.ssubset.ne HasSSubset.SSubset.ne
alias ne_of_ssuperset ← HasSSubset.SSubset.ne'
#align has_ssubset.ssubset.ne' HasSSubset.SSubset.ne'
alias ssubset_trans ← HasSSubset.SSubset.trans
#align has_ssubset.ssubset.trans HasSSubset.SSubset.trans
alias ssubset_asymm ← HasSSubset.SSubset.asymm
#align has_ssubset.ssubset.asymm HasSSubset.SSubset.asymm
end Ssubset
section SubsetSsubset
variable [HasSubset α] [HasSSubset α] [IsNonstrictStrictOrder α (· ⊆ ·) (· ⊂ ·)] {a b c : α}
theorem ssubset_iff_subset_not_subset : a ⊂ b ↔ a ⊆ b ∧ ¬b ⊆ a :=
right_iff_left_not_left
#align ssubset_iff_subset_not_subset ssubset_iff_subset_not_subset
theorem subset_of_ssubset (h : a ⊂ b) : a ⊆ b :=
(ssubset_iff_subset_not_subset.1 h).1
#align subset_of_ssubset subset_of_ssubset
theorem not_subset_of_ssubset (h : a ⊂ b) : ¬b ⊆ a :=
(ssubset_iff_subset_not_subset.1 h).2
#align not_subset_of_ssubset not_subset_of_ssubset
theorem not_ssubset_of_subset (h : a ⊆ b) : ¬b ⊂ a := fun h' => not_subset_of_ssubset h' h
#align not_ssubset_of_subset not_ssubset_of_subset
theorem ssubset_of_subset_not_subset (h₁ : a ⊆ b) (h₂ : ¬b ⊆ a) : a ⊂ b :=
ssubset_iff_subset_not_subset.2 ⟨h₁, h₂⟩
#align ssubset_of_subset_not_subset ssubset_of_subset_not_subset
alias subset_of_ssubset ← HasSSubset.SSubset.subset
#align has_ssubset.ssubset.subset HasSSubset.SSubset.subset
alias not_subset_of_ssubset ← HasSSubset.SSubset.not_subset
#align has_ssubset.ssubset.not_subset HasSSubset.SSubset.not_subset
alias not_ssubset_of_subset ← HasSubset.Subset.not_ssubset
#align has_subset.subset.not_ssubset HasSubset.Subset.not_ssubset
alias ssubset_of_subset_not_subset ← HasSubset.Subset.ssubset_of_not_subset
#align has_subset.subset.ssubset_of_not_subset HasSubset.Subset.ssubset_of_not_subset
theorem ssubset_of_subset_of_ssubset [IsTrans α (· ⊆ ·)] (h₁ : a ⊆ b) (h₂ : b ⊂ c) : a ⊂ c :=
(h₁.trans h₂.subset).ssubset_of_not_subset fun h => h₂.not_subset <| h.trans h₁
#align ssubset_of_subset_of_ssubset ssubset_of_subset_of_ssubset
theorem ssubset_of_ssubset_of_subset [IsTrans α (· ⊆ ·)] (h₁ : a ⊂ b) (h₂ : b ⊆ c) : a ⊂ c :=
(h₁.subset.trans h₂).ssubset_of_not_subset fun h => h₁.not_subset <| h₂.trans h
#align ssubset_of_ssubset_of_subset ssubset_of_ssubset_of_subset
theorem ssubset_of_subset_of_ne [IsAntisymm α (· ⊆ ·)] (h₁ : a ⊆ b) (h₂ : a ≠ b) : a ⊂ b :=
h₁.ssubset_of_not_subset <| mt h₁.antisymm h₂
#align ssubset_of_subset_of_ne ssubset_of_subset_of_ne
theorem ssubset_of_ne_of_subset [IsAntisymm α (· ⊆ ·)] (h₁ : a ≠ b) (h₂ : a ⊆ b) : a ⊂ b :=
ssubset_of_subset_of_ne h₂ h₁
#align ssubset_of_ne_of_subset ssubset_of_ne_of_subset
theorem eq_or_ssubset_of_subset [IsAntisymm α (· ⊆ ·)] (h : a ⊆ b) : a = b ∨ a ⊂ b :=
(em (b ⊆ a)).imp h.antisymm h.ssubset_of_not_subset
#align eq_or_ssubset_of_subset eq_or_ssubset_of_subset
theorem ssubset_or_eq_of_subset [IsAntisymm α (· ⊆ ·)] (h : a ⊆ b) : a ⊂ b ∨ a = b :=
(eq_or_ssubset_of_subset h).symm
#align ssubset_or_eq_of_subset ssubset_or_eq_of_subset
alias ssubset_of_subset_of_ssubset ← HasSubset.Subset.trans_ssubset
#align has_subset.subset.trans_ssubset HasSubset.Subset.trans_ssubset
alias ssubset_of_ssubset_of_subset ← HasSSubset.SSubset.trans_subset
#align has_ssubset.ssubset.trans_subset HasSSubset.SSubset.trans_subset
alias ssubset_of_subset_of_ne ← HasSubset.Subset.ssubset_of_ne
#align has_subset.subset.ssubset_of_ne HasSubset.Subset.ssubset_of_ne
alias ssubset_of_ne_of_subset ← Ne.ssubset_of_subset
#align ne.ssubset_of_subset Ne.ssubset_of_subset
alias eq_or_ssubset_of_subset ← HasSubset.Subset.eq_or_ssubset
#align has_subset.subset.eq_or_ssubset HasSubset.Subset.eq_or_ssubset
alias ssubset_or_eq_of_subset ← HasSubset.Subset.ssubset_or_eq
#align has_subset.subset.ssubset_or_eq HasSubset.Subset.ssubset_or_eq
theorem ssubset_iff_subset_ne [IsAntisymm α (· ⊆ ·)] : a ⊂ b ↔ a ⊆ b ∧ a ≠ b :=
⟨fun h => ⟨h.subset, h.ne⟩, fun h => h.1.ssubset_of_ne h.2⟩
#align ssubset_iff_subset_ne ssubset_iff_subset_ne
theorem subset_iff_ssubset_or_eq [IsRefl α (· ⊆ ·)] [IsAntisymm α (· ⊆ ·)] :
a ⊆ b ↔ a ⊂ b ∨ a = b :=
⟨fun h => h.ssubset_or_eq, fun h => h.elim subset_of_ssubset subset_of_eq⟩
#align subset_iff_ssubset_or_eq subset_iff_ssubset_or_eq
end SubsetSsubset
/-! ### Conversion of bundled order typeclasses to unbundled relation typeclasses -/
instance [Preorder α] : IsRefl α (· ≤ ·) :=
⟨le_refl⟩
instance [Preorder α] : IsRefl α (· ≥ ·) :=
IsRefl.swap _
instance [Preorder α] : IsTrans α (· ≤ ·) :=
⟨@le_trans _ _⟩
instance [Preorder α] : IsTrans α (· ≥ ·) :=
IsTrans.swap _
instance [Preorder α] : IsPreorder α (· ≤ ·) where
instance [Preorder α] : IsPreorder α (· ≥ ·) where
instance [Preorder α] : IsIrrefl α (· < ·) :=
⟨lt_irrefl⟩
instance [Preorder α] : IsIrrefl α (· > ·) :=
IsIrrefl.swap _
instance [Preorder α] : IsTrans α (· < ·) :=
⟨@lt_trans _ _⟩
instance [Preorder α] : IsTrans α (· > ·) :=
IsTrans.swap _
instance [Preorder α] : IsAsymm α (· < ·) :=
⟨@lt_asymm _ _⟩
instance [Preorder α] : IsAsymm α (· > ·) :=
IsAsymm.swap _
instance [Preorder α] : IsAntisymm α (· < ·) :=
IsAsymm.isAntisymm _
instance [Preorder α] : IsAntisymm α (· > ·) :=
IsAsymm.isAntisymm _
instance [Preorder α] : IsStrictOrder α (· < ·) where
instance [Preorder α] : IsStrictOrder α (· > ·) where
instance [Preorder α] : IsNonstrictStrictOrder α (· ≤ ·) (· < ·) :=
⟨@lt_iff_le_not_le _ _⟩
instance [PartialOrder α] : IsAntisymm α (· ≤ ·) :=
⟨@le_antisymm _ _⟩
instance [PartialOrder α] : IsAntisymm α (· ≥ ·) :=
IsAntisymm.swap _
instance [PartialOrder α] : IsPartialOrder α (· ≤ ·) where
instance [PartialOrder α] : IsPartialOrder α (· ≥ ·) where
instance [LinearOrder α] : IsTotal α (· ≤ ·) :=
⟨le_total⟩
instance [LinearOrder α] : IsTotal α (· ≥ ·) :=
IsTotal.swap _
-- Porting note: this was `by infer_instance` before
instance [LinearOrder α] : IsTotalPreorder α (· ≤ ·) where
instance [LinearOrder α] : IsTotalPreorder α (· ≥ ·) where
instance [LinearOrder α] : IsLinearOrder α (· ≤ ·) where
instance [LinearOrder α] : IsLinearOrder α (· ≥ ·) where
instance [LinearOrder α] : IsTrichotomous α (· < ·) :=
⟨lt_trichotomy⟩
instance [LinearOrder α] : IsTrichotomous α (· > ·) :=
IsTrichotomous.swap _
instance [LinearOrder α] : IsTrichotomous α (· ≤ ·) :=
IsTotal.isTrichotomous _
instance [LinearOrder α] : IsTrichotomous α (· ≥ ·) :=
IsTotal.isTrichotomous _
instance [LinearOrder α] : IsStrictTotalOrder α (· < ·) where
instance [LinearOrder α] : IsOrderConnected α (· < ·) := by infer_instance
instance [LinearOrder α] : IsIncompTrans α (· < ·) := by infer_instance
instance [LinearOrder α] : IsStrictWeakOrder α (· < ·) := by infer_instance
theorem transitive_le [Preorder α] : Transitive (@LE.le α _) :=
transitive_of_trans _
#align transitive_le transitive_le
theorem transitive_lt [Preorder α] : Transitive (@LT.lt α _) :=
transitive_of_trans _
#align transitive_lt transitive_lt
theorem transitive_ge [Preorder α] : Transitive (@GE.ge α _) :=
transitive_of_trans _
#align transitive_ge transitive_ge
theorem transitive_gt [Preorder α] : Transitive (@GT.gt α _) :=
transitive_of_trans _
#align transitive_gt transitive_gt
instance OrderDual.isTotal_le [LE α] [h : IsTotal α (· ≤ ·)] : IsTotal αᵒᵈ (· ≤ ·) :=
@IsTotal.swap α _ h
instance : WellFoundedLT ℕ :=
⟨Nat.lt_wfRel.wf⟩
#align nat.lt_wf Nat.lt_wfRel
instance Nat.lt.isWellOrder : IsWellOrder ℕ (· < ·) where
#align nat.lt.is_well_order Nat.lt.isWellOrder
instance [LinearOrder α] [h : IsWellOrder α (· < ·)] : IsWellOrder αᵒᵈ (· > ·) := h
instance [LinearOrder α] [h : IsWellOrder α (· > ·)] : IsWellOrder αᵒᵈ (· < ·) := h
|
State Before: C : Type u₁
inst✝² : Category C
D : Type u₂
inst✝¹ : Category D
E : Type u₃
inst✝ : Category E
e : C ≌ D
X Y : C
f f' : X ⟶ Y
⊢ f ≫ (unit e).app Y = f' ≫ (unit e).app Y ↔ f = f' State After: no goals Tactic: simp only [cancel_mono] |
# Variational Methods
The variational method is an approximate method used in quantum mechanics. Compared to perturbation theory, the variational method can be more robust in situations where it is hard to determine a good unperturbed Hamiltonian (i.e., one which makes the perturbation small but is still solvable). On the other hand, in cases where there is a good unperturbed Hamiltonian, perturbation theory can be more efficient than the variational method.
The basic idea of the variational method is to guess a "trial" wavefunction for the problem, which consists of some adjustable parameters called "variational parameters". These parameters are adjusted until the energy of the trial wavefunction is minimized. The resulting trial wavefunction and its corresponding energy are variational method approximations to the exact wavefunction and energy.
Why would it make sense that the best approximate trial wavefunction is the one with the lowest energy? This results from the Variational Theorem, which states that the energy of any trial wavefunction $E$ is always an upper bound to the exact ground state energy $E_0$. This can be proven easily. Let the trial wavefunction be denoted $\phi$. Any trial function can formally be expanded as a linear combination of the exact eigenfunctions $\psi_i$. Of course, in practice, we do not know the $\psi_i$, since we are assuming that we are applying the variational method to a problem we can not solve analytically. Nevertheless, that does not prevent us from using the exact eigenfunctions in our proof, since they certainly exist and form a complete set, even if we do not happen to know them:
\begin{equation}
\sum_{i,j}\langle\psi_{i}|\psi_{j}\rangle=\delta_{i,j}
\end{equation}
where $\delta_{i,j}$ is the Kronecker delta.
\begin{equation}
H \left|\psi_i\right\rangle = E_i\left|\psi_i \right\rangle .
\end{equation}
We are asuming that the physical states are normalized, * i.e. * their norm is equal to unity (we can always make it to do so).
Let us assume that we have a candidate wavefunction to describe the ground-state, that we call $|\phi\rangle$, and that this function deppends on a set of parameters ${c_i}$, that are complex numbers.
Ignoring complications involved with a continuous spectrum of H, suppose that the spectrum is bounded from below and that its greatest lower bound is $E_0$.
So, the approximate energy corresponding to this wavefunction is
the expectation value of $H$:
\begin{eqnarray}
\left\langle\phi|H|\phi\right\rangle & = & \sum_{i,j} \left\langle\phi|\psi_{i}\right\rangle \left\langle\psi_{i}|H|\psi_{j}\right\rangle \left\langle\psi_{j}|\phi\right\rangle \\
& = & \sum_{i} E_i \left|\left\langle\psi_i|\phi\right\rangle\right|^2\ge\sum_{i}E_0 \left|\left\langle\psi_i|\phi\right\rangle\right|^2=E_0
\end{eqnarray}
In other words, the energy of any approximate wavefunction is always greater than or equal to the exact ground state energy ${E}_0$. This explains the strategy of the variational method: since the energy of any approximate trial function is always above the true energy, then any variations in the trial function which lower its energy are necessarily making the approximate energy closer to the exact answer. (The trial wavefunction is also a better approximation to the true ground state wavefunction as the energy is lowered, although not necessarily in every possible sense unless the limit $\phi = \psi_0$ is reached).
Frequently, the trial function is written as a linear combination of basis functions, such as
$$ |\phi\rangle = \sum_i c_i |\phi_i\rangle. $$
This leads to the linear variation method, and the variational parameters are the expansion coefficients $c_i$.
We shall assume that the possible solutions are restricted to a subspace of the Hilbert space, and we shall seek the best possible solution in this subspace.
The energy for this approximate wavefunction is just
\begin{equation} E[\phi] = \frac{\sum_{ij} c_i^* c_j \langle\phi_i |H| \phi_j\rangle}{ \sum_{ij} c_i^* c_j \langle\phi_i|\phi_j\rangle},
\label{evar}
\end{equation}
which can be simplified using the notation
$H_{ij} = \langle \psi_i|H|\psi_j\rangle = \int \phi_i^* {H} \phi_j,$
$S_{ij} = \langle \psi_i|H|\psi_j\rangle = \int \phi_i^* \phi_j,$
to yield
$$ E[\phi] = \frac{\sum_{ij} c_i^* c_j H_{ij}}{\sum_{ij} c_i^* c_j S_{ij}}. $$
In order to find the optimial solution, we need to minimize this energy functional with respect to the variational parameters $c_i$, or calculate the variation such that:
\begin{equation}
\delta E({c_i})=0.
\end{equation}
We will calculate only the variation with respect to $c_i^*$, since the variation with respect to $c_j$ will yield the same result:
\begin{eqnarray}
\delta E & = & \sum_i \frac{\left(\sum_j c_j H_{ij} \sum_{i',j'} c_{i'}^*c_{j'} S_{i'j'} - \sum_j c_j S_{ij} \sum_{i',j'} c_{i'}^*c_{j'} H_{i'j'}\right)}{\left(\sum_{i',j'} c_{i'}^*c_{j'} S_{i'j'} \right)^2} \delta c_i^*.
\end{eqnarray}
Reordering some terms we can rewrite it as:
\begin{equation}
\sum_i \left(\frac{\sum_j c_j H_{ij} - E \sum_j c_j S_{ij}}{\sum_{i'j'} c_{i'}^*c_{j'} S_{i'j'}}\right) \delta c_i^*,
\end{equation}
where $E$ is given by Eq.(\ref{evar}).
This should be satisfied for all $c_i$'s, and we find that the coefficients should satisfy the following conditions:
\begin{equation}
\sum_{j=1}^N{(H_{ij}-ES_{ij})c_j} = 0 \,\,\,\,\, i=1,2,...,N.
\end{equation}
This is a generalized eigenvalue problem, that can be rewritten:
\begin{equation}
{\bf Hc}=E{\bf Sc},
\end{equation}
where ${\bf H}$ is the Hamiltonian matrix, and ${\bf S}$ is the so-called "overlap matrix". The main difference with an ordinary eigenvalue problem is the marix ${\bf S}$ on the right hand side. We'll see how to solve this problem in the exercises.
The solution to thsi problem is obtained by solving the following "secular determinant"
\begin{equation}
\left \vert
\begin{array}{cccc}
H_{11} - E S_{11} & H_{12} - E S_{12} & \cdots & H_{1N}-ES_{1N} \\
H_{21} - E S_{21} & H_{22} - E S_{22} & \cdots & H_{2N}-ES_{2N} \\
\vdots & \vdots & \vdots & \vdots \\
H_{N1} - E S_{N1} & H_{2N} - E S_{2N} & \cdots & H_{NN} - E S_{NN}
\end{array}\right\vert = 0.
\end{equation}
If an orthonormal basis is used, the secular equation is greatly simplified because $S_{ij} = \delta_{ij}$ (1 for $i=j$ and 0 for $i \neq j$), and we obtain:
\begin{equation}
{\bf Hc}=E{\bf c},
\end{equation}
which is nothing else but the stationary Schr\"odinger's equation, formulated in this basis.
In this case, the secular determinant is
\begin{equation}
\left \vert
\begin{array}{cccc}
H_{11} - E & H_{12} & \cdots & H_{1N} \\
H_{21} & H_{22} - E & \cdots & H_{2N} \\
\vdots & \vdots & \vdots & \vdots \\
H_{N1} & H_{2N} & \cdots & H_{NN} - E
\end{array}\right\vert = 0,
\end{equation}
In either case, the secular determinant for $N$ basis functions gives an $N$-th order polynomial in $E$ which is solved for $N$ different roots, each of which approximates a different eigenvalue.
These equations can be easily solved using readily available library routines, such as those in Numerical Recipes, or Lapack.
These equations can be easily solved using readily available library routines, such as those in Numerical Recipes, or Lapack.
At this point one may wonder where the approximation is: aren't we solving the problem exactly? If we take into account a complete basis set, the answer is "yes, we are solving the problem exactly". But as we said before, teh Hilbert space is very large, and we therefore have to limit the basis size to a number that is easily tractable with a computer. Therefore, we have to work in a constrained Hilbert space with a relatively small number of basis states kept, which makes the result variational.
Because of the computer time needed for numerical diagonalizations scales as the third power of the linear matrix size, we would want to keep the basis size as small as possible. Therefore, the basis wavefunctions must be choses carefully: it should be possible to approximate the exact solution to the full problem with a small number of basis states. Inorder to do that, we need some good intuition about the underlying physics of the problem.
We have used a linear parametrization of the wave function. This greatly simplifies the calculations.
However, nonlinear parametrizations are also possible, such as in the case of hartree-Fock theory.
The variational method lies behind hartree-Fock theory and the configuration interaction method for the electronic structure of atoms and molecules, as we will see in the following chapter.
## Examples of linear variational calculations
### The infinite potential well
The potential well with inifinite barriers is defined:
\begin{equation}
V(x) = \left\{
\begin{array}{ccc}
\infty & {\mathrm {for}} & |x| > |a| \\
0 & {\mathrm {for}} & |x| \leq |a|
\end{array}
\right.
\end{equation}
and it forces the wave function to vanish at the boundaries of the well at $x=\pm a$. The exact solutioon for this problems is known and treated in introductory quantum mechanics courses. Here we discuss a linear variational approach to be compared with the exact solution. We take $a=1$ and use natural units such that $\hbar^2/2m=1$.
As basis functions we take simple polynomials that vanish on the boundaries of the well:
\begin{equation}
\psi_n(x)=x^n(x-1)(x+1), n=0,1,2,3...
\end{equation}
The reason for choosing this particular form of basis functions is that the relevant matrix elements can easily be calculated analytically. We start we the overlap matrix:
\begin{equation}
S_{mn}=\langle \psi_n|\psi_m \rangle = \int_{-1}^1 \psi_n(x) \psi_m(x) dx.
\end{equation}
Working out the integrals, one obtains
\begin{equation}
S_{mn}=\frac{2}{n+m+5} - \frac{4}{n+m+3} + \frac{2}{n+m+1}
\end{equation}
for $n+m$ even, and zero otherwise.
We can also calculate the Hamiltonian matrix elements:
\begin{eqnarray}
H_{mn}=\langle \psi_n | p^2 | \psi_m \rangle = \int_{-1}^1 \psi_n(x) \left(-\frac{d^2}{dx^2} \right) \psi_m(x) dx \\
= -8 \left[ \frac{1-m-n-2mn}{(m+n+3)(m+n+1)(m+n-1)} \right]
\end{eqnarray}
for $m+n$ even, and zero otherwise.
#### Exercise 16.1: Infinite potential well
$\bullet$ Write a computer program in which you fill the overlap and Hamiltonian matrices for this problem. Use standard software to solve the generalized eigenvalue problem. Notice that the matrices are Hermitian, so only the upper, or lower triangular parts have to be calculated (including the diagonal).
$\bullet$ Compare results with exact analytic solutions. These are given by
\begin{equation}
\psi_n(x) = \left\{
\begin{array}{ccc}
\cos{(k_nx)} & n & {\mathrm {odd}} \\
\sin{(k_nx)} & n & {\mathrm{even \,\, and \,\, positive}}
\end{array}\right.
\end{equation}
with $k_n=n\pi/2, n=1,2...$, and the corresponding energies are given by
\begin{equation}
E_n = k_n^2=\frac{n^2\pi^2}{4}
\end{equation}
For each eigenvector ${\bf c}$, the function $\sum_{p=1}^{N} = c_p\phi_p(x)$ should approximate an exact eigenfunction. They can be compared by displaying both graphically. Carry out the comparison for various numbers of basis states kept.
```python
import numpy as np
from scipy import linalg
N=10
h=np.zeros((N,N), dtype=float)
s=np.zeros((N,N), dtype=float)
for m in range(N):
for n in range(m,N):
if((m+n)%2 == 0):
h[n,m]=-8*(1-m-n-2*m*n)/((m+n+3)*(m+n+1)*(m+n-1))
s[n,m] = 2./(m+n+5)-4./(m+n+3)+2./(n+m+1)
# No need for these lines below: we only have to define the lower triangle
# h[m,n] = h[n,m]
# s[m,n] = s[n,m]
w, v = linalg.eigh(h,s)
for n in range(N):
print(n,np.pi**2*(n+1)**2/4,w[n])
```
0 2.4674011002723395 2.467401100272339
1 9.869604401089358 9.869604401093914
2 22.206609902451056 22.2066123442276
3 39.47841760435743 39.47850458931857
4 61.68502750680849 61.76067928958051
5 88.82643960980423 89.16437778460741
6 120.90265391334464 132.91796389990037
7 157.91367041742973 181.68712260391723
8 199.8594891220595 463.1473433601288
9 246.74011002723395 642.3003906576474
### Hydrogen atom
One example of the variational method would be using the Gaussian function $\chi(r) = e^{- \alpha r^2}$ as a trial function for the hydrogen atom ground state. This problem could be solved by the variational method by obtaining the energy of $\chi(r)$ as a function of the variational parameter $\alpha$, and then minimizing $E(\alpha)$ to find the optimum value $\alpha_{min}$. The variational theorem's approximate wavefunction and energy for the hydrogen atom would then be $\chi(r) = e^{- \alpha_{min} r^2}$ and $E(\alpha_{min})$.
This is a one electron problem, so we do not have to worry about electron-electron interactions, or antisymmetrization of the wave function.
The Schr\"odinger's equation reads:
\begin{equation}
\left[ -\frac{\hbar^2}{2m}\nabla^2 - \frac{e^2}{4\pi\epsilon_0}\frac{1}{r} \right] \psi(x) = E \psi(x)
\end{equation}
where the second term is the Coulomb interaction with the positive nucleus (remember, this is a charged particle in a central potential). The mass $m$ is the reduced mass of the proton-electron system, which is approximately equal to the electron mass. The ground state has energy
\begin{equation}
E=-\frac{N}{\hbar^2} \left(\frac {{\mathrm e}^2}{4\pi\epsilon_0} \right)^2 \approx -13.6058 {\mathrm eV}
\end{equation}
and the wave function is given by
\begin{equation}
\psi({\bf x}) = \frac{2}{a_0^{3/2}} \exp{(-x/a_0)}
\label{H_exact}
\end{equation}
where $a_0$ is Bohr's radius
\begin{equation}
a_0=\frac{4\pi\epsilon_0\hbar^2}{m{\mathrm e}^2}.
\end{equation}
It is convenient to use units such that equations take on a simpler form. These are the so-called *standard units* in electronic structure: the unit of distance is Bohr's radius, masses are expressed in units of the electon mass $m_{\mathrm e}$, and charge in units of the electron charge e. The energy is finally given in "hartrees", equal to $E_H=m_{\mathrm e}c^2\alpha^2$ (where $\alpha$ is the fine structure constant). In these units the Schr\"odinger equation for the hydrogen atom assumes the following simpler form:
\begin{equation}
\left[ -\frac{1}{2}\nabla^2 - \frac{1}{r} \right] \psi(x) = E \psi(x).
\end{equation}
To approximate the ground state energy and wave function of the hydrogen atom in a linear variational procedure, we will use Gaussian basis functions. For the ground state, we only need angular momentum $l=0$ wave functions ($s$-orbitals), which have the form:
\begin{equation}
\chi_p(r)=\exp{(-\alpha_p r^2)}
\end{equation}
centered on the nucleus (whis is thus placed at the origin). We have to specify the values of the exponents $\alpha_p$, which are our variational parameters. Optimal values of these exponents have been previously found by other means, and
in our case, we will keep these values fixed:
\begin{eqnarray}
\alpha_1 &=& 13.00773 \\
\alpha_2 &=& 1.962079 \\
\alpha_3 &=& 0.444529 \\
\alpha_4 &=& 0.1219492.
\end{eqnarray}
If the program works correctly, it should shield a value of the energy close to the exact results $E_0=-1/2 E_H$.
It remains to determine the coefficients of the linear expansion, by solving the generalized eigenvalue problem, as we did in the previous example.
The matrix elements of
the overlap matrix ${\bf S}$, the kinetic energy matrix ${\bf T}$, and the Coulomb interaction ${\bf V}$ are given by:
\begin{eqnarray}
S_{pq} &=& \int d^3r e^{-\alpha_pr^2}e^{-\alpha_qr^2} = \left(\frac{\pi}{\alpha_p+\alpha_q}\right)^{3/2} \\
T_{pq} &=& \int d^3r e^{-\alpha_pr^2}\nabla^2 e^{-\alpha_qr^2} = 3 \frac{\alpha_p\alpha_q\pi^{3/2}}{(\alpha_p+\alpha_q)^{5/2}} \\
V_{pq} &=& \int d^3r e^{-\alpha_pr^2} \frac{1}{r} e^{-\alpha_qr^2} = - \frac{2\pi}{(\alpha_p+\alpha_q)}.
\end{eqnarray}
Using these expressions, one can fill the overlap and Hamiltonian matrices and solve the problem numerically.
#### Exercise 16.2: Hydrogen atom
$\bullet$ Solve the problem stated in the previous section. If your program has no errors, you should obtain $E=-0.499278 E_H$, which is remarkable considering that only four basis states have been taken into account.
$\bullet$ Compare graphically the variational ground-state to the exact one, given by
\begin{equation}
\psi({\bf x}) = \frac{2}{a_0^{3/2}} \exp{(-x/a_0)}
\end{equation}
```python
import numpy as np
from scipy import linalg
N=4
h=np.zeros((N,N), dtype=float)
s=np.zeros((N,N), dtype=float)
𝛼 = np.array([13.00773,1.962079,0.444529,0.1219492])
for m in range(N):
for n in range(m,N):
t=3*𝛼[n]*𝛼[m]*np.pi**1.5/(𝛼[n]+𝛼[m])**2.5
v=-2*np.pi/(𝛼[n]+𝛼[m])
h[n,m]=t+v
s[n,m]=(np.pi/(𝛼[n]+𝛼[m]))**1.5
w, v = linalg.eigh(h,s)
for n in range(N):
print(n,w[n])
```
0 -0.49927840566748505
1 0.1132139204579877
2 2.5922995719598165
3 21.144365190122503
```python
```
|
import Mathlib.Data.Fintype.Card
import Mathlib.Data.Fintype.Sum
import Mathlib.Data.Fintype.Sigma
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Tactic.Zify
import Mathlib.Tactic.Ring
import SSA.Bits.Defs
open Sum
variable {α β α' β' : Type} {γ : β → Type}
def propagateAux (init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool),
(α → Bool) × Bool)
(x : β → ℕ → Bool) : ℕ → (α → Bool) × Bool
| 0 => next_bit init_carry (fun i => x i 0)
| n+1 => next_bit (propagateAux init_carry next_bit x n).1 (fun i => x i (n+1))
def propagate (init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool),
(α → Bool) × Bool)
(x : β → ℕ → Bool) (i : ℕ) : Bool :=
(propagateAux init_carry next_bit x i).2
@[simp] def propagateCarry (init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool),
(α → Bool))
(x : β → ℕ → Bool) : ℕ → (α → Bool)
| 0 => next_bit init_carry (fun i => x i 0)
| n+1 => next_bit (propagateCarry init_carry next_bit x n) (fun i => x i (n+1))
@[simp] def propagateCarry2 (init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool),
(α → Bool))
(x : β → ℕ → Bool) : ℕ → (α → Bool)
| 0 => init_carry
| n+1 => next_bit (propagateCarry2 init_carry next_bit x n) (fun i => x i n)
lemma propagateCarry2_succ (init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool),
(α → Bool))
(x : β → ℕ → Bool) : ∀ (n : ℕ),
propagateCarry2 init_carry next_bit x (n+1) =
propagateCarry init_carry next_bit x n
| 0 => rfl
| n+1 => by rw [propagateCarry2, propagateCarry2_succ _ _ _ n, propagateCarry]
@[simp] lemma propagateAux_fst_eq_carry (init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool),
(α → Bool) × Bool)
(x : β → ℕ → Bool) : ∀ n : ℕ,
(propagateAux init_carry next_bit x n).1 =
propagateCarry init_carry (fun c b => (next_bit c b).1) x n
| 0 => rfl
| n+1 => by rw [propagateAux, propagateCarry, propagateAux_fst_eq_carry _ _ _ n]
@[simp] lemma propagate_zero (init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool),
(α → Bool) × Bool)
(x : β → ℕ → Bool) :
propagate init_carry next_bit x 0 = (next_bit init_carry (fun i => x i 0)).2 :=
rfl
lemma propagate_succ (init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool),
(α → Bool) × Bool)
(x : β → ℕ → Bool) (i : ℕ) :
propagate init_carry next_bit x (i+1) = (next_bit
(propagateCarry init_carry (fun c b => (next_bit c b).1) x i)
(λ j => x j (i+1))).2 :=
by rw [← propagateAux_fst_eq_carry]; rfl
lemma propagate_succ2 (init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool),
(α → Bool) × Bool)
(x : β → ℕ → Bool) (i : ℕ) :
propagate init_carry next_bit x (i+1) = (next_bit
(propagateCarry2 init_carry (λ c b => (next_bit c b).1) x (i+1))
(λ j => x j (i+1))).2 :=
by rw [propagateCarry2_succ, ← propagateAux_fst_eq_carry]; rfl
lemma propagateCarry_propagate {δ : β → Type} {β' : Type}
(f : ∀ a, δ a → β') : ∀ (n : ℕ) (init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool),
(α → Bool))
(init_carry_x : ∀ a, γ a → Bool)
(next_bit_x : ∀ a (_carry : γ a → Bool) (_bits : δ a → Bool),
(γ a → Bool) × Bool)
(x : β' → ℕ → Bool),
propagateCarry init_carry next_bit (λ a => propagate (init_carry_x a)
(next_bit_x a) (λ d => x (f a d))) n =
propagateCarry
(λ a : α ⊕ (Σ a, γ a) => Sum.elim init_carry (λ b : Σ a, γ a =>
init_carry_x b.1 b.2) a)
(λ (carry : (α ⊕ (Σ a, γ a)) → Bool) (bits : β' → Bool) =>
-- first compute (propagate (init_carry_x a) (next_bit_x a) (x a) n)
let f : ∀ (a : β), (γ a → Bool) × Bool := λ a => next_bit_x a
(λ d => carry (inr ⟨a, d⟩)) (λ d => bits (f a d))
let g : (α → Bool) := (next_bit (carry ∘ inl) (λ a => (f a).2))
Sum.elim g (λ x => (f x.1).1 x.2))
x n ∘ inl
| 0, init_carry, next_bit, init_carry_x, next_bit_x, x => rfl
| n+1, init_carry, next_bit, init_carry_x, next_bit_x, x => by
have := propagateCarry_propagate f n
simp only [propagateCarry, propagate_succ, elim_inl, Nat.add] at *
conv_lhs => simp only [this]
clear this
dsimp
congr
ext a
dsimp
congr
ext b
dsimp [propagateCarry, propagate_succ, elim_inl, Nat.add]
congr
dsimp
induction' n with n ih
. simp
. simp [ih]
lemma propagate_propagate {δ : β → Type} {β' : Type}
(f : ∀ a, δ a → β') : ∀ (n : ℕ) (init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool),
(α → Bool) × Bool)
(init_carry_x : ∀ a, γ a → Bool)
(next_bit_x : ∀ a (_carry : γ a → Bool) (_bits : δ a → Bool),
(γ a → Bool) × Bool)
(x : β' → ℕ → Bool),
propagate init_carry next_bit (λ a => propagate (init_carry_x a)
(next_bit_x a) (λ d => x (f a d))) n =
propagate
(λ a : α ⊕ (Σ a, γ a) => Sum.elim init_carry (λ b : Σ a, γ a =>
init_carry_x b.1 b.2) a)
(λ (carry : (α ⊕ (Σ a, γ a)) → Bool) (bits : β' → Bool) =>
-- first compute (propagate (init_carry_x a) (next_bit_x a) (x a) n)
let f : ∀ (a : β), (γ a → Bool) × Bool := λ a => next_bit_x a (λ d =>
carry (inr ⟨a, d⟩)) (λ d => bits (f a d))
let g : (α → Bool) × Bool := (next_bit (carry ∘ inl) (λ a => (f a).2))
(Sum.elim g.1 (λ x => (f x.1).1 x.2), g.2)
)
x n
| 0, init_carry, next_bit, init_carry_x, next_bit_x, x => rfl
| n+1, init_carry, next_bit, init_carry_x, next_bit_x, x => by
simp only [propagate_succ]
rw [propagateCarry_propagate]
congr
ext
congr
induction' n with n ih
. simp
. simp [ih]
lemma propagateCarry_changeVars {β' : Type}
(init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool),
(α → Bool))
(x : β' → ℕ → Bool) (i : ℕ)
(changeVars : β → β') :
propagateCarry init_carry next_bit (λ b => x (changeVars b)) i =
propagateCarry init_carry (λ (carry : α → Bool) (bits : β' → Bool) =>
next_bit carry (λ b => bits (changeVars b))) x i := by
induction i
. simp
. simp [*]
lemma propagate_changeVars {β' : Type}
(init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool),
(α → Bool) × Bool)
(x : β' → ℕ → Bool) (i : ℕ)
(changeVars : β → β') :
propagate init_carry next_bit (λ b => x (changeVars b)) i =
propagate init_carry (λ (carry : α → Bool) (bits : β' → Bool) =>
next_bit carry (λ b => bits (changeVars b))) x i := by
induction' i with i ih
. rfl
. simp only [propagate_succ, propagateCarry_changeVars, ih]
open Term
@[simp] def arity : Term → ℕ
| (var n) => n+1
| zero => 0
| one => 0
| negOne => 0
| Term.and t₁ t₂ => max (arity t₁) (arity t₂)
| Term.or t₁ t₂ => max (arity t₁) (arity t₂)
| Term.xor t₁ t₂ => max (arity t₁) (arity t₂)
| Term.not t => arity t
| ls t => arity t
| add t₁ t₂ => max (arity t₁) (arity t₂)
| sub t₁ t₂ => max (arity t₁) (arity t₂)
| neg t => arity t
| incr t => arity t
| decr t => arity t
@[simp] def Term.evalFin : ∀ (t : Term) (_vars : Fin (arity t) → ℕ → Bool), ℕ → Bool
| var n, vars => vars (Fin.last n)
| zero, _vars => zeroSeq
| one, _vars => oneSeq
| negOne, _vars => negOneSeq
| Term.and t₁ t₂, vars =>
andSeq (Term.evalFin t₁
(fun i => vars (Fin.castLe (by simp [arity]) i)))
(Term.evalFin t₂
(fun i => vars (Fin.castLe (by simp [arity]) i)))
| Term.or t₁ t₂, vars =>
orSeq (Term.evalFin t₁
(fun i => vars (Fin.castLe (by simp [arity]) i)))
(Term.evalFin t₂
(fun i => vars (Fin.castLe (by simp [arity]) i)))
| Term.xor t₁ t₂, vars =>
xorSeq (Term.evalFin t₁
(fun i => vars (Fin.castLe (by simp [arity]) i)))
(Term.evalFin t₂
(fun i => vars (Fin.castLe (by simp [arity]) i)))
| not t, vars => notSeq (Term.evalFin t vars)
| ls t, vars => lsSeq (Term.evalFin t vars)
| add t₁ t₂, vars =>
addSeq (Term.evalFin t₁
(fun i => vars (Fin.castLe (by simp [arity]) i)))
(Term.evalFin t₂
(fun i => vars (Fin.castLe (by simp [arity]) i)))
| sub t₁ t₂, vars =>
subSeq (Term.evalFin t₁
(fun i => vars (Fin.castLe (by simp [arity]) i)))
(Term.evalFin t₂
(fun i => vars (Fin.castLe (by simp [arity]) i)))
| neg t, vars => negSeq (Term.evalFin t vars)
| incr t, vars => incrSeq (Term.evalFin t vars)
| decr t, vars => decrSeq (Term.evalFin t vars)
lemma evalFin_eq_eval (t : Term) (vars : ℕ → ℕ → Bool) :
Term.evalFin t (fun i => vars i) = Term.eval t vars := by
induction t <;>
dsimp [Term.evalFin, Term.eval, arity] at * <;> simp [*]
lemma id_eq_propagate (x : ℕ → Bool) :
x = propagate Empty.elim (λ _ (y : Unit → Bool) => (Empty.elim, y ())) (λ _ => x) := by
ext n; cases n <;> rfl
lemma zero_eq_propagate :
zeroSeq = propagate Empty.elim (λ (_ _ : Empty → Bool) => (Empty.elim, false)) Empty.elim := by
ext n; cases n <;> rfl
lemma one_eq_propagate :
oneSeq = propagate (λ _ : Unit => true)
(λ f (_ : Empty → Bool) => (λ _ => false, f ())) Empty.elim := by
ext n
match n with
| 0 => rfl
| 1 => rfl
| n+2 => simp [oneSeq, propagate_succ]
lemma and_eq_propagate (x y : ℕ → Bool) :
andSeq x y = propagate Empty.elim
(λ _ (y : Bool → Bool) => (Empty.elim, y true && y false)) (λ b => cond b x y) := by
ext n; cases n <;> simp [propagate, propagateAux, andSeq]
lemma or_eq_propagate (x y : ℕ → Bool) :
orSeq x y = propagate Empty.elim
(λ _ (y : Bool → Bool) => (Empty.elim, y true || y false)) (λ b => cond b x y) := by
ext n; cases n <;> simp [propagate, propagateAux, orSeq]
lemma xor_eq_propagate (x y : ℕ → Bool) :
xorSeq x y = propagate Empty.elim
(λ _ (y : Bool → Bool) => (Empty.elim, xor (y true) (y false))) (λ b => cond b x y) := by
ext n; cases n <;> simp [propagate, propagateAux, xorSeq]
lemma not_eq_propagate (x : ℕ → Bool) :
notSeq x = propagate Empty.elim (λ _ (y : Unit → Bool) => (Empty.elim, !(y ()))) (λ _ => x) := by
ext n; cases n <;> simp [propagate, propagateAux, notSeq]
lemma ls_eq_propagate (x : ℕ → Bool) :
lsSeq x = propagate (λ _ : Unit => false)
(λ (carry x : Unit → Bool) => (x, carry ())) (λ _ => x) := by
ext n
match n with
| 0 => rfl
| 1 => rfl
| n+2 => simp [lsSeq, propagate_succ]
lemma addSeqAux_eq_propagateCarry (x y : ℕ → Bool) (n : ℕ) :
(addSeqAux x y n).2 = propagateCarry (λ _ => false)
(λ (carry : Unit → Bool) (bits : Bool → Bool) =>
λ _ => (bits true && bits false) || (bits false && carry ()) || (bits true && carry ()))
(λ b => cond b x y) n () := by
induction n <;> simp [addSeqAux, *]
lemma add_eq_propagate (x y : ℕ → Bool) :
addSeq x y = propagate (λ _ => false)
(λ (carry : Unit → Bool) (bits : Bool → Bool) =>
(λ _ => (bits true && bits false) || (bits false && carry ()) || (bits true && carry ()),
_root_.xor (bits true) (_root_.xor (bits false) (carry ()))))
(λ b => cond b x y) := by
ext n
match n with
| 0 => simp [addSeq, addSeqAux]
| 1 => simp [addSeq, addSeqAux, propagate, propagateAux]
| n+2 => simp [addSeq, addSeqAux, addSeqAux_eq_propagateCarry, propagate_succ]
lemma subSeqAux_eq_propagateCarry (x y : ℕ → Bool) (n : ℕ) :
(subSeqAux x y n).2 = propagateCarry (λ _ => false)
(λ (carry : Unit → Bool) (bits : Bool → Bool) =>
λ _ => (!(bits true) && (bits false)) ||
(!(_root_.xor (bits true) (bits false))) && carry ())
(λ b => cond b x y) n () := by
induction n <;> simp [subSeqAux, *]
lemma sub_eq_propagate (x y : ℕ → Bool) :
subSeq x y = propagate (λ _ => false)
(λ (carry : Unit → Bool) (bits : Bool → Bool) =>
(λ _ => (!(bits true) && (bits false)) ||
((!(_root_.xor (bits true) (bits false))) && carry ()),
_root_.xor (bits true) (_root_.xor (bits false) (carry ()))))
(λ b => cond b x y) := by
ext n
match n with
| 0 => simp [subSeq, subSeqAux]
| 1 => simp [subSeq, subSeqAux, propagate, propagateAux]
| n+2 => simp [subSeq, subSeqAux, subSeqAux_eq_propagateCarry, propagate_succ]
lemma negSeqAux_eq_propagateCarry (x : ℕ → Bool) (n : ℕ) :
(negSeqAux x n).2 = propagateCarry (λ _ => true)
(λ (carry : Unit → Bool) (bits : Unit → Bool) =>
λ _ => (!(bits ())) && (carry ()))
(λ _ => x) n () := by
induction n <;> simp [negSeqAux, *]
lemma neg_eq_propagate (x : ℕ → Bool) :
negSeq x = propagate (λ _ => true)
(λ (carry : Unit → Bool) (bits : Unit → Bool) =>
(λ _ => (!(bits ())) && (carry ()), _root_.xor (!(bits ())) (carry ())))
(λ _ => x) := by
ext n
match n with
| 0 => simp [negSeq, negSeqAux]
| 1 => simp [negSeq, negSeqAux, propagate, propagateAux]
| n+2 => simp [negSeq, negSeqAux, negSeqAux_eq_propagateCarry, propagate_succ]
lemma incrSeqAux_eq_propagateCarry (x : ℕ → Bool) (n : ℕ) :
(incrSeqAux x n).2 = propagateCarry (λ _ => true)
(λ (carry : Unit → Bool) (bits : Unit → Bool) =>
λ _ => (bits ()) && carry ())
(λ _ => x) n () := by
induction n <;> simp [incrSeqAux, *]
lemma incr_eq_propagate (x : ℕ → Bool) :
incrSeq x = propagate (λ _ => true)
(λ (carry : Unit → Bool) (bits : Unit → Bool) =>
(λ _ => (bits ()) && carry (), _root_.xor (bits ()) (carry ())))
(λ _ => x) := by
ext n
match n with
| 0 => simp [incrSeq, incrSeqAux]
| 1 => simp [incrSeq, incrSeqAux, propagate, propagateAux]
| n+2 => simp [incrSeq, incrSeqAux, incrSeqAux_eq_propagateCarry, propagate_succ]
lemma decrSeqAux_eq_propagateCarry (x : ℕ → Bool) (n : ℕ) :
(decrSeqAux x n).2 = propagateCarry (λ _ => true)
(λ (carry : Unit → Bool) (bits : Unit → Bool) =>
λ _ => (!(bits ())) && carry ())
(λ _ => x) n () := by
induction n <;> simp [decrSeqAux, *]
lemma decr_eq_propagate (x : ℕ → Bool) :
decrSeq x = propagate (λ _ => true)
(λ (carry : Unit → Bool) (bits : Unit → Bool) =>
(λ _ => (!(bits ())) && carry (), _root_.xor (bits ()) (carry ())))
(λ _ => x) := by
ext n
match n with
| 0 => simp [decrSeq, decrSeqAux]
| 1 => simp [decrSeq, decrSeqAux, propagate, propagateAux]
| n+2 => simp [decrSeq, decrSeqAux, decrSeqAux_eq_propagateCarry, propagate_succ]
structure PropagateStruc (arity : Type) : Type 1 :=
( α : Type )
[ i : Fintype α ]
( init_carry : α → Bool )
( next_bit : ∀ (_carry : α → Bool) (_bits : arity → Bool),
(α → Bool) × Bool )
attribute [instance] PropagateStruc.i
namespace PropagateStruc
variable {arity : Type} (p : PropagateStruc arity)
def eval : (arity → ℕ → Bool) → ℕ → Bool :=
propagate p.init_carry p.next_bit
def changeVars {arity2 : Type} (changeVars : arity → arity2) :
PropagateStruc arity2 :=
{ α := p.α,
i := p.i,
init_carry := p.init_carry,
next_bit := λ carry bits => p.next_bit carry (fun i => bits (changeVars i)) }
def compose [Fintype arity]
(new_arity : Type)
(q_arity : arity → Type)
(vars : ∀ (a : arity), q_arity a → new_arity)
(q : ∀ (a : arity), PropagateStruc (q_arity a)) :
PropagateStruc (new_arity) :=
{ α := p.α ⊕ (Σ a, (q a).α),
i := by letI := p.i; infer_instance,
init_carry := Sum.elim p.init_carry (λ x => (q x.1).init_carry x.2),
next_bit := λ carry bits =>
let f : ∀ (a : arity), ((q a).α → Bool) × Bool := λ a => (q a).next_bit (λ d =>
carry (inr ⟨a, d⟩)) (λ d => bits (vars a d))
let g : (p.α → Bool) × Bool := (p.next_bit (carry ∘ inl) (λ a => (f a).2))
(Sum.elim g.1 (λ x => (f x.1).1 x.2), g.2) }
lemma eval_compose [Fintype arity]
(new_arity : Type)
(q_arity : arity → Type)
(vars : ∀ (a : arity), q_arity a → new_arity)
(q : ∀ (a : arity), PropagateStruc (q_arity a))
(x : new_arity → ℕ → Bool):
(p.compose new_arity q_arity vars q).eval x =
p.eval (λ a => (q a).eval (fun i => x (vars _ i))) := by
ext n; simp only [eval, compose, propagate_propagate]
def and : PropagateStruc Bool :=
{ α := Empty,
i := by infer_instance,
init_carry := Empty.elim,
next_bit := λ _carry bits => (Empty.elim, bits true && bits false) }
@[simp] lemma eval_and (x : Bool → ℕ → Bool) : and.eval x = andSeq (x true) (x false) := by
ext n; cases n <;> simp [and, andSeq, eval, propagate_succ]
def or : PropagateStruc Bool :=
{ α := Empty,
i := by infer_instance,
init_carry := Empty.elim,
next_bit := λ _carry bits => (Empty.elim, bits true || bits false) }
@[simp] lemma eval_or (x : Bool → ℕ → Bool) : or.eval x = orSeq (x true) (x false) := by
ext n; cases n <;> simp [or, orSeq, eval, propagate_succ]
def xor : PropagateStruc Bool :=
{ α := Empty,
i := by infer_instance,
init_carry := Empty.elim,
next_bit := λ _carry bits => (Empty.elim, _root_.xor (bits true) (bits false)) }
@[simp] lemma eval_xor (x : Bool → ℕ → Bool) : xor.eval x = xorSeq (x true) (x false) := by
ext n; cases n <;> simp [xor, xorSeq, eval, propagate_succ]
def add : PropagateStruc Bool :=
{ α := Unit,
i := by infer_instance,
init_carry := λ _ => false,
next_bit := λ (carry : Unit → Bool) (bits : Bool → Bool) =>
(λ _ => (bits true && bits false) || (bits false && carry ()) || (bits true && carry ()),
_root_.xor (bits true) (_root_.xor (bits false) (carry ()))) }
@[simp] lemma eval_add (x : Bool → ℕ → Bool) : add.eval x = addSeq (x true) (x false) := by
dsimp [add, eval]
rw [add_eq_propagate]
congr
funext b
cases b; rfl
simp
congr
funext i
cases i <;> simp
def sub : PropagateStruc Bool :=
{ α := Unit,
i := by infer_instance,
init_carry := λ _ => false,
next_bit := λ (carry : Unit → Bool) (bits : Bool → Bool) =>
(λ _ => (!(bits true) && (bits false)) ||
((!(_root_.xor (bits true) (bits false))) && carry ()),
_root_.xor (bits true) (_root_.xor (bits false) (carry ()))) }
@[simp] lemma eval_sub (x : Bool → ℕ → Bool) : sub.eval x = subSeq (x true) (x false) := by
dsimp [sub, eval]
rw [sub_eq_propagate]
congr
funext b
cases b; rfl
simp
congr
funext i
cases i <;> simp
def neg : PropagateStruc Unit :=
{ α := Unit,
i := by infer_instance,
init_carry := λ _ => true,
next_bit := λ (carry : Unit → Bool) (bits : Unit → Bool) =>
(λ _ => (!(bits ())) && (carry ()), _root_.xor (!(bits ())) (carry ())) }
@[simp] lemma eval_neg (x : Unit → ℕ → Bool) : neg.eval x = negSeq (x ()) := by
dsimp [neg, eval]
rw [neg_eq_propagate]
def not : PropagateStruc Unit :=
{ α := Empty,
i := by infer_instance,
init_carry := Empty.elim,
next_bit := λ _carry bits => (Empty.elim, !(bits ())) }
@[simp] lemma eval_not (x : Unit → ℕ → Bool) : not.eval x = notSeq (x ()) := by
ext n; cases n <;> simp [not, notSeq, eval, propagate_succ]
def zero : PropagateStruc (Fin 0) :=
{ α := Empty,
i := by infer_instance,
init_carry := Empty.elim,
next_bit := λ _carry _bits => (Empty.elim, false) }
@[simp] lemma eval_zero (x : Fin 0 → ℕ → Bool) : zero.eval x = zeroSeq := by
ext n; cases n <;> simp [zero, zeroSeq, eval, propagate_succ]
def one : PropagateStruc (Fin 0) :=
{ α := Unit,
i := by infer_instance,
init_carry := λ _ => true,
next_bit := λ carry _bits => (λ _ => false, carry ()) }
@[simp] lemma eval_one (x : Fin 0 → ℕ → Bool) : one.eval x = oneSeq := by
ext n; cases n <;> simp [one, oneSeq, eval, propagate_succ2, @eq_comm _ false]
def negOne : PropagateStruc (Fin 0) :=
{ α := Empty,
i := by infer_instance,
init_carry := Empty.elim,
next_bit := λ _carry _bits => (Empty.elim, true) }
@[simp] lemma eval_negOne (x : Fin 0 → ℕ → Bool) : negOne.eval x = negOneSeq := by
ext n; cases n <;> simp [negOne, negOneSeq, eval, propagate_succ2]
def ls : PropagateStruc Unit :=
{ α := Unit,
i := by infer_instance,
init_carry := λ _ => false,
next_bit := λ carry bits => (bits, carry ()) }
@[simp] lemma eval_ls (x : Unit → ℕ → Bool) : ls.eval x = lsSeq (x ()) := by
ext n; cases n <;> simp [ls, lsSeq, eval, propagate_succ2]
def var (n : ℕ) : PropagateStruc (Fin (n+1)) :=
{ α := Empty,
i := by infer_instance,
init_carry := Empty.elim,
next_bit := λ _carry bits => (Empty.elim, bits (Fin.last n)) }
@[simp] lemma eval_var (n : ℕ) (x : Fin (n+1) → ℕ → Bool) : (var n).eval x = x (Fin.last n) := by
ext m; cases m <;> simp [var, eval, propagate_succ]
def incr : PropagateStruc Unit :=
{ α := Unit,
i := by infer_instance,
init_carry := λ _ => true,
next_bit := λ carry bits => (λ _ => bits () && carry (), _root_.xor (bits ()) (carry ())) }
@[simp] lemma eval_incr (x : Unit → ℕ → Bool) : incr.eval x = incrSeq (x ()) := by
dsimp [incr, eval]
rw [incr_eq_propagate]
def decr : PropagateStruc Unit :=
{ α := Unit,
i := by infer_instance,
init_carry := λ _ => true,
next_bit := λ carry bits => (λ _ => !(bits ()) && carry (), _root_.xor (bits ()) (carry ())) }
@[simp] lemma eval_decr (x : Unit → ℕ → Bool) : decr.eval x = decrSeq (x ()) := by
dsimp [decr, eval]
rw [decr_eq_propagate]
end PropagateStruc
structure PropagateSolution (t : Term) extends PropagateStruc (Fin (arity t)) :=
( good : t.evalFin = toPropagateStruc.eval )
def composeUnary
(p : PropagateStruc Unit)
{t : Term}
(q : PropagateSolution t) :
PropagateStruc (Fin (arity t)) :=
p.compose
(Fin (arity t))
_
(λ _ => id)
(λ _ => q.toPropagateStruc)
def X := @Bool.casesOn
def composeBinary
(p : PropagateStruc Bool)
{t₁ t₂ : Term}
(q₁ : PropagateSolution t₁)
(q₂ : PropagateSolution t₂) :
PropagateStruc (Fin (max (arity t₁) (arity t₂))) :=
p.compose (Fin (max (arity t₁) (arity t₂)))
(λ b => Fin (cond b (arity t₁) (arity t₂)))
(λ b i => Fin.castLe (by cases b <;> simp) i)
(λ b => match b with
| true => q₁.toPropagateStruc
| false => q₂.toPropagateStruc)
@[simp] lemma composeUnary_eval
(p : PropagateStruc Unit)
{t : Term}
(q : PropagateSolution t)
(x : Fin (arity t) → ℕ → Bool) :
(composeUnary p q).eval x = p.eval (λ _ => t.evalFin x) := by
rw [composeUnary, PropagateStruc.eval_compose, q.good]; rfl
@[simp] lemma composeBinary_eval
(p : PropagateStruc Bool)
{t₁ t₂ : Term}
(q₁ : PropagateSolution t₁)
(q₂ : PropagateSolution t₂)
(x : Fin (max (arity t₁) (arity t₂)) → ℕ → Bool) :
(composeBinary p q₁ q₂).eval x = p.eval
(λ b => cond b (t₁.evalFin (fun i => x (Fin.castLe (by simp) i)))
(t₂.evalFin (fun i => x (Fin.castLe (by simp) i)))) := by
rw [composeBinary, PropagateStruc.eval_compose, q₁.good, q₂.good]
congr
ext b
cases b <;> dsimp <;> congr <;> funext b <;> cases b <;> simp
instance {α β : Type} [Fintype α] [Fintype β] (b : Bool) :
Fintype (cond b α β) :=
by cases b <;> simp <;> infer_instance
lemma cond_propagate {α α' β β' : Type}
(init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool),
(α → Bool) × Bool)
(init_carry' : α' → Bool)
(next_bit' : ∀ (_carry : α' → Bool) (_bits : β' → Bool),
(α' → Bool) × Bool)
{γ : Type} (fβ : β → γ) (fβ' : β' → γ)
(x : γ → ℕ → Bool) (b : Bool) :
cond b (propagate init_carry next_bit (λ b => (x (fβ b))))
(propagate init_carry' next_bit' (λ b => (x (fβ' b)))) =
propagate (show cond b α α' → Bool from Bool.rec init_carry' init_carry b)
(show ∀ (_carry : cond b α α' → Bool) (_bits : cond b β β' → Bool),
(cond b α α' → Bool) × Bool
from Bool.rec next_bit' next_bit b)
(show cond b β β' → ℕ → Bool from Bool.rec (λ b => (x (fβ' b))) (λ b => (x (fβ b))) b) :=
by cases b <;> rfl
def termEvalEqPropagate : ∀ (t : Term),
PropagateSolution t
| var n =>
{ toPropagateStruc := PropagateStruc.var n,
good := by ext; simp [Term.evalFin] }
| zero =>
{ toPropagateStruc := PropagateStruc.zero,
good := by ext; simp [Term.evalFin] }
| one =>
{ toPropagateStruc := PropagateStruc.one,
good := by ext; simp [Term.evalFin] }
| negOne =>
{ toPropagateStruc := PropagateStruc.negOne,
good := by ext; simp [Term.evalFin] }
| Term.and t₁ t₂ =>
let q₁ := termEvalEqPropagate t₁
let q₂ := termEvalEqPropagate t₂
{ toPropagateStruc := composeBinary PropagateStruc.and q₁ q₂,
good := by ext; simp }
| Term.or t₁ t₂ =>
let q₁ := termEvalEqPropagate t₁
let q₂ := termEvalEqPropagate t₂
{ toPropagateStruc := composeBinary PropagateStruc.or q₁ q₂,
good := by ext; simp }
| Term.xor t₁ t₂ =>
let q₁ := termEvalEqPropagate t₁
let q₂ := termEvalEqPropagate t₂
{ toPropagateStruc := composeBinary PropagateStruc.xor q₁ q₂,
good := by ext; simp }
| ls t =>
let q := termEvalEqPropagate t
{ toPropagateStruc := by dsimp [arity]; exact composeUnary PropagateStruc.ls q,
good := by ext; simp }
| Term.not t =>
let q := termEvalEqPropagate t
{ toPropagateStruc := by dsimp [arity]; exact composeUnary PropagateStruc.not q,
good := by ext; simp }
| add t₁ t₂ =>
let q₁ := termEvalEqPropagate t₁
let q₂ := termEvalEqPropagate t₂
{ toPropagateStruc := composeBinary PropagateStruc.add q₁ q₂,
good := by ext; simp }
| sub t₁ t₂ =>
let q₁ := termEvalEqPropagate t₁
let q₂ := termEvalEqPropagate t₂
{ toPropagateStruc := composeBinary PropagateStruc.sub q₁ q₂,
good := by ext; simp }
| neg t =>
let q := termEvalEqPropagate t
{ toPropagateStruc := by dsimp [arity]; exact composeUnary PropagateStruc.neg q,
good := by ext; simp }
| incr t =>
let q := termEvalEqPropagate t
{ toPropagateStruc := by dsimp [arity]; exact composeUnary PropagateStruc.incr q,
good := by ext; simp }
| decr t =>
let q := termEvalEqPropagate t
{ toPropagateStruc := by dsimp [arity]; exact composeUnary PropagateStruc.decr q,
good := by ext; simp }
variable
(init_carry : α → Bool)
(next_carry : ∀ (_carry : α → Bool) (_bits : β → Bool), (α → Bool))
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool), (α → Bool) × Bool)
variable [Fintype α] [Fintype α']
open Fintype
lemma exists_repeat_carry (seq : β → ℕ → Bool) :
∃ n m : Fin (2 ^ (card α) + 1),
propagateCarry2 init_carry next_carry seq n =
propagateCarry2 init_carry next_carry seq m ∧
n < m := by
by_contra h
haveI := Classical.decEq α
push_neg at h
have := λ a b hab => (le_antisymm (h a b hab) (h b a hab.symm)).symm
have := Fintype.card_le_of_injective _ this
simp at this
lemma propagateCarry2_eq_of_seq_eq_lt (seq₁ seq₂ : β → ℕ → Bool)
(init_carry : α → Bool)
(next_carry : ∀ (_carry : α → Bool) (_bits : β → Bool), (α → Bool))
(i : ℕ) (h : ∀ (b) (j) (_hj : j < i), seq₁ b j = seq₂ b j) :
propagateCarry2 init_carry next_carry seq₁ i =
propagateCarry2 init_carry next_carry seq₂ i := by
induction' i with i ih
{ simp [propagateCarry2] }
{ simp only [propagateCarry2, h _ i (Nat.lt_succ_self i)]
rw [ih]
exact λ b j hj => h b j (Nat.lt_succ_of_lt hj) }
lemma propagate_eq_of_seq_eq_le (seq₁ seq₂ : β → ℕ → Bool)
(init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool), (α → Bool) × Bool)
(i : ℕ) (h : ∀ (b) (j) (_hj : j ≤ i), seq₁ b j = seq₂ b j) :
propagate init_carry next_bit seq₁ i =
propagate init_carry next_bit seq₂ i := by
cases i
{ simp [propagate_zero, h _ 0 (le_refl _)] }
{ simp only [propagate_succ2, propagate_succ2, h _ _ (le_refl _)]
congr 2
apply propagateCarry2_eq_of_seq_eq_lt
exact λ b j hj => h b j (le_of_lt hj) }
lemma propagateCarry2_eq_of_carry_eq (seq₁ seq₂ : β → ℕ → Bool)
(m n : ℕ)
(h₁ : propagateCarry2 init_carry
(λ carry bits => (next_bit carry bits).1) seq₁ m =
propagateCarry2 init_carry
(λ carry bits => (next_bit carry bits).1) seq₂ n) (x : ℕ)
(h₃ : ∀ y b, y ≤ x → seq₁ b (m + y) = seq₂ b (n + y)) :
propagateCarry2 init_carry
(λ carry bits => (next_bit carry bits).1) seq₁ (m + x) =
propagateCarry2 init_carry
(λ carry bits => (next_bit carry bits).1) seq₂ (n + x) := by
induction' x with x ih generalizing seq₁ seq₂
{ simp [*] at * }
{ simp only [propagateCarry2, Nat.add_eq, h₃ x _ (Nat.le_succ _)] at *
rw [ih]
assumption
exact λ y b h => h₃ y b (Nat.le_succ_of_le h) }
lemma propagate_eq_of_carry_eq (seq₁ seq₂ : β → ℕ → Bool)
(m n : ℕ)
(h₁ : propagateCarry2 init_carry
(λ carry bits => (next_bit carry bits).1) seq₁ m =
propagateCarry2 init_carry
(λ carry bits => (next_bit carry bits).1) seq₂ n) (x : ℕ)
(h₃ : ∀ y b, y ≤ x → seq₁ b (m + y) = seq₂ b (n + y)) :
propagate init_carry next_bit seq₁ (m + x) =
propagate init_carry next_bit seq₂ (n + x) := by
cases x
{ cases m
{ cases n
{ simp [h₃ 0 _ (le_refl _), propagateCarry2, *] at * }
{ simp [*, h₃ 0 _ (le_refl _), propagate_succ2] at *
rw [← h₁] } }
{ cases n
{ simp [*, propagate_succ2] at *
have := fun i => h₃ 0 i rfl
dsimp at this
simp [this]
simp [h₁] }
{ rw [propagate_succ2, h₁, propagate_succ2]
have := h₃ 0
simp [*] at * } } }
{ erw [Nat.add_succ, propagate_succ2, propagate_succ2, Nat.add_eq, Nat.add_eq]
simp [← Nat.succ_eq_add_one, ← Nat.add_succ, h₃ _ _ (le_refl _)]
congr
. apply propagateCarry2_eq_of_carry_eq
. assumption
. exact λ y b h => h₃ y b (Nat.le_succ_of_le h)
. funext i
rw [h₃]
exact Nat.le_succ _ }
lemma propagateCarry_propagateCarry_add (x : β → ℕ → Bool) :
∀ (init_carry : α → Bool)
(next_carry : ∀ (_carry : α → Bool) (_bits : β → Bool), (α → Bool)),
∀ n i : ℕ,
propagateCarry2 (propagateCarry2 init_carry next_carry x n)
next_carry (λ b k => x b (k + n)) i =
propagateCarry2 init_carry next_carry x (i + n)
| init_carry, _next_carry, 0, 0 => by simp [propagateCarry2]
| init_carry, next_carr, n+1, 0 =>
by simp [propagateCarry, propagateCarry2_succ]
| init_carry, next_carry, n, i+1 => by
rw [propagateCarry2, add_assoc,
propagateCarry_propagateCarry_add _ _ _ _ i]
simp only [Nat.one_add, Nat.add_one, Nat.succ_add, Nat.add_succ,
add_zero, propagateCarry2, zero_add]
lemma exists_repeat : ∀ (seq : β → ℕ → Bool)
(n : ℕ),
∃ (m : ℕ) (_hm : m < 2 ^ (card α)) (seq2 : β → ℕ → Bool),
propagate init_carry next_bit seq2 m = propagate init_carry next_bit seq n
| seq, n => by
by_cases hn2 : n < 2 ^ card α
{ exact ⟨n, hn2, seq, rfl⟩ }
{ rcases exists_repeat_carry
(propagateCarry2 init_carry (λ c b => (next_bit c b).1) seq
(n - 2 ^ card α))
(λ carry bits => (next_bit carry bits).1)
(λ b i => seq b (i + (n - 2^ (card α)))) with ⟨a, b, h₁, h₂⟩
simp only [propagateCarry_propagateCarry_add] at h₁
rcases have _wf : n - (b - a) < n :=
Nat.sub_lt (lt_of_lt_of_le (pow_pos (by norm_num) _) (le_of_not_lt hn2)) (Nat.sub_pos_of_lt h₂)
exists_repeat (λ c i => if i < a + (n - 2 ^ card α) then seq c i else
seq c (i + (b - a))) (n - (b - a)) with ⟨m, hmle, seq2, hm⟩
use m; use hmle; use seq2
rw [hm]; clear hm
have h1 : n - (b - a) = (a + (n - 2 ^ (card α))) + (2 ^ card α - b) := by
{ zify
rw [Nat.cast_sub, Nat.cast_sub, Nat.cast_sub, Nat.cast_sub]
ring_nf
exact Nat.le_of_lt_succ b.2
simp [*] at *
exact hn2
exact le_of_lt h₂
exact le_trans (Nat.sub_le _ _) (le_trans (Nat.le_of_lt_succ b.2)
(le_of_not_lt hn2)) }
rw [h1]
have h2 : n = (b + (n - 2 ^ card α)) + (2 ^ card α - b) := by
{ zify
rw [Nat.cast_sub, Nat.cast_sub]
ring
exact Nat.le_of_lt_succ b.2
simp [*] at *
exact hn2 }
conv_rhs => rw [h2]
refine' propagate_eq_of_carry_eq _ _ _ _ _ _ _ _ _
{ have _h : ↑b + (n - 2 ^ card α) = (a + (n - 2 ^ card α)) + (b - a) := by
{ zify
rw [Nat.cast_sub, Nat.cast_sub]
ring_nf
exact le_of_lt h₂
exact le_of_not_lt hn2 }
rw [← h₁]
apply propagateCarry2_eq_of_seq_eq_lt
simp (config := { contextual := true }) }
{ intro y c _hc
simp only [add_lt_iff_neg_left, not_lt_zero', if_false]
congr 1
zify
rw [Nat.cast_sub, Nat.cast_sub]
ring
exact le_of_lt h₂
exact le_of_not_lt hn2 } }
lemma propagate_eq_zero_iff (init_carry : α → Bool)
(next_bit : ∀ (_carry : α → Bool) (_bits : β → Bool), (α → Bool) × Bool) :
(∀ seq, propagate init_carry next_bit seq = zeroSeq) ↔
(∀ seq, ∀ i < 2 ^ (card α), propagate init_carry next_bit seq i = false) := by
constructor
{ intro h i _
simp [h, zeroSeq] }
{ intro h seq
funext i
rcases exists_repeat init_carry next_bit seq i with ⟨j, hj, seq2, hseq2⟩
rw [← hseq2, h seq2 j hj, zeroSeq] }
lemma eq_iff_xorSeq_eq_zero (seq₁ seq₂ : ℕ → Bool) :
(∀ i, seq₁ i = seq₂ i) ↔ (∀ i, xorSeq seq₁ seq₂ i = zeroSeq i) := by
simp [Function.funext_iff, xorSeq, zeroSeq]
constructor
{ intro i _; simp [*] }
{ intro h a
specialize h a
revert h
cases (seq₁ a) <;> cases (seq₂ a) <;> simp [*] at * }
lemma eval_eq_iff_xorSeq_eq_zero (t₁ t₂ : Term) :
t₁.eval = t₂.eval ↔ (t₁.xor t₂).evalFin = λ _ => zeroSeq := by
simp only [Function.funext_iff, Term.eval, Term.evalFin,
← eq_iff_xorSeq_eq_zero, ← evalFin_eq_eval]
constructor
{ intro h seq n
have := h (λ j => if hj : j < (arity (t₁.xor t₂)) then seq ⟨j, hj⟩ else λ _ => false) n
simp at this
convert this }
{ intro h seq m
exact h (λ j => seq j) _ }
|
lemma in_sets_SUP: "i \<in> I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> space (M i) = Y) \<Longrightarrow> X \<in> sets (M i) \<Longrightarrow> X \<in> sets (SUP i\<in>I. M i)" |
args <- commandArgs(trailingOnly = TRUE)
base_folder2 <- args[1]
oracle_path2 <- args[2]
threshold2 <- args[3]
nameOfAttributeID2 <- args[4]
nameOfAttributeText2 <- args[5]
nameOfAttributeClass2 <- args[6]
if (!require(stringr)){ install.packages("stringr") }
#load the libraries...
library(stringr)
#path inputs
base_folder <- "/Users/panc/Desktop/Zurich-applied-Science/Collaborations/Marcela/eclipse/workspace/ML-pipeline/R-resources/R-scripts/documents2"
if(!is.na(base_folder2))
{
base_folder<- base_folder2
print("1) argument \"docs_location\" used in R by setwd() ")
}
setwd(base_folder)
oracle_path<- "truth_set_ICSME2015.csv"
if(!is.na(oracle_path2))
{
oracle_path<- oracle_path2
print("2) argument \"oracle_path2\" used in R by setwd() ")
}
#path output
folder_training_set_files <- "./training-set"
folder_test_set_files <- "./test-set"
# delete a directory -- must add recursive = TRUE
print("In case these folders are already present we delete them")
unlink(folder_training_set_files, recursive = TRUE)
unlink(folder_test_set_files, recursive = TRUE)
print("We create training and test set folders wehere file will be created")
dir.create(folder_training_set_files, showWarnings = FALSE, recursive = TRUE)
dir.create(folder_test_set_files, showWarnings = FALSE, recursive = TRUE)
oracle_trainingSet_path<- "./trainingSet_truth_set.csv"
oracle_testSet_path<- "./testSet_truth_set.csv"
simplified_oracle_path<- "./truth_set-simplified.csv"
print("We read the oracle file")
oracle <- read.csv(oracle_path)
threshold<- 50/100# 50%
if(!is.na(threshold2))
{
threshold<- as.numeric(threshold2)
print("3) argument \"threshold2\" used in R by setwd() ")
}
if(length(args)==6)
{
print("All fine with the arguments..")
print("We use the threshold to split the dataset in training and test set")
cut_point<- round(length(oracle[[nameOfAttributeID2]])*threshold)
oracle_trainingSet<- oracle[1:cut_point,]
oracle_testSet<- oracle[(cut_point+1):length(oracle[[nameOfAttributeID2]]),]
oracle_trainingSet[[nameOfAttributeID2]]<- as.character(oracle_trainingSet[[nameOfAttributeID2]])
oracle_testSet[[nameOfAttributeID2]]<- as.character(oracle_testSet[[nameOfAttributeID2]])
oracle_trainingSet[[nameOfAttributeText2]]<- as.character(oracle_trainingSet[[nameOfAttributeText2]])
oracle_testSet[[nameOfAttributeText2]]<- as.character(oracle_testSet[[nameOfAttributeText2]])
oracle_trainingSet[[nameOfAttributeClass2]]<- as.character(oracle_trainingSet[[nameOfAttributeClass2]])
oracle_testSet[[nameOfAttributeClass2]]<- as.character(oracle_testSet[[nameOfAttributeClass2]])
print("We write the generated training and test set in corresponding files")
write.csv(oracle_trainingSet,oracle_trainingSet_path,row.names = FALSE)
write.csv(oracle_testSet,oracle_testSet_path,row.names = FALSE)
print("--> we populate the folder of the training set")
#we populate the folder of the training set
i<- 1
for(i in 1:length(oracle_trainingSet[[nameOfAttributeID2]]))
{
path_file <- paste(folder_training_set_files,oracle_trainingSet[[nameOfAttributeID2]][i],sep="/")
corpus <- paste(oracle_trainingSet[[nameOfAttributeText2]][i],"eheh, eheh")
write(corpus,path_file)
}
#we populate the folder of the test set
print("--> we populate the folder of the test set")
i<- 1
for(i in 1:length(oracle_testSet[[nameOfAttributeID2]]))
{
path_file <- paste(folder_test_set_files,oracle_testSet[[nameOfAttributeID2]][i],sep="/")
corpus <- paste(oracle_testSet[[nameOfAttributeText2]][i],"eheh, eheh")
write(corpus,path_file)
}
print("--> we populate a simplified version of the oracle")
simplified_oracle <- oracle
simplified_oracle[[nameOfAttributeText2]] <- NULL
write.csv(simplified_oracle, simplified_oracle_path,row.names = FALSE)
}
if(length(args)!=6)
{
print("Error: some problems with the arguments of the oracle..")
}
|
/-
Copyright (c) 2018 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro, Kenny Lau, Scott Morrison
-/
import data.list.chain
import data.list.nodup
import data.list.of_fn
import data.list.zip
/-!
# Ranges of naturals as lists
This file shows basic results about `list.iota`, `list.range`, `list.range'` (all defined in
`data.list.defs`) and defines `list.fin_range`.
`fin_range n` is the list of elements of `fin n`.
`iota n = [1, ..., n]` and `range n = [0, ..., n - 1]` are basic list constructions used for
tactics. `range' a b = [a, ..., a + b - 1]` is there to help prove properties about them.
Actual maths should use `list.Ico` instead.
-/
universe u
open nat
namespace list
variables {α : Type u}
@[simp] theorem length_range' : ∀ (s n : ℕ), length (range' s n) = n
| s 0 := rfl
| s (n+1) := congr_arg succ (length_range' _ _)
@[simp] theorem range'_eq_nil {s n : ℕ} : range' s n = [] ↔ n = 0 :=
by rw [← length_eq_zero, length_range']
@[simp] theorem mem_range' {m : ℕ} : ∀ {s n : ℕ}, m ∈ range' s n ↔ s ≤ m ∧ m < s + n
| s 0 := (false_iff _).2 $ λ ⟨H1, H2⟩, not_le_of_lt H2 H1
| s (succ n) :=
have m = s → m < s + n + 1,
from λ e, e ▸ lt_succ_of_le (nat.le_add_right _ _),
have l : m = s ∨ s + 1 ≤ m ↔ s ≤ m,
by simpa only [eq_comm] using (@decidable.le_iff_eq_or_lt _ _ _ s m).symm,
(mem_cons_iff _ _ _).trans $ by simp only [mem_range',
or_and_distrib_left, or_iff_right_of_imp this, l, add_right_comm]; refl
theorem map_add_range' (a) : ∀ s n : ℕ, map ((+) a) (range' s n) = range' (a + s) n
| s 0 := rfl
| s (n+1) := congr_arg (cons _) (map_add_range' (s+1) n)
theorem map_sub_range' (a) :
∀ (s n : ℕ) (h : a ≤ s), map (λ x, x - a) (range' s n) = range' (s - a) n
| s 0 _ := rfl
| s (n+1) h :=
begin
convert congr_arg (cons (s-a)) (map_sub_range' (s+1) n (nat.le_succ_of_le h)),
rw nat.succ_sub h,
refl,
end
theorem chain_succ_range' : ∀ s n : ℕ, chain (λ a b, b = succ a) s (range' (s+1) n)
| s 0 := chain.nil
| s (n+1) := (chain_succ_range' (s+1) n).cons rfl
theorem chain_lt_range' (s n : ℕ) : chain (<) s (range' (s+1) n) :=
(chain_succ_range' s n).imp (λ a b e, e.symm ▸ lt_succ_self _)
theorem pairwise_lt_range' : ∀ s n : ℕ, pairwise (<) (range' s n)
| s 0 := pairwise.nil
| s (n+1) := (chain_iff_pairwise (by exact λ a b c, lt_trans)).1 (chain_lt_range' s n)
theorem nodup_range' (s n : ℕ) : nodup (range' s n) :=
(pairwise_lt_range' s n).imp (λ a b, ne_of_lt)
@[simp] theorem range'_append : ∀ s m n : ℕ, range' s m ++ range' (s+m) n = range' s (n+m)
| s 0 n := rfl
| s (m+1) n := show s :: (range' (s+1) m ++ range' (s+m+1) n) = s :: range' (s+1) (n+m),
by rw [add_right_comm, range'_append]
theorem range'_sublist_right {s m n : ℕ} : range' s m <+ range' s n ↔ m ≤ n :=
⟨λ h, by simpa only [length_range'] using length_le_of_sublist h,
λ h, by rw [← tsub_add_cancel_of_le h, ← range'_append]; apply sublist_append_left⟩
theorem range'_subset_right {s m n : ℕ} : range' s m ⊆ range' s n ↔ m ≤ n :=
⟨λ h, le_of_not_lt $ λ hn, lt_irrefl (s+n) $
(mem_range'.1 $ h $ mem_range'.2 ⟨nat.le_add_right _ _, nat.add_lt_add_left hn s⟩).2,
λ h, (range'_sublist_right.2 h).subset⟩
theorem nth_range' : ∀ s {m n : ℕ}, m < n → nth (range' s n) m = some (s + m)
| s 0 (n+1) _ := rfl
| s (m+1) (n+1) h := (nth_range' (s+1) (lt_of_add_lt_add_right h)).trans $
by rw add_right_comm; refl
@[simp] lemma nth_le_range' {n m} (i) (H : i < (range' n m).length) :
nth_le (range' n m) i H = n + i :=
option.some.inj $ by rw [←nth_le_nth _, nth_range' _ (by simpa using H)]
theorem range'_concat (s n : ℕ) : range' s (n + 1) = range' s n ++ [s+n] :=
by rw add_comm n 1; exact (range'_append s n 1).symm
theorem range_core_range' : ∀ s n : ℕ, range_core s (range' s n) = range' 0 (n + s)
| 0 n := rfl
| (s+1) n := by rw [show n+(s+1) = n+1+s, from add_right_comm n s 1];
exact range_core_range' s (n+1)
theorem range_eq_range' (n : ℕ) : range n = range' 0 n :=
(range_core_range' n 0).trans $ by rw zero_add
theorem range_succ_eq_map (n : ℕ) : range (n + 1) = 0 :: map succ (range n) :=
by rw [range_eq_range', range_eq_range', range',
add_comm, ← map_add_range'];
congr; exact funext one_add
@[simp] theorem length_range (n : ℕ) : length (range n) = n :=
by simp only [range_eq_range', length_range']
@[simp] theorem range_eq_nil {n : ℕ} : range n = [] ↔ n = 0 :=
by rw [← length_eq_zero, length_range]
theorem pairwise_lt_range (n : ℕ) : pairwise (<) (range n) :=
by simp only [range_eq_range', pairwise_lt_range']
theorem nodup_range (n : ℕ) : nodup (range n) :=
by simp only [range_eq_range', nodup_range']
theorem range_sublist {m n : ℕ} : range m <+ range n ↔ m ≤ n :=
by simp only [range_eq_range', range'_sublist_right]
theorem range_subset {m n : ℕ} : range m ⊆ range n ↔ m ≤ n :=
by simp only [range_eq_range', range'_subset_right]
@[simp] theorem mem_range {m n : ℕ} : m ∈ range n ↔ m < n :=
by simp only [range_eq_range', mem_range', nat.zero_le, true_and, zero_add]
@[simp] theorem not_mem_range_self {n : ℕ} : n ∉ range n :=
mt mem_range.1 $ lt_irrefl _
@[simp] theorem self_mem_range_succ (n : ℕ) : n ∈ range (n + 1) :=
by simp only [succ_pos', lt_add_iff_pos_right, mem_range]
theorem nth_range {m n : ℕ} (h : m < n) : nth (range n) m = some m :=
by simp only [range_eq_range', nth_range' _ h, zero_add]
theorem range_succ (n : ℕ) : range (succ n) = range n ++ [n] :=
by simp only [range_eq_range', range'_concat, zero_add]
@[simp] lemma range_zero : range 0 = [] := rfl
theorem iota_eq_reverse_range' : ∀ n : ℕ, iota n = reverse (range' 1 n)
| 0 := rfl
| (n+1) := by simp only [iota, range'_concat, iota_eq_reverse_range' n,
reverse_append, add_comm]; refl
@[simp] theorem length_iota (n : ℕ) : length (iota n) = n :=
by simp only [iota_eq_reverse_range', length_reverse, length_range']
theorem pairwise_gt_iota (n : ℕ) : pairwise (>) (iota n) :=
by simp only [iota_eq_reverse_range', pairwise_reverse, pairwise_lt_range']
theorem nodup_iota (n : ℕ) : nodup (iota n) :=
by simp only [iota_eq_reverse_range', nodup_reverse, nodup_range']
theorem mem_iota {m n : ℕ} : m ∈ iota n ↔ 1 ≤ m ∧ m ≤ n :=
by simp only [iota_eq_reverse_range', mem_reverse, mem_range', add_comm, lt_succ_iff]
theorem reverse_range' : ∀ s n : ℕ,
reverse (range' s n) = map (λ i, s + n - 1 - i) (range n)
| s 0 := rfl
| s (n+1) := by rw [range'_concat, reverse_append, range_succ_eq_map];
simpa only [show s + (n + 1) - 1 = s + n, from rfl, (∘),
λ a i, show a - 1 - i = a - succ i, from pred_sub _ _,
reverse_singleton, map_cons, tsub_zero, cons_append,
nil_append, eq_self_iff_true, true_and, map_map]
using reverse_range' s n
/-- All elements of `fin n`, from `0` to `n-1`. -/
def fin_range (n : ℕ) : list (fin n) :=
(range n).pmap fin.mk (λ _, list.mem_range.1)
@[simp] lemma fin_range_zero : fin_range 0 = [] := rfl
@[simp] lemma mem_fin_range {n : ℕ} (a : fin n) : a ∈ fin_range n :=
mem_pmap.2 ⟨a.1, mem_range.2 a.2, fin.eta _ _⟩
lemma nodup_fin_range (n : ℕ) : (fin_range n).nodup :=
nodup_pmap (λ _ _ _ _, fin.veq_of_eq) (nodup_range _)
@[simp] lemma length_fin_range (n : ℕ) : (fin_range n).length = n :=
by rw [fin_range, length_pmap, length_range]
@[simp] lemma fin_range_eq_nil {n : ℕ} : fin_range n = [] ↔ n = 0 :=
by rw [← length_eq_zero, length_fin_range]
@[to_additive]
theorem prod_range_succ {α : Type u} [monoid α] (f : ℕ → α) (n : ℕ) :
((range n.succ).map f).prod = ((range n).map f).prod * f n :=
by rw [range_succ, map_append, map_singleton,
prod_append, prod_cons, prod_nil, mul_one]
/-- A variant of `prod_range_succ` which pulls off the first
term in the product rather than the last.-/
@[to_additive "A variant of `sum_range_succ` which pulls off the first term in the sum
rather than the last."]
theorem prod_range_succ' {α : Type u} [monoid α] (f : ℕ → α) (n : ℕ) :
((range n.succ).map f).prod = f 0 * ((range n).map (λ i, f (succ i))).prod :=
nat.rec_on n
(show 1 * f 0 = f 0 * 1, by rw [one_mul, mul_one])
(λ _ hd, by rw [list.prod_range_succ, hd, mul_assoc, ←list.prod_range_succ])
@[simp] theorem enum_from_map_fst : ∀ n (l : list α),
map prod.fst (enum_from n l) = range' n l.length
| n [] := rfl
| n (a :: l) := congr_arg (cons _) (enum_from_map_fst _ _)
@[simp] theorem enum_map_fst (l : list α) :
map prod.fst (enum l) = range l.length :=
by simp only [enum, enum_from_map_fst, range_eq_range']
lemma enum_eq_zip_range (l : list α) :
l.enum = (range l.length).zip l :=
zip_of_prod (enum_map_fst _) (enum_map_snd _)
@[simp] lemma unzip_enum_eq_prod (l : list α) :
l.enum.unzip = (range l.length, l) :=
by simp only [enum_eq_zip_range, unzip_zip, length_range]
lemma enum_from_eq_zip_range' (l : list α) {n : ℕ} :
l.enum_from n = (range' n l.length).zip l :=
zip_of_prod (enum_from_map_fst _ _) (enum_from_map_snd _ _)
@[simp] lemma unzip_enum_from_eq_prod (l : list α) {n : ℕ} :
(l.enum_from n).unzip = (range' n l.length, l) :=
by simp only [enum_from_eq_zip_range', unzip_zip, length_range']
@[simp] lemma nth_le_range {n} (i) (H : i < (range n).length) :
nth_le (range n) i H = i :=
option.some.inj $ by rw [← nth_le_nth _, nth_range (by simpa using H)]
@[simp] lemma nth_le_fin_range {n : ℕ} {i : ℕ} (h) :
(fin_range n).nth_le i h = ⟨i, length_fin_range n ▸ h⟩ :=
by simp only [fin_range, nth_le_range, nth_le_pmap, fin.mk_eq_subtype_mk]
theorem of_fn_eq_pmap {α n} {f : fin n → α} :
of_fn f = pmap (λ i hi, f ⟨i, hi⟩) (range n) (λ _, mem_range.1) :=
by rw [pmap_eq_map_attach]; from ext_le (by simp)
(λ i hi1 hi2, by { simp at hi1, simp [nth_le_of_fn f ⟨i, hi1⟩, -subtype.val_eq_coe] })
theorem of_fn_id (n) : of_fn id = fin_range n := of_fn_eq_pmap
theorem of_fn_eq_map {α n} {f : fin n → α} :
of_fn f = (fin_range n).map f :=
by rw [← of_fn_id, map_of_fn, function.right_id]
theorem nodup_of_fn {α n} {f : fin n → α} (hf : function.injective f) :
nodup (of_fn f) :=
by rw of_fn_eq_pmap; from nodup_pmap
(λ _ _ _ _ H, fin.veq_of_eq $ hf H) (nodup_range n)
end list
|
/-
Copyright (c) 2022. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Moritz Firsching, Fabian Kruse, Nikolas Kuhn
-/
import analysis.p_series
import analysis.special_functions.log.deriv
/-!
# Stirling's formula
This file proves Theorem 90 from the [100 Theorem List] <https://www.cs.ru.nl/~freek/100/>.
It states that $n!$ grows asymptotically like $\sqrt{2\pi n}(\frac{n}{e})^n$.
TODO: Add Part 2 to complete the proof
## Proof outline
The proof follows: <https://proofwiki.org/wiki/Stirling%27s_Formula>.
### Part 1
We consider the fraction sequence $a_n$ of fractions $n!$ over $\sqrt{2n}(\frac{n}{e})^n$ and
proves that this sequence converges against a real, positve number $a$. For this the two main
ingredients are
- taking the logarithm of the sequence and
- use the series expansion of $\log(1 + x)$.
-/
open_locale topological_space big_operators
open finset filter nat real
namespace stirling
/-!
### Part 1
https://proofwiki.org/wiki/Stirling%27s_Formula#Part_1
-/
/--
Define `stirling_seq n` as $\frac{n!}{\sqrt{2n}/(\frac{n}{e})^n$.
Stirling's formula states that this sequence has limit $\sqrt(π)$.
-/
noncomputable def stirling_seq (n : ℕ) : ℝ :=
n.factorial / (sqrt (2 * n) * (n / exp 1) ^ n)
/-- Define `log_stirling_seq n` as the log of `stirling_seq n`. -/
noncomputable def log_stirling_seq (n : ℕ) : ℝ := log (stirling_seq n)
/--
We have the expression
`log_stirling_seq (n + 1) = log(n + 1)! - 1 / 2 * log(2 * n) - n * log ((n + 1) / e)`.
-/
lemma log_stirling_seq_formula (n : ℕ) : log_stirling_seq n.succ =
log n.succ.factorial - 1 / 2 * log (2 * n.succ) - n.succ * log (n.succ / exp 1) :=
begin
have h3, from sqrt_ne_zero'.mpr (mul_pos two_pos $ cast_pos.mpr (succ_pos n)),
have h4 : 0 ≠ ((n.succ : ℝ) / exp 1) ^ n.succ, from
ne_of_lt (pow_pos (div_pos (cast_pos.mpr n.succ_pos ) (exp_pos 1)) n.succ),
rw [log_stirling_seq, stirling_seq, log_div, log_mul, sqrt_eq_rpow, log_rpow, log_pow],
{ linarith },
{ refine (zero_lt_mul_left two_pos).mpr _,
rw ←cast_zero,
exact cast_lt.mpr (succ_pos n), },
{ exact h3, },
{ exact h4.symm, },
{ exact cast_ne_zero.mpr n.succ.factorial_ne_zero, },
{ apply (mul_ne_zero h3 h4.symm), },
end
/--
The sequence `log_stirling_seq (m + 1) - log_stirling_seq (m + 2)` has the series expansion
`∑ 1 / (2 * (k + 1) + 1) * (1 / 2 * (m + 1) + 1)^(2 * (k + 1))`
-/
lemma log_stirling_seq_diff_has_sum (m : ℕ) :
has_sum (λ k : ℕ, (1 : ℝ) / (2 * k.succ + 1) * ((1 / (2 * m.succ + 1)) ^ 2) ^ k.succ)
(log_stirling_seq m.succ - log_stirling_seq m.succ.succ) :=
begin
change
has_sum ((λ b : ℕ, 1 / (2 * (b : ℝ) + 1) * ((1 / (2 * m.succ + 1)) ^ 2) ^ b) ∘ succ) _,
rw has_sum_nat_add_iff 1,
convert (has_sum_log_one_add_inv $ cast_pos.mpr (succ_pos m)).mul_left ((m.succ : ℝ) + 1 / 2),
{ ext k,
rw [← pow_mul, pow_add],
push_cast,
have : 2 * (k : ℝ) + 1 ≠ 0, {norm_cast, exact succ_ne_zero (2*k)},
have : 2 * ((m : ℝ) + 1) + 1 ≠ 0, {norm_cast, exact succ_ne_zero (2*m.succ)},
field_simp,
ring },
{ have h : ∀ (x : ℝ) (hx : x ≠ 0), 1 + x⁻¹ = (x + 1) / x,
{ intros, rw [_root_.add_div, div_self hx, inv_eq_one_div], },
simp only [log_stirling_seq_formula, log_div, log_mul, log_exp, factorial_succ, cast_mul,
cast_succ, cast_zero, range_one, sum_singleton, h] { discharger :=
`[norm_cast, apply_rules [mul_ne_zero, succ_ne_zero, factorial_ne_zero, exp_ne_zero]] },
ring },
{ apply_instance }
end
/-- The sequence `log_stirling_seq ∘ succ` is monotone decreasing -/
lemma log_stirling_seq'_antitone : antitone (log_stirling_seq ∘ succ) :=
begin
apply antitone_nat_of_succ_le,
intro n,
rw [← sub_nonneg, ← succ_eq_add_one],
refine (log_stirling_seq_diff_has_sum n).nonneg _,
norm_num,
simp only [one_div],
intro m,
refine mul_nonneg _ _,
all_goals {refine inv_nonneg.mpr _, norm_cast, exact (zero_le _)},
end
/--
We have the bound `log_stirling_seq n - log_stirling_seq (n+1) ≤ 1/(2n+1)^2* 1/(1-(1/2n+1)^2)`.
-/
lemma log_stirling_seq_diff_le_geo_sum (n : ℕ) :
log_stirling_seq n.succ - log_stirling_seq n.succ.succ ≤
(1 / (2 * n.succ + 1)) ^ 2 / (1 - (1 / (2 * n.succ + 1)) ^ 2) :=
begin
have h_nonneg : 0 ≤ ((1 / (2 * (n.succ : ℝ) + 1)) ^ 2),
{ rw [cast_succ, one_div, inv_pow, inv_nonneg], norm_cast, exact zero_le', },
have g : has_sum (λ k : ℕ, ((1 / (2 * (n.succ : ℝ) + 1)) ^ 2) ^ k.succ)
((1 / (2 * n.succ + 1)) ^ 2 / (1 - (1 / (2 * n.succ + 1)) ^ 2)),
{ have h_pow_succ := λ k : ℕ,
symm (pow_succ ((1 / (2 * ((n : ℝ) + 1) + 1)) ^ 2) k),
have hlt : (1 / (2 * (n.succ : ℝ) + 1)) ^ 2 < 1,
{ simp only [cast_succ, one_div, inv_pow],
refine inv_lt_one _,
norm_cast,
simp only [nat.one_lt_pow_iff, ne.def, zero_eq_bit0, nat.one_ne_zero, not_false_iff,
lt_add_iff_pos_left, canonically_ordered_comm_semiring.mul_pos, succ_pos', and_self], },
exact (has_sum_geometric_of_lt_1 h_nonneg hlt).mul_left ((1 / (2 * (n.succ : ℝ) + 1)) ^ 2) },
have hab : ∀ (k : ℕ), (1 / (2 * (k.succ : ℝ) + 1)) * ((1 / (2 * n.succ + 1)) ^ 2) ^ k.succ ≤
((1 / (2 * n.succ + 1)) ^ 2) ^ k.succ,
{ intro k,
have h_zero_le : 0 ≤ ((1 / (2 * (n.succ : ℝ) + 1)) ^ 2) ^ k.succ := pow_nonneg h_nonneg _,
have h_left : 1 / (2 * (k.succ : ℝ) + 1) ≤ 1,
{ rw [cast_succ, one_div],
refine inv_le_one _,
norm_cast,
exact (le_add_iff_nonneg_left 1).mpr zero_le', },
exact mul_le_of_le_one_left h_zero_le h_left, },
exact has_sum_le hab (log_stirling_seq_diff_has_sum n) g,
end
/--
We have the bound `log_stirling_seq n - log_stirling_seq (n+1)` ≤ 1/(4 n^2)
-/
lemma log_stirling_seq_sub_log_stirling_seq_succ (n : ℕ) :
log_stirling_seq n.succ - log_stirling_seq n.succ.succ ≤ 1 / (4 * n.succ ^ 2) :=
begin
have h₁ : 0 < 4 * ((n : ℝ) + 1) ^ 2 := by nlinarith [@cast_nonneg ℝ _ n],
have h₃ : 0 < (2 * ((n : ℝ) + 1) + 1) ^ 2 := by nlinarith [@cast_nonneg ℝ _ n],
have h₂ : 0 < 1 - (1 / (2 * ((n : ℝ) + 1) + 1)) ^ 2,
{ rw ← mul_lt_mul_right h₃,
have H : 0 < (2 * ((n : ℝ) + 1) + 1) ^ 2 - 1 := by nlinarith [@cast_nonneg ℝ _ n],
convert H using 1; field_simp [h₃.ne'] },
refine (log_stirling_seq_diff_le_geo_sum n).trans _,
push_cast at *,
rw div_le_div_iff h₂ h₁,
field_simp [h₃.ne'],
rw div_le_div_right h₃,
ring_nf,
norm_cast,
linarith,
end
/-- For any `n`, we have `log_stirling_seq 1 - log_stirling_seq n ≤ 1/4 * ∑' 1/k^2` -/
lemma log_stirling_seq_bounded_aux :
∃ (c : ℝ), ∀ (n : ℕ), log_stirling_seq 1 - log_stirling_seq n.succ ≤ c :=
begin
let d := ∑' k : ℕ, (1 : ℝ) / k.succ ^ 2,
use (1 / 4 * d : ℝ),
let log_stirling_seq' : ℕ → ℝ := λ k : ℕ, log_stirling_seq k.succ,
intro n,
calc
log_stirling_seq 1 - log_stirling_seq n.succ = log_stirling_seq' 0 - log_stirling_seq' n : rfl
... = ∑ k in range n, (log_stirling_seq' k - log_stirling_seq' (k + 1)) : by
rw ← sum_range_sub' log_stirling_seq' n
... ≤ ∑ k in range n, (1/4) * (1 / k.succ^2) : by
{ apply sum_le_sum,
intros k hk,
convert log_stirling_seq_sub_log_stirling_seq_succ k using 1,
field_simp, }
... = 1 / 4 * ∑ k in range n, 1 / k.succ ^ 2 : by rw mul_sum
... ≤ 1 / 4 * d : by
{ refine (mul_le_mul_left _).mpr _, { exact one_div_pos.mpr four_pos, },
refine sum_le_tsum (range n) (λ k _, _)
((summable_nat_add_iff 1).mpr (real.summable_one_div_nat_pow.mpr one_lt_two)),
apply le_of_lt,
rw one_div_pos,
rw sq_pos_iff,
exact nonzero_of_invertible ↑(succ k), },
end
/-- The sequence `log_stirling_seq` is bounded below for `n ≥ 1`. -/
lemma log_stirling_seq_bounded_by_constant : ∃ c, ∀ (n : ℕ), c ≤ log_stirling_seq n.succ :=
begin
obtain ⟨d, h⟩ := log_stirling_seq_bounded_aux,
use log_stirling_seq 1 - d,
intro n,
exact sub_le.mp (h n),
end
/-- The sequence `stirling_seq` is positive for `n > 0` -/
lemma stirling_seq'_pos (n : ℕ) : 0 < stirling_seq n.succ :=
begin
dsimp only [stirling_seq],
apply_rules [div_pos, cast_pos.mpr, mul_pos, factorial_pos, exp_pos, pow_pos, real.sqrt_pos.mpr,
two_pos, succ_pos] 7 {md := reducible}; apply_instance,
end
/--
The sequence `stirling_seq` has a positive lower bound.
-/
lemma stirling_seq'_bounded_by_pos_constant : ∃ a, 0 < a ∧ ∀ n : ℕ, a ≤ stirling_seq n.succ :=
begin
cases log_stirling_seq_bounded_by_constant with c h,
refine ⟨exp c, exp_pos _, λ n, _⟩,
rw ← le_log_iff_exp_le (stirling_seq'_pos n),
exact h n,
end
/-- The sequence `stirling_seq ∘ succ` is monotone decreasing -/
lemma stirling_seq'_antitone : antitone (stirling_seq ∘ succ) :=
λ n m h, (log_le_log (stirling_seq'_pos m) (stirling_seq'_pos n)).mp (log_stirling_seq'_antitone h)
/-- The limit `a` of the sequence `stirling_seq` satisfies `0 < a` -/
lemma stirling_seq_has_pos_limit_a :
∃ (a : ℝ), 0 < a ∧ tendsto stirling_seq at_top (𝓝 a) :=
begin
obtain ⟨x, x_pos, hx⟩ := stirling_seq'_bounded_by_pos_constant,
have hx' : x ∈ lower_bounds (set.range (stirling_seq ∘ succ)) := by simpa [lower_bounds] using hx,
refine ⟨_, lt_of_lt_of_le x_pos (le_cInf (set.range_nonempty _) hx'), _⟩,
rw ←filter.tendsto_add_at_top_iff_nat 1,
exact tendsto_at_top_cinfi stirling_seq'_antitone ⟨x, hx'⟩,
end
end stirling
|
State Before: p q✝ q : ℚ≥0
⊢ ↑(num q) / ↑(den q) = q State After: case a
p q✝ q : ℚ≥0
⊢ ↑(↑(num q) / ↑(den q)) = ↑q Tactic: ext1 State Before: case a
p q✝ q : ℚ≥0
⊢ ↑(↑(num q) / ↑(den q)) = ↑q State After: case a
p q✝ q : ℚ≥0
⊢ ↑(↑q).num / ↑(den q) = ↑q Tactic: rw [coe_div, coe_natCast, coe_natCast, num, ← Int.cast_ofNat,
Int.natAbs_of_nonneg (Rat.num_nonneg_iff_zero_le.2 q.prop)] State Before: case a
p q✝ q : ℚ≥0
⊢ ↑(↑q).num / ↑(den q) = ↑q State After: no goals Tactic: exact Rat.num_div_den q |
\documentclass[main.tex]{subfiles}
\begin{document}
\subsection{Fermion masses and mixing}
\marginpar{Friday\\ 2021-12-10}
The full symmetry group of the standard model is
\(\text{SU}(3)_c \otimes \text{SU}(2)_L \otimes \text{U}(1)_Y\).
The building blocks are doublets like \((\nu_{eL}, e_L)\) with charges respectively
\(Q = 0\) and \(Q= -1\), as well as \(T_3 = +1/2\) and \(T_3 = -1/2\).
The right-handed singlets, on the other hand, also have \(Q = 0\) and \(Q=-1\)
but \(T = 0\).
Any right-handed neutrinos would be \emph{sterile}, since they do not interact.
This also holds for muonic and tauonic flavors,
as well as for quark doublets as long as we add \(2/3\) to all charges.
The relation between the quantum numbers is \(Y = 2 (Q-T_3)\).
In general the doublets look like
%
\begin{align}
\left[\begin{array}{c}
U^{\alpha } \\
D^{\alpha }
\end{array}\right]_L
\,,
\end{align}
%
where \(\alpha \) is a generation index.
The most general mass term looks like \(m \overline{\psi}_L \psi _R\) --- we should also
consider its Hermitian conjugate, but it works analogously.
As usual, we insert the Higgs field to saturate the doublets and diagonalize.
We will need to look at the effect of this change of basis on the mixing matrix.
The most general currents look like
%
\begin{align}
J^{\mu }_{EM} &= \sum _{\alpha } \overline{U}^{\alpha } \gamma^{\mu } U^{\alpha } + (U \to D) \\
J^{\mu }_{NC} &= \sum _{\alpha } \overline{U}^{\alpha }_{L} \gamma^{\mu } (T_3 - Q s^2_W) U^{\alpha }_{L}
+ \sum _{\alpha } \overline{U}^{\alpha }_{R} \gamma^{\mu } (- Q s^2_W) U^{\alpha }_{R} + (U \to D) \\
J^{\mu }_{-} &= \sum _{\alpha} \overline{U}^{\alpha }_L \gamma^{\mu } D^{\alpha }_{L} (U \to D \text{ yields } J^{\mu }_{+})
\,.
\end{align}
The coupling terms then look like \(J^{\mu }_{EM} A_\mu \), \(J^{\mu }_{NC} Z_\mu \) and \(J^{\mu }_{\mp} W^{\pm}\).
The various components will transform according to some unitary matrices:
%
\begin{align}
D^{\alpha }_{R} &= W^{\alpha \beta } D^{\beta }_{R}
\qquad \text{and} \qquad
D^{\alpha }_{L} = S^{\alpha \beta } D^{\beta }_{L} \\
U^{\alpha }_{R} &= T^{\alpha \beta } D^{\beta }_{R}
\qquad \text{and} \qquad
U^{\alpha }_{L} = R^{\alpha \beta } D^{\beta }_{L}
\,.
\end{align}
Most of the currents are left unchanged by these transformations;
the charged current however is the one which changes:
%
\begin{align}
J^{\mu }_{-} = \overline{U}_L \gamma^{\mu } \underbrace{R ^\dag S}_{\neq 1 \text{ in general}} D_L
\,.
\end{align}
The Yukawa Lagrangian will then include a term like
%
\begin{align}
\mathscr{L} \ni
\underbrace{\sum _{\alpha \beta } y^{\alpha \beta }_{D} \left[\begin{array}{cc}
\overline{U}^{\alpha } & \overline{D}^{\alpha }
\end{array}\right]_L
\left[\begin{array}{c}
0 \\
v / \sqrt{2}
\end{array}\right]
D^{\beta }_{R}}_{\text{D-type couplings}}
+ \underbrace{\sum _{ \alpha \beta } y^{\alpha \beta }_{U}
\left[\begin{array}{cc}
\overline{U}^{\alpha } & \overline{D}^{\alpha }
\end{array}\right]_L
\left[\begin{array}{c}
v / \sqrt{2} \\
0
\end{array}\right]
U^{\beta }_R}_{\text{U-type couplings}}
\,.
\end{align}
We define a mass matrix
%
\begin{align}
M^{\alpha \beta }_{U, D} = y^{\alpha \beta }_{U, D} \frac{v}{\sqrt{2}}
\,,
\end{align}
%
so that
%
\begin{align}
\mathscr{L} \ni \overline{D}_L M_D D_R + \overline{U}_L M_U U_R +
\text{h. c. }
\,.
\end{align}
How can we put the Higgs vacuum on the upper component?
We can define \(\widetilde{\phi} = i \sigma _2 \phi^{*}\).
For this field, the 1 component has zero charge while the 2 component has \(-1\) charge.
If we introduce this field, the charge of the Yukawa Lagrangian is zero.
Each of the \(M_{U, D}\) matrices will be diagonalized like \(S ^\dag M T = M _{\text{diag}}\), where \(S\) and \(T\) are both unitary.
We then have, for down-type fields: \(\overline{D}_L M_D D_R\) going into
%
\begin{align}
D_R \to W D_R \qquad D_L \to S D_L \qquad M_D \to M_D^{\text{diag}}
\,,
\end{align}
%
while \(\overline{U}_R M_U U_R\) becomes
%
\begin{align}
U_R \to T U_R \qquad U_L \to R U_L \qquad M_U \to M_U^{\text{diag}}
\,,
\end{align}
%
In general, these will be different matrices for leptons and for quarks.
The charged current then reads \(J^{\mu }_{-} = \overline{U}_L \gamma^{\mu } V D_L\), where \(V = R ^\dag S\).
More explicitly, we get
%
\begin{align}
J^{\mu }_{-} \overline{U}^{\alpha }_{L} \gamma^{\mu } V^{\alpha \beta } D^{\beta }_{L}
\,.
\end{align}
The interaction of a \(\overline{U}^{\alpha }_L\) and \(D^{\beta }_{L}\) is then modulated by a factor \((g/\sqrt{2}) V^{\alpha \beta }\).
If \(V\) were 2x2 it would be a real matrix, if it were 3x3 it would be a complex matrix.
For quarks, the values on the diagonal are close to 1, while the largest values off-diagonal are of the order \num{.22} for the CKM matrix, the mass-mixing matrix for quarks.
For example, in \(\beta \) decay we get a modulation by a factor \(V_{ud}\), which is slightly less than 1.
For leptons, the matrix is called PMNS.
In the usual construction of the Standard Model, there were no mass terms for neutrinos or right-handed \(\nu_{\alpha R}\).
Therefore, in this case there could be no mixing among leptons, since the mixing matrix only ever appears ``sandwitched''.
The basic definition of neutrino flavor is ``which lepton does it have charged current interactions with''.
For example, \(\nu _e\) is the \(\nu \) produced in \(\beta^{+} \) decay, and \(\overline{\nu}_e\) is the \(\nu \) produced in \(\beta^{-}\) decay.
Let us then consider \(\nu _e \to \nu _\mu \) oscillations.
We always need to consider the amplitudes for production, propagation, detection.
However, it is convenient to isolate the propagation into the matrix
%
\begin{align}
\left[\begin{array}{c}
\nu _e \\
\nu _\mu \\
\nu _\tau
\end{array}\right]
=
\left[\begin{array}{ccc}
U_{e1} & U_{e2} & U_{e3} \\
U_{\mu 1} & U_{\mu 2} & U_{\mu 3} \\
U_{\tau 1} & U_{\tau 2} & U_{\tau 3}
\end{array}\right]
\,.
\end{align}
Forgetting the fact that this is a simplification can lead to paradoxes;
for example, ether leptons do not oscillate.
There is a basis for the Dirac equation for which \(i \gamma^{\mu }\) is real --- this leads to the fact that \(\psi = \psi^{*}\).
This cannot work for electrons and positrons, since they are charged.
A neutral fermion, on the other hand, might be its own antiparticle.
If we have a \(\beta^{+}\) decay, we will produce a \(\nu _e\) which is left-handed.
In a \(\beta^{-}\) decay, on the other hand, we will produce a right-handed \(\overline{\nu}_e\).
If the neutrino is massless, this cannot change.
Formally, the Dirac equation decouples.
This ``Weyl'' case is not completely excluded by current phenomenology; the lightest of the neutrinos could be completely massless.
If we have massive neutrinos, though, there will be an \(\order{m_\nu / E}\) component with the opposite chirality.
However, the neutrino and antineutrino are still distinguishable.
If they are Majorana, on the other hand, \(\nu_e = \overline{\nu}_e\); this must mean that they are neutral not just for electric charge but for all charges.
We have observed inverse beta decay:
%
\begin{align}
\nu _e + \ce{n} \to \ce{p} + e^{-}
\qquad \text{and} \qquad
\overline{\nu} _e + \ce{p} \to \ce{n} + e^{+}
\,,
\end{align}
%
but not the same reaction for \(\nu _e \leftrightarrow \overline{\nu}_e\).
Is this an indication that neutrinos are indeed Dirac?
Well, if neutrinos are indeed Majorana these reactions are possible, but suppressed at order \(m_\nu / E\)!
The experiment which saw the largest number of neutrinos collected about 2 million events\dots
The way to have good statistics is to look at decays, specifically neutrinoless double-beta decay.
The decay looks like
%
\begin{align}
\{ 2 n \} \to
\{ 2 p \} + 2 e^{-}
\,.
\end{align}
The decay of the first proton looks like the emission of a right-handed \(\overline{\nu}_e\) with an \(e^{-}\), through a charged-current interaction.
IF \(m_\nu \neq 0\), the neutrino has a left-handed component (not possible if the neutrino is Weyl);
if \(\nu = \overline{\nu}\), this left-handed component is a left-handed \(\nu _e\) (not possible if the neutrino is Dirac)!
At the second proton, the left-handed \(\nu _e\) is absorbed and an \(e^{-}\) is emitted.
This process is suppressed by \(m_\nu / E\): it probes absolute neutrino mass.
Current neutrinoless double beta decay are probing lifetimes of the order of \(\num{e26}\) to \(\SI{e27}{yr}\).
It can be shown that if this process takes place, then neutrinos must be Majorana.
Pictorially, one can join the legs of the \(0 \nu \beta \beta \) diagram to find a diagram which turns a \(\nu _e\) into a \(\overline{\nu}_e\).
\end{document}
|
||| Infaces of mutable container
|||
||| Copyright 2021, HATTORI, Hiroki
||| This file is released under the MIT license, see LICENSE for more detail.
|||
module Data.Container.Mutable.Interfaces
%default total
-- --------------------------------------------------------------------------
{-
namespace Stack
public export
interface MutableStack m (a:Type -> Type) where
null : a t -> m Bool
length : a t -> m Nat
push : t -> a t -> m ()
pop : a t -> m (Maybe t)
namespace Queue
public export
interface MutableQueue m (a:Type -> Type) where
null : a t -> m Bool
length : a t -> m Nat
push : t -> a t -> m Bool
pull : a t -> m (Maybe t)
namespace Map
public export
interface MutableMap m (a: Type -> Type) k | a where
null : a v -> m Bool
length : a v -> m Nat
contains : k -> a v -> m Bool
insert : k -> v -> a v -> m Bool
lookup : k -> a v -> m (Maybe v)
delete : k -> a v -> m Bool
namespace Set
public export
interface MutableSet m (a:Type) k | a where
null : a -> m Bool
length : a -> m Bool
contains : k -> a -> m Bool
insert : k -> a -> m Bool
delete : k -> a -> m Bool
-}
-- --------------------------------------------------------------------------
-- vim: tw=80 sw=2 expandtab :
|
(* Default settings (from HsToCoq.Coq.Preamble) *)
Generalizable All Variables.
Unset Implicit Arguments.
Set Maximal Implicit Insertion.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Require Coq.Program.Tactics.
Require Coq.Program.Wf.
(* Preamble *)
(* Converted imports: *)
Require Coq.Lists.List.
Require Core.
Require CoreFVs.
Require CoreUtils.
Require Data.Foldable.
Require Data.Traversable.
Require Data.Tuple.
Require Datatypes.
Require FV.
Require Import GHC.Base.
Require GHC.Err.
Require GHC.List.
Require GHC.Num.
Require Id.
Require Name.
Require Panic.
Require UniqSupply.
Require Unique.
Import GHC.Num.Notations.
(* Converted type declarations: *)
Definition IdSubstEnv :=
(Core.IdEnv Core.CoreExpr)%type.
Inductive Subst : Type
:= Mk_Subst : Core.InScopeSet -> IdSubstEnv -> unit -> unit -> Subst.
(* Midamble *)
Instance Default_Subst : GHC.Err.Default Subst :=
GHC.Err.Build_Default _ (Mk_Subst GHC.Err.default GHC.Err.default tt tt).
(*
Definition mkOpenSubst
: Core.InScopeSet -> (list (Core.Var * Core.CoreArg) -> Subst) :=
fun in_scope pairs =>
Mk_Subst in_scope (Core.mkVarEnv (Coq.Lists.List.flat_map (fun arg_1__ => let 'pair id e := arg_1__ in
if Core.isId id then cons (pair id e) nil else
nil) pairs)) tt tt.
*)
(* Converted value declarations: *)
Definition zapSubstEnv : Subst -> Subst :=
fun '(Mk_Subst in_scope _ _ _) => Mk_Subst in_scope Core.emptyVarEnv tt tt.
Definition substTyVarBndr : Subst -> Core.Var -> Subst * Core.Var :=
fun s v => pair s v.
Definition substTy : Subst -> unit -> unit :=
fun s t => tt.
Definition substSpec : Subst -> Core.Id -> Core.RuleInfo -> Core.RuleInfo :=
fun s x r => r.
Definition substInScope : Subst -> Core.InScopeSet :=
fun '(Mk_Subst in_scope _ _ _) => in_scope.
Definition substIdType : Subst -> Core.Id -> Core.Id :=
fun arg_0__ arg_1__ =>
match arg_0__, arg_1__ with
| (Mk_Subst _ _ tv_env cv_env as subst), id =>
let old_ty := tt in if orb (andb true true) true : bool then id else id
end.
Definition substIdInfo
: Subst -> Core.Id -> Core.IdInfo -> option Core.IdInfo :=
fun subst new_id info =>
let old_unf := Core.unfoldingInfo info in
let old_rules := Core.ruleInfo info in
let nothing_to_do := andb true (negb (false)) in
if nothing_to_do : bool then None else
Some (Core.setRuleInfo info (substSpec subst new_id old_rules)).
Definition substIdBndr
: String -> Subst -> Subst -> Core.Id -> (Subst * Core.Id)%type :=
fun arg_0__ arg_1__ arg_2__ arg_3__ =>
match arg_0__, arg_1__, arg_2__, arg_3__ with
| _doc, rec_subst, (Mk_Subst in_scope env tvs cvs as subst), old_id =>
let old_ty := tt in
let no_type_change := orb (andb true true) true in
let id1 := Core.uniqAway in_scope old_id in
let id2 := if no_type_change : bool then id1 else id1 in
let mb_new_info := substIdInfo rec_subst id2 ((@Core.idInfo tt id2)) in
let new_id := Id.maybeModifyIdInfo mb_new_info id2 in
let no_change := id1 == old_id in
let new_env :=
if no_change : bool then Core.delVarEnv env old_id else
Core.extendVarEnv env old_id (Core.Mk_Var new_id) in
pair (Mk_Subst (Core.extendInScopeSet in_scope new_id) new_env tt tt) new_id
end.
Definition substRecBndrs
: Subst -> list Core.Id -> (Subst * list Core.Id)%type :=
fun subst bndrs =>
let 'pair new_subst new_bndrs := Data.Traversable.mapAccumL (substIdBndr
(Datatypes.id (GHC.Base.hs_string__ "rec-bndr"))
(GHC.Err.error Panic.someSDoc)) subst bndrs in
pair new_subst new_bndrs.
Definition substCoVarBndr : Subst -> Core.Var -> Subst * Core.Var :=
fun s v => pair s v.
Definition substCo : Subst -> unit -> unit :=
fun s c => tt.
Definition substBndr : Subst -> Core.Var -> (Subst * Core.Var)%type :=
fun subst bndr =>
if Core.isTyVar bndr : bool then substTyVarBndr subst bndr else
if Core.isCoVar bndr : bool then substCoVarBndr subst bndr else
substIdBndr (Datatypes.id (GHC.Base.hs_string__ "var-bndr")) subst subst bndr.
Definition substBndrs
: Subst -> list Core.Var -> (Subst * list Core.Var)%type :=
fun subst bndrs => Data.Traversable.mapAccumL substBndr subst bndrs.
Definition setInScope : Subst -> Core.InScopeSet -> Subst :=
fun arg_0__ arg_1__ =>
match arg_0__, arg_1__ with
| Mk_Subst _ ids tvs cvs, in_scope => Mk_Subst in_scope ids tt tt
end.
Definition mkSubst : Core.InScopeSet -> unit -> unit -> IdSubstEnv -> Subst :=
fun in_scope tvs cvs ids => Mk_Subst in_scope ids tt tt.
Definition mkOpenSubst
: Core.InScopeSet -> list (Core.Var * Core.CoreArg)%type -> Subst :=
fun in_scope pairs =>
Mk_Subst in_scope (Core.mkVarEnv (let cont_0__ arg_1__ :=
let 'pair id e := arg_1__ in
if Core.isId id : bool then cons (pair id e) nil else
nil in
Coq.Lists.List.flat_map cont_0__ pairs)) tt tt.
Definition mkEmptySubst : Core.InScopeSet -> Subst :=
fun in_scope => Mk_Subst in_scope Core.emptyVarEnv tt tt.
Definition lookupTCvSubst : Subst -> Core.TyVar -> unit :=
fun s v => tt.
Definition lookupIdSubst : String -> Subst -> Core.Id -> Core.CoreExpr :=
fun arg_0__ arg_1__ arg_2__ =>
match arg_0__, arg_1__, arg_2__ with
| doc, Mk_Subst in_scope ids _ _, v =>
if negb (Core.isLocalId v) : bool then Core.Mk_Var v else
match Core.lookupVarEnv ids v with
| Some e => e
| _ =>
match Core.lookupInScope in_scope v with
| Some v' => Core.Mk_Var v'
| _ =>
Panic.warnPprTrace (true) (GHC.Base.hs_string__
"ghc/compiler/coreSyn/CoreSubst.hs") #262 (mappend (mappend (Datatypes.id
(GHC.Base.hs_string__
"CoreSubst.lookupIdSubst"))
doc) Panic.someSDoc)
(Core.Mk_Var v)
end
end
end.
Definition substDVarSet : Subst -> Core.DVarSet -> Core.DVarSet :=
fun subst fvs =>
let subst_fv :=
fun subst fv acc =>
if Core.isId fv : bool
then CoreFVs.expr_fvs (lookupIdSubst (Datatypes.id (GHC.Base.hs_string__
"substDVarSet")) subst fv) Core.isLocalVar Core.emptyVarSet
acc else
FV.emptyFV (const true) Core.emptyVarSet acc in
Core.mkDVarSet (Data.Tuple.fst (Data.Foldable.foldr (subst_fv subst) (pair nil
Core.emptyVarSet) (Core.dVarSetElems
fvs))).
Definition substIdOcc : Subst -> Core.Id -> Core.Id :=
fun subst v =>
match lookupIdSubst (Datatypes.id (GHC.Base.hs_string__ "substIdOcc")) subst
v with
| Core.Mk_Var v' => v'
| other => Panic.panicStr (GHC.Base.hs_string__ "substIdOcc") (Panic.someSDoc)
end.
Definition substTickish
: Subst -> Core.Tickish Core.Id -> Core.Tickish Core.Id :=
fun arg_0__ arg_1__ =>
match arg_0__, arg_1__ with
| subst, Core.Breakpoint n ids =>
let do_one :=
CoreUtils.getIdFromTrivialExpr ∘
lookupIdSubst (Datatypes.id (GHC.Base.hs_string__ "subst_tickish")) subst in
Core.Breakpoint n (map do_one ids)
| _subst, other => other
end.
Definition substBind : Subst -> Core.CoreBind -> (Subst * Core.CoreBind)%type :=
fix subst_expr doc subst expr
:= let go_alt :=
fun arg_0__ arg_1__ =>
match arg_0__, arg_1__ with
| subst, pair (pair con bndrs) rhs =>
let 'pair subst' bndrs' := substBndrs subst bndrs in
pair (pair con bndrs') (subst_expr doc subst' rhs)
end in
let fix go arg_5__
:= match arg_5__ with
| Core.Mk_Var v => lookupIdSubst (doc) subst v
| Core.Type_ ty => Core.Type_ (substTy subst ty)
| Core.Coercion co => Core.Coercion (substCo subst co)
| Core.Lit lit => Core.Lit lit
| Core.App fun_ arg => Core.App (go fun_) (go arg)
| Core.Tick tickish e => CoreUtils.mkTick (substTickish subst tickish) (go e)
| Core.Cast e co => Core.Cast (go e) (substCo subst co)
| Core.Lam bndr body =>
let 'pair subst' bndr' := substBndr subst bndr in
Core.Lam bndr' (subst_expr doc subst' body)
| Core.Let bind body =>
let 'pair subst' bind' := substBind subst bind in
Core.Let bind' (subst_expr doc subst' body)
| Core.Case scrut bndr ty alts =>
let 'pair subst' bndr' := substBndr subst bndr in
Core.Case (go scrut) bndr' (substTy subst ty) (map (go_alt subst') alts)
end in
go expr with substBind arg_0__ arg_1__
:= match arg_0__, arg_1__ with
| subst, Core.NonRec bndr rhs =>
let 'pair subst' bndr' := substBndr subst bndr in
pair subst' (Core.NonRec bndr' (subst_expr (Datatypes.id (GHC.Base.hs_string__
"substBind")) subst rhs))
| subst, Core.Rec pairs =>
let 'pair bndrs rhss := GHC.List.unzip pairs in
let 'pair subst' bndrs' := substRecBndrs subst bndrs in
let rhss' :=
map (fun ps =>
subst_expr (Datatypes.id (GHC.Base.hs_string__ "substBind")) subst' (snd ps))
pairs in
pair subst' (Core.Rec (GHC.List.zip bndrs' rhss'))
end for substBind.
Definition subst_expr : String -> Subst -> Core.CoreExpr -> Core.CoreExpr :=
fix subst_expr doc subst expr
:= let go_alt :=
fun arg_0__ arg_1__ =>
match arg_0__, arg_1__ with
| subst, pair (pair con bndrs) rhs =>
let 'pair subst' bndrs' := substBndrs subst bndrs in
pair (pair con bndrs') (subst_expr doc subst' rhs)
end in
let fix go arg_5__
:= match arg_5__ with
| Core.Mk_Var v => lookupIdSubst (doc) subst v
| Core.Type_ ty => Core.Type_ (substTy subst ty)
| Core.Coercion co => Core.Coercion (substCo subst co)
| Core.Lit lit => Core.Lit lit
| Core.App fun_ arg => Core.App (go fun_) (go arg)
| Core.Tick tickish e => CoreUtils.mkTick (substTickish subst tickish) (go e)
| Core.Cast e co => Core.Cast (go e) (substCo subst co)
| Core.Lam bndr body =>
let 'pair subst' bndr' := substBndr subst bndr in
Core.Lam bndr' (subst_expr doc subst' body)
| Core.Let bind body =>
let 'pair subst' bind' := substBind subst bind in
Core.Let bind' (subst_expr doc subst' body)
| Core.Case scrut bndr ty alts =>
let 'pair subst' bndr' := substBndr subst bndr in
Core.Case (go scrut) bndr' (substTy subst ty) (map (go_alt subst') alts)
end in
go expr with substBind arg_0__ arg_1__
:= match arg_0__, arg_1__ with
| subst, Core.NonRec bndr rhs =>
let 'pair subst' bndr' := substBndr subst bndr in
pair subst' (Core.NonRec bndr' (subst_expr (Datatypes.id (GHC.Base.hs_string__
"substBind")) subst rhs))
| subst, Core.Rec pairs =>
let 'pair bndrs rhss := GHC.List.unzip pairs in
let 'pair subst' bndrs' := substRecBndrs subst bndrs in
let rhss' :=
map (fun ps =>
subst_expr (Datatypes.id (GHC.Base.hs_string__ "substBind")) subst' (snd ps))
pairs in
pair subst' (Core.Rec (GHC.List.zip bndrs' rhss'))
end for subst_expr.
Definition substExpr : String -> Subst -> Core.CoreExpr -> Core.CoreExpr :=
fun doc subst orig_expr => subst_expr doc subst orig_expr.
Definition substRule
: Subst -> (Name.Name -> Name.Name) -> Core.CoreRule -> Core.CoreRule :=
fun arg_0__ arg_1__ arg_2__ =>
match arg_0__, arg_1__, arg_2__ with
| _, _, (Core.BuiltinRule _ _ _ _ as rule) => rule
| subst
, subst_ru_fn
, (Core.Rule _ _ fn_name _ bndrs args rhs _ _ _ is_local as rule) =>
let 'pair subst' bndrs' := substBndrs subst bndrs in
let doc :=
mappend (Datatypes.id (GHC.Base.hs_string__ "subst-rule")) Panic.someSDoc in
match rule with
| Core.Rule ru_name_5__ ru_act_6__ ru_fn_7__ ru_rough_8__ ru_bndrs_9__
ru_args_10__ ru_rhs_11__ ru_auto_12__ ru_origin_13__ ru_orphan_14__
ru_local_15__ =>
Core.Rule ru_name_5__ ru_act_6__ (if is_local : bool
then subst_ru_fn fn_name
else fn_name) ru_rough_8__ bndrs' (map (substExpr doc subst') args) (substExpr
(Datatypes.id (GHC.Base.hs_string__ "foo")) subst' rhs) ru_auto_12__
ru_origin_13__ ru_orphan_14__ ru_local_15__
| Core.BuiltinRule _ _ _ _ =>
GHC.Err.error (GHC.Base.hs_string__ "Partial record update")
end
end.
Definition substRulesForImportedIds
: Subst -> list Core.CoreRule -> list Core.CoreRule :=
fun subst rules =>
let not_needed :=
fun name =>
Panic.panicStr (GHC.Base.hs_string__ "substRulesForImportedIds")
(Panic.someSDoc) in
map (substRule subst not_needed) rules.
Definition isInScope : Core.Var -> Subst -> bool :=
fun arg_0__ arg_1__ =>
match arg_0__, arg_1__ with
| v, Mk_Subst in_scope _ _ _ => Core.elemInScopeSet v in_scope
end.
Definition isEmptySubst : Subst -> bool :=
fun '(Mk_Subst _ id_env tv_env cv_env) =>
andb (Core.isEmptyVarEnv id_env) (andb true true).
Definition substBindSC
: Subst -> Core.CoreBind -> (Subst * Core.CoreBind)%type :=
fun subst bind =>
if negb (isEmptySubst subst) : bool then substBind subst bind else
match bind with
| Core.NonRec bndr rhs =>
let 'pair subst' bndr' := substBndr subst bndr in
pair subst' (Core.NonRec bndr' rhs)
| Core.Rec pairs =>
let 'pair bndrs rhss := GHC.List.unzip pairs in
let 'pair subst' bndrs' := substRecBndrs subst bndrs in
let rhss' :=
if isEmptySubst subst' : bool then rhss else
map (subst_expr (Datatypes.id (GHC.Base.hs_string__ "substBindSC")) subst')
rhss in
pair subst' (Core.Rec (GHC.List.zip bndrs' rhss'))
end.
Definition substExprSC : String -> Subst -> Core.CoreExpr -> Core.CoreExpr :=
fun doc subst orig_expr =>
if isEmptySubst subst : bool then orig_expr else
subst_expr doc subst orig_expr.
Definition getTCvSubst : Subst -> unit :=
fun s => tt.
Definition extendTvSubstList : Subst -> list (Core.TyVar * unit) -> Subst :=
fun s vs => s.
Definition extendTvSubst : Subst -> Core.TyVar -> unit -> Subst :=
fun s v t => s.
Definition extendInScopeList : Subst -> list Core.Var -> Subst :=
fun arg_0__ arg_1__ =>
match arg_0__, arg_1__ with
| Mk_Subst in_scope ids tvs cvs, vs =>
Mk_Subst (Core.extendInScopeSetList in_scope vs) (Core.delVarEnvList ids vs) tt
tt
end.
Definition extendInScopeIds : Subst -> list Core.Id -> Subst :=
fun arg_0__ arg_1__ =>
match arg_0__, arg_1__ with
| Mk_Subst in_scope ids tvs cvs, vs =>
Mk_Subst (Core.extendInScopeSetList in_scope vs) (Core.delVarEnvList ids vs) tt
tt
end.
Definition extendInScope : Subst -> Core.Var -> Subst :=
fun arg_0__ arg_1__ =>
match arg_0__, arg_1__ with
| Mk_Subst in_scope ids tvs cvs, v =>
Mk_Subst (Core.extendInScopeSet in_scope v) (Core.delVarEnv ids v) tt tt
end.
Definition extendIdSubstList
: Subst -> list (Core.Id * Core.CoreExpr)%type -> Subst :=
fun arg_0__ arg_1__ =>
match arg_0__, arg_1__ with
| Mk_Subst in_scope ids tvs cvs, prs =>
Mk_Subst in_scope (Core.extendVarEnvList ids prs) tt tt
end.
Definition extendIdSubst : Subst -> Core.Id -> Core.CoreExpr -> Subst :=
fun arg_0__ arg_1__ arg_2__ =>
match arg_0__, arg_1__, arg_2__ with
| Mk_Subst in_scope ids tvs cvs, v, r =>
Mk_Subst in_scope (Core.extendVarEnv ids v r) tt tt
end.
Definition extendCvSubst : Subst -> Core.CoVar -> unit -> Subst :=
fun s v t => s.
Definition extendSubst : Subst -> Core.Var -> Core.CoreArg -> Subst :=
fun subst var arg =>
match arg with
| Core.Type_ ty => extendTvSubst subst var ty
| Core.Coercion co => extendCvSubst subst var co
| _ => extendIdSubst subst var arg
end.
Definition extendSubstList
: Subst -> list (Core.Var * Core.CoreArg)%type -> Subst :=
fix extendSubstList arg_0__ arg_1__
:= match arg_0__, arg_1__ with
| subst, nil => subst
| subst, cons (pair var rhs) prs =>
extendSubstList (extendSubst subst var rhs) prs
end.
Definition extendSubstWithVar : Subst -> Core.Var -> Core.Var -> Subst :=
fun subst v1 v2 =>
if Core.isTyVar v1 : bool then extendTvSubst subst v1 (tt) else
if Core.isCoVar v1 : bool then extendCvSubst subst v1 (tt) else
extendIdSubst subst v1 (Core.Mk_Var v2).
Definition emptySubst : Subst :=
Mk_Subst Core.emptyInScopeSet Core.emptyVarEnv tt tt.
Definition delBndrs : Subst -> list Core.Var -> Subst :=
fun arg_0__ arg_1__ =>
match arg_0__, arg_1__ with
| Mk_Subst in_scope ids tvs cvs, vs =>
Mk_Subst in_scope (Core.delVarEnvList ids vs) tt tt
end.
Definition delBndr : Subst -> Core.Var -> Subst :=
fun arg_0__ arg_1__ =>
match arg_0__, arg_1__ with
| Mk_Subst in_scope ids tvs cvs, v =>
if Core.isCoVar v : bool then Mk_Subst in_scope ids tt tt else
if Core.isTyVar v : bool then Mk_Subst in_scope ids tt tt else
Mk_Subst in_scope (Core.delVarEnv ids v) tt tt
end.
Definition deShadowBinds : Core.CoreProgram -> Core.CoreProgram :=
fun binds =>
Data.Tuple.snd (Data.Traversable.mapAccumL substBind emptySubst binds).
Definition clone_id
: Subst -> Subst -> (Core.Id * Unique.Unique)%type -> (Subst * Core.Id)%type :=
fun arg_0__ arg_1__ arg_2__ =>
match arg_0__, arg_1__, arg_2__ with
| rec_subst, (Mk_Subst in_scope idvs tvs cvs as subst), pair old_id uniq =>
let id1 := Core.setVarUnique old_id uniq in
let id2 := substIdType subst id1 in
let new_id :=
Id.maybeModifyIdInfo (substIdInfo rec_subst id2 ((@Core.idInfo tt old_id)))
id2 in
let 'pair new_idvs new_cvs := (if Core.isCoVar old_id : bool
then pair idvs cvs else
pair (Core.extendVarEnv idvs old_id (Core.Mk_Var new_id)) cvs) in
pair (Mk_Subst (Core.extendInScopeSet in_scope new_id) new_idvs tt tt) new_id
end.
Definition cloneTyVarBndr
: Subst -> Core.TyVar -> Unique.Unique -> Subst * Core.TyVar :=
fun s v u => pair s v.
Definition cloneRecIdBndrs
: Subst ->
UniqSupply.UniqSupply -> list Core.Id -> (Subst * list Core.Id)%type :=
fun subst us ids =>
let 'pair subst' ids' := Data.Traversable.mapAccumL (clone_id (GHC.Err.error
Panic.someSDoc)) subst (GHC.List.zip ids
(UniqSupply.uniqsFromSupply
us)) in
pair subst' ids'.
Definition cloneIdBndrs
: Subst ->
UniqSupply.UniqSupply -> list Core.Id -> (Subst * list Core.Id)%type :=
fun subst us ids =>
Data.Traversable.mapAccumL (clone_id subst) subst (GHC.List.zip ids
(UniqSupply.uniqsFromSupply us)).
Definition cloneIdBndr
: Subst -> UniqSupply.UniqSupply -> Core.Id -> (Subst * Core.Id)%type :=
fun subst us old_id =>
clone_id subst subst (pair old_id (UniqSupply.uniqFromSupply us)).
Definition cloneBndr
: Subst -> Unique.Unique -> Core.Var -> (Subst * Core.Var)%type :=
fun subst uniq v =>
if Core.isTyVar v : bool then cloneTyVarBndr subst v uniq else
clone_id subst subst (pair v uniq).
Definition cloneBndrs
: Subst ->
UniqSupply.UniqSupply -> list Core.Var -> (Subst * list Core.Var)%type :=
fun subst us vs =>
Data.Traversable.mapAccumL (fun arg_0__ arg_1__ =>
match arg_0__, arg_1__ with
| subst, pair v u => cloneBndr subst u v
end) subst (GHC.List.zip vs (UniqSupply.uniqsFromSupply us)).
Definition addInScopeSet : Subst -> Core.VarSet -> Subst :=
fun arg_0__ arg_1__ =>
match arg_0__, arg_1__ with
| Mk_Subst in_scope ids tvs cvs, vs =>
Mk_Subst (Core.extendInScopeSetSet in_scope vs) ids tt tt
end.
(* Skipping all instances of class `Outputable.Outputable', including
`CoreSubst.Outputable__Subst' *)
(* External variables:
None Some String andb bool cons const false list map mappend negb nil
op_z2218U__ op_zeze__ op_zt__ option orb pair snd true tt unit
Coq.Lists.List.flat_map Core.App Core.Breakpoint Core.BuiltinRule Core.Case
Core.Cast Core.CoVar Core.Coercion Core.CoreArg Core.CoreBind Core.CoreExpr
Core.CoreProgram Core.CoreRule Core.DVarSet Core.Id Core.IdEnv Core.IdInfo
Core.InScopeSet Core.Lam Core.Let Core.Lit Core.Mk_Var Core.NonRec Core.Rec
Core.Rule Core.RuleInfo Core.Tick Core.Tickish Core.TyVar Core.Type_ Core.Var
Core.VarSet Core.dVarSetElems Core.delVarEnv Core.delVarEnvList
Core.elemInScopeSet Core.emptyInScopeSet Core.emptyVarEnv Core.emptyVarSet
Core.extendInScopeSet Core.extendInScopeSetList Core.extendInScopeSetSet
Core.extendVarEnv Core.extendVarEnvList Core.idInfo Core.isCoVar
Core.isEmptyVarEnv Core.isId Core.isLocalId Core.isLocalVar Core.isTyVar
Core.lookupInScope Core.lookupVarEnv Core.mkDVarSet Core.mkVarEnv Core.ruleInfo
Core.setRuleInfo Core.setVarUnique Core.unfoldingInfo Core.uniqAway
CoreFVs.expr_fvs CoreUtils.getIdFromTrivialExpr CoreUtils.mkTick
Data.Foldable.foldr Data.Traversable.mapAccumL Data.Tuple.fst Data.Tuple.snd
Datatypes.id FV.emptyFV GHC.Err.error GHC.List.unzip GHC.List.zip
GHC.Num.fromInteger Id.maybeModifyIdInfo Name.Name Panic.panicStr Panic.someSDoc
Panic.warnPprTrace UniqSupply.UniqSupply UniqSupply.uniqFromSupply
UniqSupply.uniqsFromSupply Unique.Unique
*)
|
module PLFI.Part1.Equality
import Syntax.PreorderReasoning
data Equal0 : {t : Type} -> (x : t) -> t -> Type where
Refl0 : Equal0 x x
{-
public export
data Equal : forall a, b . a -> b -> Type where
[search a b]
Refl : {0 x : a} -> Equal x x
(~=~) : (x : a) -> (y : b) -> Type
(~=~) = Equal
-}
%hide sym
%hide trans
%hide cong
sym : {A : Type} -> {x, y : A} ->
x = y ->
----------
y = x
sym Refl = Refl
trans : {A : Type} -> {x,y,z : A} ->
x = y ->
y = z ->
----------
x = z
trans Refl p = ?h1
trans1 : {ta,tb,tc : Type} -> {x : ta} -> {y : tb} -> {z : tc} ->
x ~=~ y ->
y ~=~ z ->
----------
x ~=~ z
trans1 {tb = ta} {tc = ta} Refl Refl = Refl
{-
public export
data Equal : forall a, b . a -> b -> Type where
[search a b]
Refl : {0 x : a} -> Equal x x
(~=~) : (x : a) -> (y : b) -> Type
(~=~) = Equal
-}
cong : {A, B : Type} -> (f : A -> B) -> {x, y : A} ->
x = y ->
-----------
f x = f y
cong f Refl = Refl
-- Wrong:
-- injectivity : {A, B : Type} -> (f : A -> B) -> {x, y : A} ->
-- f x = f y ->
-- ------------
-- x = y
-- injectivity f {x} {y} Refl = ?injectivity_rhs
congApp : {A, B : Type} -> {f, g : A -> B} ->
f = g ->
--------------------
forall x . f x = g x
congApp Refl = Refl
subst : {A : Type} -> {x, y : A} -> (P : A -> Type) ->
x = y ->
----------
P x -> P y
subst p Refl = \z => z
-- Chain of equations
{-
||| Until Idris2 starts supporting the 'syntax' keyword, here's a
||| poor-man's equational reasoning
module Syntax.PreorderReasoning
infixl 0 ~~
prefix 1 |~
infix 1 ...
|||Slightly nicer syntax for justifying equations:
|||```
||| |~ a
||| ~~ b ...( justification )
|||```
|||and we can think of the `...( justification )` as ASCII art for a thought bubble.
public export
data Step : a -> b -> Type where
(...) : (0 y : a) -> (0 step : x ~=~ y) -> Step x y
public export
data FastDerivation : (x : a) -> (y : b) -> Type where
(|~) : (0 x : a) -> FastDerivation x x
(~~) : FastDerivation x y -> (step : Step y z) -> FastDerivation x z
public export
Calc : {0 x : a} -> {0 y : b} -> FastDerivation x y -> x ~=~ y
Calc (|~ x) = Refl
Calc ((~~) der (_ ...(Refl))) = Calc der
-- requires import Data.Nat
0
example : (x : Nat) -> (x + 1) + 0 = 1 + x
example x =
Calc $
|~ (x + 1) + 0
~~ x+1 ...( plusZeroRightNeutral $ x + 1 )
~~ 1+x ...( plusCommutative x 1 )
-}
trans' : {a : Type} -> {x,y,z : a} ->
x = y ->
y = z ->
--------
x = z
trans' {a,x,y,z} xy yz =
Calc $
|~ x
~~ y ... ( xy )
~~ z ... ( yz )
-- Chain of equations another example
plusIdentity : forall m . m + Z = m
plusSucc : forall m . forall n . m + S n = S (m + n)
plusComm : (m, n : Nat) -> m + n = n + m
plusComm m 0 = Calc $
|~ m + Z
~~ m ... (plusIdentity)
plusComm m (S k) = Calc $
|~ m + (S k)
~~ S (m + k) ... (plusSucc)
~~ S (k + m) ... (cong S (plusComm m k))
~~ (S k) + m ... (Refl)
-- Exercise LTE-Reasoning (strech)
-- Rewriting
|
Require Import VST.floyd.proofauto.
Require Import CertiGraph.binheap.binary_heap_Zmodel.
Require Export CertiGraph.binheap.binary_heap_pro.
Require Export CertiGraph.binheap.env_binary_heap_pro.
Definition exch_spec :=
DECLARE _exch WITH j : Z, k : Z, arr: val, arr_contents: list heap_item, lookup : val, lookup_contents : list Z
PRE [tuint, tuint, tptr t_item, tptr tuint]
PROP (0 <= j < Zlength arr_contents; 0 <= k < Zlength arr_contents;
Zlength arr_contents <= Int.max_unsigned;
Zlength lookup_contents <= Int.max_unsigned)
PARAMS (Vint (Int.repr j); Vint (Int.repr k); arr; lookup)
GLOBALS ()
SEP (linked_heap_array arr_contents arr lookup_contents lookup)
POST [tvoid]
EX lookup_contents' : list Z,
PROP (lookup_oob_eq (Zexchange arr_contents j k) lookup_contents lookup_contents')
LOCAL ()
SEP (linked_heap_array (Zexchange arr_contents j k) arr lookup_contents' lookup).
Definition less_spec :=
DECLARE _less WITH i : Z, j : Z, arr: val, arr_contents: list heap_item, arr' : val, lookup : list Z
PRE [tuint, tuint, tptr t_item]
PROP (0 <= i < Zlength arr_contents; 0 <= j < Zlength arr_contents;
Zlength arr_contents <= Int.max_unsigned)
PARAMS (Vint (Int.repr i); Vint (Int.repr j); arr)
GLOBALS ()
SEP (linked_heap_array arr_contents arr lookup arr')
POST [tint]
PROP ()
LOCAL (temp ret_temp (Val.of_bool (cmp (Znth i arr_contents) (Znth j arr_contents))))
SEP (linked_heap_array arr_contents arr lookup arr').
Definition swim_spec :=
DECLARE _swim WITH k : Z, arr: val, arr_contents: list heap_item, lookup : val, lookup_contents : list Z
PRE [tuint, tptr t_item, tptr tuint]
PROP (0 <= k < Zlength arr_contents;
weak_heap_ordered_bottom_up arr_contents k;
Zlength arr_contents <= Int.max_unsigned;
Zlength lookup_contents <= Int.max_unsigned)
PARAMS (Vint (Int.repr k); arr; lookup)
GLOBALS ()
SEP (linked_heap_array arr_contents arr lookup_contents lookup)
POST [tvoid]
EX arr_contents' : list (Z * int * int), EX lookup_contents' : list Z,
PROP (lookup_oob_eq arr_contents' lookup_contents lookup_contents';
heap_ordered arr_contents'; Permutation arr_contents arr_contents')
LOCAL ()
SEP (linked_heap_array arr_contents' arr lookup_contents' lookup).
Definition sink_spec :=
DECLARE _sink WITH k : Z, arr: val, arr_contents: list heap_item, first_available : Z, lookup : val, lookup_contents : list Z
PRE [tuint, tptr t_item, tuint, tptr tuint]
PROP (0 <= k <= Zlength arr_contents;
first_available = Zlength arr_contents;
(k = Zlength arr_contents -> (2 * k) <= Int.max_unsigned);
(k < Zlength arr_contents -> (2 * (first_available - 1) <= Int.max_unsigned)); (* i = fa - 1 -> (2 * i + 1) = 2 * fa - 1, must be representable *)
weak_heap_ordered_top_down arr_contents k;
Zlength lookup_contents <= Int.max_unsigned)
PARAMS (Vint (Int.repr k); arr; Vint (Int.repr first_available); lookup)
GLOBALS ()
SEP (linked_heap_array arr_contents arr lookup_contents lookup)
POST [tvoid]
EX arr_contents' : list heap_item, EX lookup_contents' : list Z,
PROP (lookup_oob_eq arr_contents' lookup_contents lookup_contents';
heap_ordered arr_contents'; Permutation arr_contents arr_contents')
LOCAL ()
SEP (linked_heap_array arr_contents' arr lookup_contents' lookup).
Definition pq_size_spec :=
DECLARE _pq_size WITH pq : val, h : heap
PRE [tptr t_pq]
PROP ()
PARAMS (pq)
GLOBALS ()
SEP (valid_pq pq h)
POST [tuint]
PROP ()
LOCAL (temp ret_temp (Vint (Int.repr (heap_size h))))
SEP (valid_pq pq h).
Definition capacity_spec :=
DECLARE _capacity WITH pq : val, h : heap
PRE [tptr t_pq]
PROP ()
PARAMS (pq)
GLOBALS ()
SEP (valid_pq pq h)
POST [tuint]
PROP ()
LOCAL (temp ret_temp (Vint (Int.repr (heap_capacity h))))
SEP (valid_pq pq h).
Definition pq_remove_min_nc_spec :=
DECLARE _pq_remove_min_nc WITH pq : val, h : heap, i : val
PRE [tptr t_pq, tptr t_item]
PROP (heap_size h > 0)
PARAMS (pq; i)
GLOBALS ()
SEP (valid_pq pq h; hitem_ i)
POST [tvoid]
EX h', EX iv : heap_item,
PROP (heap_capacity h = heap_capacity h';
Permutation (heap_items h) (iv :: heap_items h');
Forall (cmp_rel iv) (heap_items h'))
LOCAL ()
SEP (valid_pq pq h'; hitem iv i).
Definition pq_insert_nc_spec :=
DECLARE _pq_insert_nc WITH pq : val, h : heap, priority : Z, data : int
PRE [tptr t_pq, tint, tint]
PROP (heap_size h < heap_capacity h)
PARAMS (pq; Vint (Int.repr priority); Vint data)
GLOBALS ()
SEP (valid_pq pq h)
POST [tuint]
EX h' : heap, EX key : Z,
PROP (heap_capacity h = heap_capacity h';
Permutation (((key, Int.repr priority, data): heap_item) :: heap_items h) (heap_items h'))
LOCAL (temp ret_temp (Vint (Int.repr key)))
SEP (valid_pq pq h').
Definition pq_make_spec :=
DECLARE _pq_make WITH size : Z
PRE [tuint]
PROP (4 <= 12 * size <= Int.max_unsigned)
PARAMS (Vint (Int.repr size))
GLOBALS ()
SEP ()
POST [tptr t_pq]
EX pq: val, EX h : heap,
PROP (heap_size h = 0;
heap_capacity h = size)
LOCAL (temp ret_temp pq)
SEP (valid_pq pq h). (* and the free_toks I get from mallocN *)
Definition pq_free_spec :=
DECLARE _pq_free WITH pq : val, h : heap
PRE [tptr t_pq]
PROP ()
PARAMS (pq)
GLOBALS ()
SEP (valid_pq pq h) (* and the free toks I get from pq_make*)
POST [tvoid]
PROP ()
LOCAL ()
SEP (emp).
Definition pq_edit_priority_spec :=
DECLARE _pq_edit_priority WITH pq : val, h : heap, key : Z, newpri : int
PRE [tptr t_pq, tint, tint]
PROP (In key (proj_keys h))
PARAMS (pq; Vint (Int.repr (key)); Vint newpri)
GLOBALS ()
SEP (valid_pq pq h) (* and the free toks I get from pq_make*)
POST [tvoid]
EX h': heap,
PROP (Permutation (heap_items h') (update_pri_by_key (heap_items h) key newpri);
heap_capacity h' = heap_capacity h)
LOCAL ()
SEP (valid_pq pq h').
|
lemma tl_cCons [simp]: "tl (x ## xs) = xs" |
import Tulip
using SparseArrays
@testset "LinearSolver" begin
# TODO: Tulip constructor
Aref = [
1.0 0.0 1.1 1.2 1.3 1.4;
0.0 1.0 2.1 2.2 2.3 2.4;
1.0 0.0 3.1 3.2 3.3 3.4;
0.0 0.0 1.0 0.0 1.0 0.0;
0.0 0.0 0.0 1.0 0.0 1.0
]
m0, n0, n, R = 3, 2, 4, 2
M, N = m0 + R, n0 + n
B0 = Aref[1:3, 1:2]
B = Aref[1:3, 3:end]
blocks = [1, 2, 1, 2]
A = UnitBlockAngularMatrix(B0, B, R, blocks)
ls = UnitBlockAngularFactor(A)
θ = ones(N)
regP = 1e-2 .* ones(N)
regD = 1e-2 .* ones(M)
Tulip.KKT.update!(ls, θ, regP, regD)
dx = zeros(N)
dy = zeros(M)
ξp = ones(M)
ξd = ones(N)
Tulip.KKT.solve!(dx, dy, ls, ξp, ξd)
lsref = Tulip.KKT.Dense_SymPosDef(Aref)
Tulip.KKT.update!(lsref, θ, regP, regD)
dxref = zeros(N)
dyref = zeros(M)
Tulip.KKT.solve!(dxref, dyref, lsref, ξp, ξd)
@test dx ≈ dxref
@test dy ≈ dyref
end
@testset "Optimize" begin
Aref = sparse([
1.0 -1.0 0.0 0.0 1.1 1.2 1.3 1.4;
0.0 0.0 1.0 -1.0 2.1 2.2 2.3 2.4;
0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0;
0.0 0.0 0.0 0.0 0.0 1.0 0.0 1.0
])
m0, n0, n, R = 2, 4, 4, 2
obj = [10000, 10000, 10000, 10000, 10, 20, 100, 200.0]
lvar = zeros(8)
uvar = fill(Inf, 8)
lcon = ones(4)
ucon = ones(4)
connames = fill("", 4)
varnames = fill("", 8)
m = Tulip.Model{Float64}()
m.params.OutputLevel = 1
m.params.Presolve = 0
m.params.MatrixOptions = Tulip.TLA.MatrixOptions(UnitBlockAngularMatrix; m0=m0, n0=n0, n=n, R=R)
m.params.KKTOptions = Tulip.KKT.SolverOptions(UnitBlockAngularFactor)
Tulip.load_problem!(m.pbdata, "Test", true, obj, 0.0, Aref, lcon, ucon, lvar, uvar, connames, varnames)
Tulip.optimize!(m)
end |
# Example : 2 Chapter : 2.5 Pageno : 82
# Inverse of an Elimination Matrix
E<-matrix(c(1,-5,0,0,1,0,0,0,1),ncol=3)
E1<-solve(E)
print("The inverse of the given elimination matrix is")
print(E1) |
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Lib
import Numeric.AD
import Numeric.AD.Internal.Forward
import Numeric.AD.Rank1.Tower(Tower)
import Numeric.SpecFunctions
import Data.Csv
import qualified Data.ByteString.Lazy.Char8 as C
--c :: Num a => (a -> a) -> a -> a -> a
difference :: Fractional a => (forall s. AD s (Tower a) -> AD s (Tower a)) -> a -> (forall s. AD s (Tower a) -> AD s (Tower a))
difference v base = \x -> v x - v (auto base)
difference' :: Num a => (t -> a) -> t -> t -> a
difference' v base x = v x - v base
optValLin :: Num a => a -> a
optValLin r = 1000 * r
optValQuad :: Num a => a -> a
--optValQuad r = 1000 * (r + r*r)
optValQuad r = 10000 * (r*r) + 10* r
-- Truncate a taylor exapansion
-- If nothing don't take a taylor expansion just evaluate the 0th derivative a.k.a zero
trunTay :: Fractional a => Maybe Int -> (forall s. AD s (Tower a) -> AD s (Tower a)) -> a -> a -> a
trunTay Nothing f centre x = (diffs f x)!!0
trunTay (Just n) f centre x = foldr (+) 0 $ take (n+1) $ (taylor0 f centre (x-centre))
-- create convexity correction function
-- takes a function and two points and calculates the adjustment needed for the difference
convexityAdj :: Fractional a => (forall s. AD s (Tower a) -> AD s (Tower a)) -> a -> a -> a
convexityAdj f centre b = difference' (\x -> trunTay (Just x) (difference f centre) centre b ) 1 2
main :: IO ()
main = do
--tr (Just 1) (c d 0.02) 0.02 0.04
print $ trunTay (Just 0) (difference optValLin 0.02) 0.02 0.04
--print $ trunTay (Just 1) (difference optionVal 0.02) 0.02 0.04
--print $ trunTay (Just 2) (difference optionVal 0.02) 0.02 0.04
--print $ trunTay Nothing (difference optionVal 0.02) 0.02 0.04
print $ "convexity"
print $ convexityAdj optValLin 0.02 0.04
print $ convexityAdj optValQuad 0.02 0.04
-- just get the second derivative of the adjustment
-- plot a function trunTay for a range from like 0 -> 0.1 for examples with Nothing
let xFunValues = [ x*0.001 | x <- [1..100] ]
linValues = map (\x -> trunTay Nothing optValLin 0.02 x) xFunValues
quadValues = map (\x -> trunTay Nothing optValQuad 0.02 x) xFunValues
-- print $ (linValues :: [(Double,Double)])
C.writeFile "./plotting/funVals.csv" $ encode (zip3 xFunValues linValues quadValues :: [(Double,Double,Double)])
-- Then plot first order derivaitve trunTay (Just 1) centred at 0.02 up to 0.04 to get straight line
let xApproxValues = [ x*0.001 + 0.02 | x <- [0..60] ]
quadApproxVals1 = map (\x -> trunTay (Just 1) optValQuad 0.02 x) xApproxValues
quadApproxVals2 = map (\x -> trunTay (Just 2) optValQuad 0.02 x) xApproxValues
C.writeFile "./plotting/approxVals.csv" $ encode (zip3 xApproxValues quadApproxVals1 quadApproxVals2 :: [(Double,Double,Double)])
-- Now plot the convexity adustment as a constant values starting at 0.8
let sPoint = trunTay (Just 1) optValQuad 0.02 0.08
convexAdj = (convexityAdj optValQuad 0.02 0.08)
writeFile "./plotting/convexAdj.csv" $ "0.08," ++ show sPoint ++ ",0," ++ show convexAdj
print "done"
|
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Ole Krause-Sparmann
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
import numpy
from nearpy.hashes import LSHash, RandomBinaryProjections, PCABinaryProjections, RandomBinaryProjectionTree
class HashPermutationMapper(LSHash):
"""
This meta-hash performs permutations on binary bucket keys
and keeps a dictionary for this mapping.
You use this just like every other LSHash implementation and
add the actual binary hashes you want to use via the add_child_hash
method. Each child hash will be used separatly.
So to use this you have to do the following steps:
1. Create HashPermutationMapper instance and use it in the Engine constructor
2. Add your binary hashes as child hashes by calling add_child_hash()
3. Store your vectors using the Engine
4. Now when you query the bucket key map is used
"""
def __init__(self, hash_name):
""" Just keeps the name. """
super(HashPermutationMapper, self).__init__(hash_name)
self.child_hashes = []
self.dim = None
self.bucket_key_map = {}
def reset(self, dim):
""" Resets / Initializes the hash for the specified dimension. """
self.dim = dim
self.bucket_key_map = {}
# Reset all child hashes
for child_hash in self.child_hashes:
child_hash.reset(dim)
def permuted_keys(self, key):
result = []
for j in range(len(key)):
bits = list(key)
bits[j] = '1' if key[j] == '0' else '0'
result.append(''.join(bits))
return result
def hash_vector(self, v, querying=False):
"""
Hashes the vector and returns the bucket key as string.
"""
bucket_keys = []
if querying:
# If we are querying, use the bucket key map
for lshash in self.child_hashes:
# Get regular bucket keys from hash
for bucket_key in lshash.hash_vector(v, querying):
prefixed_key = lshash.hash_name + '_' + bucket_key
# Get entries from map (bucket keys with hamming distance
# of 1)
if prefixed_key in self.bucket_key_map:
bucket_keys.extend(self.bucket_key_map[
prefixed_key].keys())
else:
# If we are indexing (storing) just use child hashes without
# permuted index
for lshash in self.child_hashes:
# Get regular bucket keys from hash
for bucket_key in lshash.hash_vector(v, querying):
# Get permuted keys
perm_keys = self.permuted_keys(bucket_key)
# Put extact hit key into list
perm_keys.append(bucket_key)
# Append key for storage (not the permutations)
bucket_keys.append(lshash.hash_name + '_' + bucket_key)
# For every permutation register all the variants
for perm_key in perm_keys:
prefixed_key = lshash.hash_name + '_' + perm_key
# Make sure dictionary exists
if not prefixed_key in self.bucket_key_map:
self.bucket_key_map[prefixed_key] = {}
for variant in perm_keys:
prefixed_variant = lshash.hash_name + '_' + variant
self.bucket_key_map[prefixed_key][
prefixed_variant] = 1
# Return all the bucket keys
return bucket_keys
def get_config(self):
"""
Returns pickle-serializable configuration struct for storage.
"""
return {
'hash_name': self.hash_name,
'dim': self.dim,
'bucket_key_map': self.bucket_key_map
}
def apply_config(self, config):
"""
Applies config
"""
self.hash_name = config['hash_name']
self.dim = config['dim']
self.bucket_key_map = config['bucket_key_map']
def add_child_hash(self, child_hash):
"""
Adds specified child hash.
The hash must be one of the binary types.
"""
# Hash must generate binary keys
if not (isinstance(child_hash, PCABinaryProjections) or isinstance(child_hash, RandomBinaryProjections) or isinstance(child_hash, RandomBinaryProjectionTree)):
raise ValueError('Child hashes must generate binary keys')
# Add both hash and config to array of child hashes. Also we are going to
# accumulate used bucket keys for every hash in order to build the
# permuted index
self.child_hashes.append(child_hash)
|
interleaved mutual
data Foo : Set → Set
data Foo_Bar : Set
constructor
foobar : Foo Bar
|
import numpy as np
import googlemaps, random, threading, time, logging, math
from persistentdict import persistent_memoize, PersistentDict
from multiprocessing import Lock
from multiprocessing.pool import ThreadPool
from datetime import date, datetime, timedelta
key_list = [
'AIzaSyB4QGLWlDDhzWwbcvwXaEYw4RWnzAnR5dc',
'AIzaSyDKVWMVqJZmdpbtrAYpNcSls57ril2jQyk',
'AIzaSyB8XNz5x9aCrVof0O8mr0TcOrzhFlGwYfE',
'AIzaSyBJGPn837UCoO41-GmYJ8qsl6HELk876Yg',
'AIzaSyCPV0Vt7B5pgu-tZhNWMK0iH1FmmamQT8k',
'AIzaSyAddqHFPfBPyaDIlUrirh1zyMHKeZUmxvs',
'AIzaSyB1_B-BDqYD5gKoYelh7nWZpgN08VgvJcU',
'AIzaSyCwW5glqclKE-ScAySWAXklm1M7GsRcvOs',
'AIzaSyBvc9mGvfPkSMCgddH8VwmsJRHFglm8aAs',
'AIzaSyAvHGivHVew20740v2-2rx-EKU0RXti9qM',
'AIzaSyCDP-i3yAilCDwSUc2gW9QWH1efbGOR_po',
'AIzaSyC-cWVFSjnAlCqEm01zubqnxHE6XDiHEs4',
\
'AIzaSyA7qn4BOTA75G21-H0z6dvjRBW-6-u7gN8',
'AIzaSyDTyhhcVujWh58VX9jpmLoeSDTd-UoxShc',
'AIzaSyAsajHpyWmI3ZF4tjyfBRojJ8x4mTiKXzk',
'AIzaSyBDAD4XbSkznbTeA8l4H7C6Jp4S_Kt9gIM',
'AIzaSyCAHyCsPH7lL3NShMN-xJSUQm20rtqwQ28',
'AIzaSyC4QCdST6Ds-YoIBPQi4d1iS6qxZCswQww',
'AIzaSyDCKhVrWuh4RkBwvx4L5Rpgb9sp_FGeVck',
'AIzaSyAf5rKKBuloMB61WVLdirYcaUthlSO3WaI',
'AIzaSyDjTu67Pfpx7Mu0VSj2s74_dY0W0wlCA88',
'AIzaSyC6YeE9zakNTyUKXCGhW56FSVkZU-5i0zs',
'AIzaSyAXWyQp2frbgggNOHpVH8YULobXGoLBz_A',
'AIzaSyAN3iIBhvm7dpA_d2hELC2-DXi134CZ45U']
KEYS = dict.fromkeys(key_list, True)
# keep track of keys where quota not reached today
valid_keys = PersistentDict('API_keys')
if 'timestamp' not in valid_keys or valid_keys['timestamp'] != date.today():
valid_keys.clear()
valid_keys['timestamp'] = date.today()
valid_keys.update(**KEYS)
valid_keys[""] = False
set_lock = threading.Lock()
@persistent_memoize('gmaps_distance_matrix')
def gmaps_distance_matrix(*args, **kwargs):
'''
Cached version of gmaps.distance_matrix
Documentation at
https://googlemaps.github.io/google-maps-services-python/docs/2.4.6/#googlemaps.Client.distance_matrix
On timeout, use the next API key in list
'''
#print(args, kwargs)
if 'origins' not in kwargs:
raise Exception('Invalid request. Missing the \'origins\' parameter.')
elif 'destinations' not in kwargs:
raise Exception('Invalid request. Missing the \'destinations\' parameter.')
elif 'departure_time' in kwargs and 'arrival_time' in kwargs:
raise Exception('Invalid request. Can only have one of \'departure_time\' and \'arrival_time\'.')
elif 'traffic_mode' in kwargs and 'departure_time' not in kwargs:
raise Exception('Invalid request. Missing the \'departure_time\' parameter.')
elif 'transit_mode' in kwargs and ('mode' not in kwargs or kwargs['mode'] != 'transit'):
raise Exception('Invalid request. \'transit_mode\' only permissed for mode = transit.')
elif 'transit_routing_preference' in kwargs and ('mode' not in kwargs or kwargs['mode'] != 'transit'):
raise Exception('Invalid request. \'transit_routing_preference\' only permissed for mode = transit.')
query = None
key = get_next_key("")
while query is None:
try:
query = googlemaps.Client(key = key).distance_matrix(*args, **kwargs)
except googlemaps.exceptions.Timeout:
logging.info("Google Maps Timeout on key: %s", key)
print("Google Maps Timeout on key:", key)
key = get_next_key(key)
except Exception as e:
logging.warning("Google Maps Exception: %s", str(e))
print("Google Maps Exception:", str(e))
print(args)
print(kwargs)
query = None
time.sleep(30)
# check query results
try:
for i,row in enumerate(query['rows']):
for j,col in enumerate(row['elements']):
if col['status'] != 'OK':
debug_info = 'Status not OK'
debug_info += '\nElement: ' + str(col)
debug_info += '\nFrom ' + str(i) + ' to ' + str(j)
debug_info += '\nargs,kwargs: ' + str(args) + ', ' + str(kwargs)
debug_info += '\nQuery result: ' + str(query)
logging.info('Status not OK')
logging.debug(debug_info)
print(debug_info)
raise Exception('Status not OK')
elif 'duration' not in col:
debug_info = 'No duration'
debug_info += '\nElement: ' + str(col)
debug_info += '\nFrom ' + str(i) + ' to ' + str(j)
debug_info += '\nargs,kwargs: ' + str(args) + ', ' + str(kwargs)
debug_info += '\nQuery result: ' + str(query)
logging.info('No duration')
logging.debug(debug_info)
print(debug_info)
raise Exception('No duration')
elif ((('mode' in kwargs and \
kwargs['mode'] == 'driving') \
or 'mode' not in kwargs) and \
'duration_in_traffic' not in col):
debug_info = 'No duration_in_traffic'
debug_info += '\nElement: ' + str(col)
debug_info += '\nFrom ' + str(i) + ' to ' + str(j)
debug_info += '\nargs,kwargs: ' + str(args) + ', ' + str(kwargs)
debug_info += '\nQuery result: ' + str(query)
logging.info('No duration_in_traffic')
logging.debug(debug_info)
print(debug_info)
raise Exception('No duration_in_traffic')
except Exception:
query = None
time.sleep(5)
return query
def get_next_key(prev_key):
global valid_keys
try:
with set_lock:
valid_keys[prev_key] = False
keys = [k for k in valid_keys if valid_keys[k] is True]
return random.choice(keys)
except Exception:
raise Exception("Out of API keys")
@persistent_memoize('get_distance_matrix')
def get_distance_matrix(addresses, traffic=True, **kwargs):
'''
Build the distance matrix by querying Google Distance Matrix API
Parameters:
addresses (list of str)
traffic (bool): default to True
**kwargs: gmaps.distance_matrix kwargs
Returns:
numpy array of travel times between addresses, with or without traffic, at current time
'''
# traffic=True only valid for driving (and default to driving)
if traffic and 'mode' in kwargs and kwargs['mode'] != 'driving':
traffic = False
traffic = 'duration_in_traffic' if traffic else 'duration'
np.set_printoptions(suppress = True)
dim = len(addresses)
distance_matrix = np.zeros((dim,dim))
# build in blocks of 10x10
for x_min in range(math.ceil(dim/10)):
x_min *= 10
x_max = min(x_min+10, dim)
origins = addresses[x_min:x_max]
for y_min in range(math.ceil(dim/10)):
y_min *= 10
y_max = min(y_min+10, dim)
destinations = addresses[y_min:y_max]
# https://googlemaps.github.io/google-maps-services-python/docs/2.4.6/#googlemaps.Client.distance_matrix
query = gmaps_distance_matrix(
origins = origins,
destinations = destinations,
language='en-GB',
**kwargs
)
for i, row in enumerate(query['rows']):
for j, col in enumerate(row['elements']):
distance_matrix[x_min+i,y_min+j] = col[traffic]['value']
return distance_matrix
def get_distance(origin, destination, traffic=True, **kwargs):
'''Find the distance from an origin to a destination location.
Build the distance matrix by querying Google Distance Matrix API
Parameters:
origin (str)
destination (str)
traffic (bool): default to True
**kwargs: gmaps.distance_matrix kwargs
Returns:
numpy array of travel times between addresses, with or without traffic, at current time
'''
# traffic=True only valid for driving (and default to driving)
if traffic and 'mode' in kwargs and kwargs['mode'] != 'driving':
traffic = False
query = gmaps_distance_matrix(
origins = origin,
destinations = destination,
language='en-GB',
**kwargs
)
traffic = 'duration_in_traffic' if traffic else 'duration'
return query['rows'][0]['elements'][0][traffic]['value']
@persistent_memoize('get_week_distance_matrices')
def get_week_distance_matrices(addresses, hours=3.5, **kwargs):
# get 1 week of travel time data from google
# for optimistic, pessimistic and best_guess
# X = datetimes
x = datetime(2018,1,1)
xend = x + timedelta(days=7)
delta = timedelta(hours=hours)
X = []
# generate datetimes to query
while x < xend:
X += [x]
x += delta
partial_get_distance_matrix = \
lambda t: get_distance_matrix(addresses, departure_time=t, **kwargs)
pool = ThreadPool(processes=50)
# query gmaps
dms = np.array(pool.map(partial_get_distance_matrix, X))
# sort in date order
X = np.reshape([(x.timestamp()/(60*60*24))%7 for x in X], (-1,1))
idx = np.argsort(X,axis=0)
X = np.reshape(X[idx], (-1,1))
dms = np.squeeze(dms[idx])
return (X, dms)
@persistent_memoize('get_week_distances')
def get_week_distances(origins, destinations, hours=3.5, **kwargs):
# get 1 week of travel time data from google
# for optimistic, pessimistic and best_guess
# X = datetimes
x = datetime(2018,1,1)
xend = x + timedelta(days=7)
delta = timedelta(hours=hours)
X = []
while x < xend:
X += [x]
x += delta
partial_get_distance = \
lambda t: get_distance(origins, destinations, departure_time=t, **kwargs)
pool = ThreadPool(processes=50)
distances = pool.map(partial_get_distance, X)
X = np.reshape([(x.timestamp()/(60*60*24))%7 for x in X], (-1,1))
idx = np.argsort(X,axis=0)
X = np.reshape(X[idx], (-1,1))
distances = np.reshape(np.reshape(distances, (-1,1))[idx], (-1,1))
return (X, distances)
|
*dk kdtree0
subroutine kdtree0(xic,yic,zic,mtri,linkt,sbox,ierr)
c
c #####################################################################
c
c purpose -
c
c KDTREE0 takes the set of MTRI points and produces a k-D tree
c that is stored in the array LINKT. Leaf nodes in LINKT each
c contain exactly one point index.
c KDTREE0 also produces an array SBOX which
c gives 'safety boxes'. For each node in the k-D tree,
c there is a corresponding safety box which is just big enough
c to contain all the points in the subtree associated with
c the node.
c
c input arguments -
c
c xic,yic,zic - arrays of spatial coordinates of the
c points.
c mtri - total number of points.
c ierr - is used to pass in a value for idebug
C idebug 1 is least, 5 more, 9 verbose
c
c output arguments -
c linkt - k-D tree links and leaf links to points.
c This array needs to have length 2*mtri.
c sbox - ``safety box system'' for k-D tree.
c This array needs to have length 12*mtri.
c ierr - error return.
c
c change history -
c
C $Log: kdtree0.f,v $
C Revision 2.00 2007/11/05 19:45:59 spchu
C Import to CVS
C
CPVCS
CPVCS Rev 1.3 Tue Sep 22 13:45:32 1998 dcg
CPVCS replace single precision constants
CPVCS
CPVCS Rev 1.2 Fri Jun 20 15:56:18 1997 dcg
CPVCS remove open statement
CPVCS add some temporary memory calls
c #####################################################################
implicit none
include 'consts.h'
integer mtri,linkt(2*mtri),ierr
real*8 xic(mtri),yic(mtri),zic(mtri),sbox(2,3,2*mtri)
pointer(ipitri,itri)
integer itri(mtri)
integer icrstack(100),imin(100),imax(100),ict(100)
pointer(ipimin,imin)
pointer(ipimax,imax)
pointer(ipict,ict)
pointer(ipicrstack,icrstack)
integer icscode,i,node,nextt,itop,imn,imx,icut,imd,
& k1,length, ierrw,idebug, icount
real*8 dimx,dimy,dimz
c variables to save min and max search box for idebug
c use volume of box lengths for debug reporting
real*8 maxdimx,maxdimy,maxdimz,mindimx,mindimy,mindimz
real*8 sizebox, maxbox, minbox, xmult,ymult,zmult
character*132 logmess
character*32 isubname
real*8 alargenumber
data alargenumber/1.d99/
C---------------------------------------------------------------
C BEGIN
isubname='kdtree0'
idebug = 0
if (ierr .gt. 0) then
idebug = ierr
endif
ierr=0
c.... If the number of points is not positive, give an error.
if (mtri.le.0) then
write(logmess,'(a,i6)') 'Error: mtri=',mtri
call writloga('default',0,logmess,0,ierrw)
call x3d_error(isubname,' ')
ierr=-1
goto 9999
endif
c....Obtain allocation for array.
call mmgetblk('itri',isubname,ipitri,mtri,1,icscode)
length=100
call mmgetblk('imin',isubname,ipimin,length,1,icscode)
call mmgetblk('imax',isubname,ipimax,length,1,icscode)
call mmgetblk('ict',isubname,ipict,length,1,icscode)
call mmgetblk('icrstack',isubname,ipicrstack,length,1,icscode)
if (idebug .gt. 0) call mmverify()
c.... Let the bounding box associated with the root node
c.... [SBOX(*,*,1)] exactly contain all points.
c.... ITRI will contain a permutation of the integers
c.... {1,...,MTRI}. This permutation will be altered as we
c.... create our balanced binary tree.
sbox(1,1,1)=alargenumber
sbox(2,1,1)=-alargenumber
sbox(1,2,1)=alargenumber
sbox(2,2,1)=-alargenumber
sbox(1,3,1)=alargenumber
sbox(2,3,1)=-alargenumber
do i=1,mtri
sbox(1,1,1)=min(sbox(1,1,1),xic(i))
sbox(2,1,1)=max(sbox(2,1,1),xic(i))
sbox(1,2,1)=min(sbox(1,2,1),yic(i))
sbox(2,2,1)=max(sbox(2,2,1),yic(i))
sbox(1,3,1)=min(sbox(1,3,1),zic(i))
sbox(2,3,1)=max(sbox(2,3,1),zic(i))
itri(i)=i
enddo
c set defaults for saved min and max box sizes
sizebox = 0.
maxbox = 0.
minbox = alargenumber
c.... If there is only one point, the root node is a leaf.
c.... (Our convention is to set the link corresponding to a leaf
c.... equal to the negative of the unique point contained in
c.... that leaf.) If the root is a leaf, our work is done.
if (mtri.eq.1) then
linkt(1)=-1
goto 9999
endif
c.... DIMX, DIMY, DIMZ are equal to the x, y, and z dimensions
c.... of the bounding box corresponding to the current node
c.... under consideration.
dimx=sbox(2,1,1)-sbox(1,1,1)
dimy=sbox(2,2,1)-sbox(1,2,1)
dimz=sbox(2,3,1)-sbox(1,3,1)
c.... NEXTT is the address of the next available node to be filled.
nextt=2
c.... Use a stack to create the tree. Put the root node
c.... ``1'' on the top of the stack (ICRSTACK). The array
c.... subset of ITRI (i.e., subset of points associated
c.... with this node) is recorded using the arrays
c.... IMIN and IMAX.
itop=1
icrstack(itop)=1
imin(itop)=1
imax(itop)=mtri
c.... Finally, we record in ICT the appropriate ``cutting
c.... direction'' for bisecting the set of points
c.... corresponding to this node. This direction is either
c.... the x, y, or z direction, depending on which dimension
c.... of the bounding box is largest.
if (dimx.ge.max(dimy,dimz)) then
ict(itop)=1
elseif (dimy.ge.dimz) then
ict(itop)=2
else
ict(itop)=3
endif
c.... Pop nodes off stack, create children nodes and put them
c.... on stack. Continue until k-D tree has been created.
c LOOP through all stack options
icount = 1
do while (itop.gt.0)
c.... Pop top node off stack.
node=icrstack(itop)
icount = icount + 1
c.... Make this node point to next available node location (NEXTT).
c.... This link represents the location of the FIRST CHILD
c.... of the node. The adjacent location (NEXTT+1)
c.... is implicitly taken to be the location of the SECOND
c.... child of the node.
linkt(node)=nextt
imn=imin(itop)
imx=imax(itop)
icut=ict(itop)
itop=itop-1
c.... Partition point subset associated with this node.
c.... Using the appropriate cutting direction, use SELECT to
c.... reorder ITRI so that the point with median
c.... coordinate is itri(imd), while the
c.... points {itri(i),i<imd} have SMALLER (or equal)
c.... coordinates, and the points with
c.... {itri(i),i>imd} have GREATER coordinates.
imd=(imn+imx)/2
if (icut.eq.1) then
call select(imd-imn+1,imx-imn+1,xic,itri(imn))
elseif (icut.eq.2) then
call select(imd-imn+1,imx-imn+1,yic,itri(imn))
else
call select(imd-imn+1,imx-imn+1,zic,itri(imn))
endif
c.... If the first child's subset of points is a singleton,
c.... the child is a leaf. Set the child's link to point to the
c.... negative of the point number. Set the child's bounding
c.... box to be equal to a box with zero volume located at
c.... the coordinates of the point.
if (imn.eq.imd) then
linkt(nextt)=-itri(imn)
do k1=1,2
sbox(k1,1,nextt)=xic(itri(imn))
sbox(k1,2,nextt)=yic(itri(imn))
sbox(k1,3,nextt)=zic(itri(imn))
enddo
nextt=nextt+1
else
c.... In this case, the subset of points corresponding to the
c.... first child is more than one point, and the child is
c.... not a leaf. Compute the bounding box of this child to
c.... be the smallest box containing all the associated points.
do k1=1,2
sbox(k1,1,nextt)=xic(itri(imn))
sbox(k1,2,nextt)=yic(itri(imn))
sbox(k1,3,nextt)=zic(itri(imn))
enddo
do i=imn+1,imd
sbox(1,1,nextt)=min(sbox(1,1,nextt),
& xic(itri(i)))
sbox(2,1,nextt)=max(sbox(2,1,nextt),
& xic(itri(i)))
sbox(1,2,nextt)=min(sbox(1,2,nextt),
& yic(itri(i)))
sbox(2,2,nextt)=max(sbox(2,2,nextt),
& yic(itri(i)))
sbox(1,3,nextt)=min(sbox(1,3,nextt),
& zic(itri(i)))
sbox(2,3,nextt)=max(sbox(2,3,nextt),
& zic(itri(i)))
enddo
c.... Put the first child onto the stack, noting the
c.... associated point subset in IMIN and IMAX, and
c.... putting the appropriate cutting direction in ICT.
dimx=sbox(2,1,nextt)-sbox(1,1,nextt)
dimy=sbox(2,2,nextt)-sbox(1,2,nextt)
dimz=sbox(2,3,nextt)-sbox(1,3,nextt)
itop=itop+1
icrstack(itop)=nextt
imin(itop)=imn
imax(itop)=imd
if (dimx.ge.max(dimy,dimz)) then
ict(itop)=1
elseif (dimy.ge.dimz) then
ict(itop)=2
else
ict(itop)=3
endif
nextt=nextt+1
endif
c.... If the first child's subset of points is a singleton,
c.... the child is a leaf. Set the child's link to point to the
c.... negative of the point number. Set the child's bounding
c.... box to be equal to a box with zero volume located at
c.... the coordinates of the point.
if (imd+1.eq.imx) then
linkt(nextt)=-itri(imx)
do k1=1,2
sbox(k1,1,nextt)=xic(itri(imx))
sbox(k1,2,nextt)=yic(itri(imx))
sbox(k1,3,nextt)=zic(itri(imx))
enddo
nextt=nextt+1
else
c.... In this case, the subset of points corresponding to the
c.... second child is more than one point, and the child is
c.... not a leaf. Compute the bounding box of this child to
c.... be the smallest box containing all the associated points.
do k1=1,2
sbox(k1,1,nextt)=xic(itri(imd+1))
sbox(k1,2,nextt)=yic(itri(imd+1))
sbox(k1,3,nextt)=zic(itri(imd+1))
enddo
do i=imd+2,imx
sbox(1,1,nextt)=min(sbox(1,1,nextt),
& xic(itri(i)))
sbox(2,1,nextt)=max(sbox(2,1,nextt),
& xic(itri(i)))
sbox(1,2,nextt)=min(sbox(1,2,nextt),
& yic(itri(i)))
sbox(2,2,nextt)=max(sbox(2,2,nextt),
& yic(itri(i)))
sbox(1,3,nextt)=min(sbox(1,3,nextt),
& zic(itri(i)))
sbox(2,3,nextt)=max(sbox(2,3,nextt),
& zic(itri(i)))
enddo
dimx=sbox(2,1,nextt)-sbox(1,1,nextt)
dimy=sbox(2,2,nextt)-sbox(1,2,nextt)
dimz=sbox(2,3,nextt)-sbox(1,3,nextt)
c for debug reporting use volume of box
c protect against 0 length axis
xmult = dimx
ymult = dimy
zmult = dimz
if (dimx.le. 0.0) xmult = 1.
if (dimy.le. 0.0) ymult = 1.
if (dimz.le. 0.0) zmult = 1.
sizebox=xmult*ymult*zmult
if (idebug .ge. 5) then
write(logmess,'(a,i17)')
& "count: ",icount
call writloga('default',0,logmess,0,ierrw)
write(logmess,'(a,f17.5,f17.5,f17.5)')
& "dimx, dimy, dimz: ",dimx,dimy,dimz
call writloga('default',0,logmess,0,ierrw)
endif
if (sizebox.ge.maxbox) then
maxbox = sizebox
maxdimx = dimx
maxdimy = dimy
maxdimz = dimz
endif
if (sizebox.lt.minbox) then
minbox = sizebox
mindimx = dimx
mindimy = dimy
mindimz = dimz
endif
c.... Put the second child onto the stack, noting the
c.... associated point subset in IMIN and IMAX, and
c.... putting the appropriate cutting direction in ICT.
itop=itop+1
icrstack(itop)=nextt
imin(itop)=imd+1
imax(itop)=imx
if (dimx.ge.max(dimy,dimz)) then
ict(itop)=1
elseif (dimy.ge.dimz) then
ict(itop)=2
else
ict(itop)=3
endif
nextt=nextt+1
endif
enddo
C END LOOP building kd-tree
9999 continue
call mmrelprt(isubname,icscode)
if (idebug .gt. 0) then
write(logmess,'(a,i17)')
& ' kdtree0: build total: ',icount
call writloga('default',1,logmess,0,ierrw)
write(logmess,'(a,f17.5)')' Max box volume: ',maxbox
call writloga('default',0,logmess,0,ierrw)
write(logmess,'(a,f17.5)')' Min box volume: ',minbox
call writloga('default',0,logmess,0,ierrw)
write(logmess,'(a,f17.5,f17.5,f17.5)')
& ' Max dim xyz: ',
& maxdimx,maxdimy,maxdimz
call writloga('default',0,logmess,0,ierrw)
write(logmess,'(a,f17.5,f17.5,f17.5)')
& ' Min dim xyz: ',
& mindimx,mindimy,mindimz
call writloga('default',0,logmess,1,ierrw)
endif
return
end
|
Does your child(ren) have special dietary requirements?
Does your child(ren) have allergies?
Please specify which child along with the details of the allergies.
Does your child(ren) have any medical conditions we should be made aware of?
Do we have permission to take photos of your child(ren) for use in a presentation and on our website?
Do we have permission to email/mail you about future children's / youth events at Cobbitty Anglican?
How did you hear about Mega Day?
Thank you for registering for Mega Day!
Your place will be secured once we have received your payment. |
Require Export ZArith.
Require Export List.
Require Export Arith.
Require Export Lia.
Require Export Zwf.
(** multiplication by two *)
Fixpoint mult2 (n:nat) : nat :=
match n with
| O => 0%nat
| S p => S (S (mult2 p))
end.
(** We just consider an abstract predicate for primality.
Its definition is irrelevant with respect to the contents of this
file *)
Parameter prime : nat->Prop.
Section div_pair_section.
Open Scope Z_scope.
Variable div_pair :
forall a b:Z, 0 < b ->
{p:Z*Z | a = fst p * b + snd p /\ 0 <= snd p < b}.
Definition div_pair' (a:Z)(x:{b:Z | 0 < b}) : Z*Z :=
match x with
| exist _ b h => let (v, _) := div_pair a b h in v
end.
End div_pair_section.
Section div2_of_even_section.
Open Scope nat_scope.
Variable even : nat->Prop.
Variables (div2_of_even : forall n:nat, even n -> {p:nat | n = p+p})
(test_even : forall n:nat, {even n}+{even (pred n)} ).
Definition div2_gen (n:nat) :
{p:nat | n = p+p}+{p:nat | pred n = p+p} :=
match test_even n with
| left h => inl _ (div2_of_even n h)
| right h' => inr _ (div2_of_even (pred n) h')
end.
End div2_of_even_section.
Definition eq_dec (A:Type) := forall x y:A, {x = y}+{x <> y}.
Definition pred' (n:nat) : {p:nat | n = S p}+{n = 0} :=
match n return {p:nat | n = S p}+{n = 0} with
| O => inright _ (refl_equal 0)
| S p =>
inleft _
(exist (fun p':nat => S p = S p') p (refl_equal (S p)))
end.
Check ({p:nat | 0 = S p }+{0 = 0}).
Check (fun p:nat =>{p':nat | S p = S p'}+{S p = 0}).
Definition pred'' : forall n:nat, {p:nat | n = S p}+{n = 0}.
intros n; case n.
right; apply refl_equal.
intros p; left; exists p; reflexivity.
Defined.
Definition pred_partial : forall n:nat, n <> 0 -> nat.
intros n; case n.
intros h; elim h; reflexivity.
intros p h'; exact p.
Defined.
Theorem le_2_n_not_zero : forall n:nat, 2 <= n -> n <> 0.
Proof.
intros n Hle; elim Hle; intros; discriminate.
Qed.
Theorem le_2_n_pred :
forall (n:nat)(h: 2 <= n), pred_partial n (le_2_n_not_zero n h) <> 0.
(*
intros n h; elim h.
*)
Abort.
Theorem le_2_n_pred' :
forall n:nat, 2 <= n -> forall h:n <> 0, pred_partial n h <> 0.
Proof.
intros n Hle; elim Hle.
intros; discriminate.
simpl; intros; apply le_2_n_not_zero; assumption.
Qed.
Theorem le_2_n_pred :
forall (n:nat)(h:2 <= n), pred_partial n (le_2_n_not_zero n h) <> 0.
Proof.
intros n h; exact (le_2_n_pred' n h (le_2_n_not_zero n h)).
Qed.
Definition pred_partial_2 (n:nat)(h:2 <= n) : nat :=
pred_partial (pred_partial n (le_2_n_not_zero n h))
(le_2_n_pred n h).
Check(forall n:nat, n <> 0 -> {v:nat | n = S v}).
Check (forall n:nat, 2 <= n -> {v:nat | n = S (S v)}).
Definition pred_strong : forall n:nat, n <> 0 -> {v:nat | n = S v}.
intros n; case n;
[intros H; elim H | intros p H'; exists p]; trivial.
Defined.
Theorem pred_strong2_th1 :
forall n p:nat, 2 <= n -> n = S p -> p <> 0.
Proof.
intros; lia.
Qed.
Theorem pred_th1 : forall n p q:nat, n = S p -> p = S q -> n = S (S q).
Proof.
intros; subst n; auto.
Qed.
Definition pred_strong2 (n:nat)(h:2<=n):{v:nat | n = S (S v)} :=
match pred_strong n (le_2_n_not_zero n h) with
| exist _ p h' =>
match pred_strong p (pred_strong2_th1 n p h h') with
| exist _ p' h'' =>
exist (fun x:nat => n = S (S x))
p' (pred_th1 n p p' h' h'')
end
end.
Definition pred_strong2' :
forall n:nat, 2 <= n -> {v:nat | n = S (S v)}.
Proof.
intros n h; case (pred_strong n).
- apply le_2_n_not_zero; assumption.
- intros p h'; case (pred_strong p).
+ apply (pred_strong2_th1 n); assumption.
+ intros p' h''; exists p'; eapply pred_th1; eauto.
Defined.
Section minimal_specification_strengthening.
Variable prime : nat->Prop.
Definition divides (n p:nat) : Prop := exists q:_, q*p = n.
Definition prime_divisor (n p:nat):= prime p /\ divides p n.
Variable prime_test : nat->bool.
Hypotheses
(prime_test_t : forall n:nat, prime_test n = true -> prime n)
(prime_test_f : forall n:nat, prime_test n = false -> ~prime n).
Variable get_primediv_weak : forall n:nat, ~prime n -> nat.
Hypothesis get_primediv_weak_ok :
forall (n:nat)(H:~prime n), 1 < n ->
prime_divisor n (get_primediv_weak n H).
Lemma divides_refl : forall n:nat, divides n n.
Proof.
intro n; exists 1; simpl; auto.
Qed.
#[local] Hint Resolve divides_refl : core.
Check (fun E:nat=> fun n:nat => if prime_test n then n else E).
Definition bad_get_prime : nat->nat.
intro n; case_eq (prime_test n).
- intro; exact n.
- intro Hfalse; apply (get_primediv_weak n); auto.
Defined.
Print bad_get_prime.
Theorem bad_get_primediv_ok :
forall n:nat, 1 < n -> prime_divisor n (bad_get_prime n).
Proof.
intros n H; unfold bad_get_prime.
Abort.
Definition stronger_prime_test :
forall n:nat, {(prime_test n)=true}+{(prime_test n)=false}.
Proof.
intro n; case (prime_test n);[left | right]; reflexivity.
Defined.
Definition get_prime (n:nat) : nat :=
match stronger_prime_test n with
| left H => n
| right H => get_primediv_weak n (prime_test_f n H)
end.
Theorem get_primediv_ok :
forall n:nat, 1 < n -> prime_divisor n (get_prime n).
Proof.
intros n H; unfold get_prime.
case (stronger_prime_test n); auto.
split; auto.
Qed.
End minimal_specification_strengthening.
Definition pred_partial' : forall n:nat, n <> 0 -> nat.
refine
(fun n =>
match n as x return x <> 0 -> nat with
| O => fun h:0 <> 0 => _
| S p => fun h:S p <> 0 => p
end).
elim h; trivial.
Defined.
Definition pred_partial_2' : forall n:nat, le 2 n -> nat.
Proof.
refine
(fun n h=>(fun h':n<>0 => pred_partial (pred_partial n h') _) _).
- apply le_2_n_pred'; auto.
- apply le_2_n_not_zero; auto.
Defined.
Definition pred_strong2'' : forall n:nat, 2<=n -> {v:nat | n = S (S v)}.
Proof.
refine
(fun n h =>
match pred_strong n _ with
| exist _ p h' =>
match pred_strong p _ with exist _ p' h'' => exist _ p' _ end
end).
- apply le_2_n_not_zero; assumption.
- eapply pred_strong2_th1; eauto.
- rewrite <- h''; trivial.
Qed.
Require Import Program.
Program Definition pred_strong2''' (n:nat)(H:2<=n):{v:nat|n = S (S v)} :=
pred (pred n ).
Next Obligation.
(*
1 subgoal
n : nat
H : 2 <= n
============================
n = S (S (pred (pred n)))
*)
lia.
Defined.
Fixpoint div2 (n:nat) : nat :=
match n with 0 => 0 | 1 => 0 | S (S p) => S (div2 p) end.
Section bad_proof_for_div2_le.
Theorem div2_le : forall n:nat, div2 n <= n.
Proof.
induction n as [ | n IHn].
- simpl; auto.
- induction n.
+ simpl; auto.
+ Abort.
End bad_proof_for_div2_le.
(** Put in one file (multiply used) *)
Theorem div2_rect (P: nat -> Type) :
P 0 -> P 1 ->
(forall n, P n -> P (S n) -> P(S (S n)))->
forall n:nat, P n.
Proof.
intros H0 H1 H n; assert (X: ( P n * P (S n))%type).
- induction n; intuition.
- now destruct X.
Defined.
Theorem div2_le : forall n:nat, div2 n <= n.
Proof.
intro n; induction n using div2_rect; simpl; auto with arith.
Qed.
Lemma double_div2_le : forall x:nat, div2 x + div2 x <= x.
Proof.
intro n; induction n using div2_rect; simpl; auto with arith.
lia.
Qed.
Fixpoint div2'_aux (n:nat) : nat*nat :=
match n with
| 0 => (0, 0)
| S p => let (v1,v2) := div2'_aux p in (v2, S v1)
end.
Definition div2' (n:nat) : nat := fst (div2'_aux n).
Fixpoint plus' (n m:nat){struct m} : nat :=
match m with O => n | S p => S (plus' n p)
end.
Theorem plus'_O_n : forall n:nat, n=(plus' O n).
Proof.
intros n; elim n; simpl; auto.
Qed.
Theorem plus'_Sn_m : forall n m:nat, S (plus' n m) = plus' (S n) m.
Proof.
intros n m; elim m; simpl; auto.
Qed.
Theorem plus'_comm : forall n m:nat, plus' n m = plus' m n.
Proof.
intros n m; elim m; simpl.
- apply plus'_O_n.
- intros p Hrec; rewrite <- plus'_Sn_m; auto.
Qed.
Theorem plus_plus' : forall n m:nat, n+m = plus' n m.
Proof.
intros n m; rewrite plus'_comm; elim n; simpl; auto.
Qed.
Fixpoint plus'' (n m:nat){struct m} : nat :=
match m with 0 => n | S p => plus'' (S n) p end.
Theorem plus''_Sn_m : forall n m:nat, S (plus'' n m) = plus'' (S n) m.
Proof.
intros n m; generalize n; elim m; simpl.
- auto.
- now intros p Hrec n0.
Qed.
Open Scope Z_scope.
Fixpoint div_bin (n m:positive){struct n} : Z*Z :=
match n with
| 1%positive => match m with 1%positive =>(1,0) | _ =>(0,1) end
| xO n' =>
let (q',r'):=div_bin n' m in
match Z_lt_ge_dec (2*r')(Zpos m) with
| left Hlt => (2*q', 2*r')
| right Hge => (2*q' + 1, 2*r' - (Zpos m))
end
| xI n' =>
let (q',r'):=div_bin n' m in
match Z_lt_ge_dec (2*r' + 1)(Zpos m) with
| left Hlt => (2*q', 2*r' + 1)
| right Hge => (2*q' + 1, (2*r' + 1)-(Zpos m))
end
end.
Theorem rem_1_1_interval : 0 <= 0 < 1.
Proof.
lia.
Qed.
Theorem rem_1_even_interval : forall m:positive, 0 <= 1 < Zpos (xO m).
Proof.
intros n'; split.
- auto with zarith.
- reflexivity.
Qed.
Theorem rem_1_odd_interval : forall m:positive, 0 <= 1 < Zpos (xI m).
Proof.
split;[auto with zarith | compute; auto].
Qed.
Theorem rem_even_ge_interval :
forall m r:Z, 0 <= r < m -> 2*r >= m -> 0 <= 2*r - m < m.
Proof.
intros; lia.
Qed.
Theorem rem_even_lt_interval :
forall m r:Z, 0 <= r < m -> 2*r < m -> 0 <= 2*r < m.
Proof.
intros; lia.
Qed.
Theorem rem_odd_ge_interval :
forall m r:Z, 0 <= r < m -> 2*r + 1 >= m -> 2*r + 1 - m < m.
Proof.
intros; lia.
Qed.
Theorem rem_odd_lt_interval :
forall m r:Z, 0 <= r < m -> 2*r + 1 < m -> 0 <= 2*r + 1 < m.
Proof.
intros; lia.
Qed.
#[local] Hint Resolve rem_odd_ge_interval rem_even_ge_interval
rem_odd_lt_interval rem_even_lt_interval rem_1_odd_interval
rem_1_even_interval rem_1_1_interval : core.
Ltac div_bin_tac arg1 arg2 :=
elim arg1;
[intros p; lazy beta iota delta [div_bin]; fold div_bin;
case (div_bin p arg2); unfold snd; intros q' r' Hrec;
case (Z_lt_ge_dec (2*r' + 1)(Zpos arg2)); intros H
| intros p; lazy beta iota delta [div_bin]; fold div_bin;
case (div_bin p arg2); unfold snd; intros q' r' Hrec;
case (Z_lt_ge_dec (2*r')(Zpos arg2)); intros H
| case arg2; lazy beta iota delta [div_bin]; intros].
Theorem div_bin_rem_lt :
forall n m:positive, 0 <= snd (div_bin n m) < Zpos m.
Proof.
intros n m; div_bin_tac n m; unfold snd; auto.
lia.
Qed.
(*
SearchRewrite (Zpos (xI _)).
SearchRewrite (Zpos (xO _)).
*)
Theorem div_bin_eq :
forall n m:positive,
Zpos n = (fst (div_bin n m))*(Zpos m) + snd (div_bin n m).
Proof.
intros n m; div_bin_tac n m;
rewrite Zpos_xI || (try rewrite Zpos_xO);
try rewrite Hrec; unfold fst, snd; ring.
Qed.
Inductive div_data (n m:positive) : Set :=
div_data_def :
forall q r:Z, Zpos n = q*(Zpos m)+r -> 0<= r < Zpos m -> div_data n m.
Definition div_bin2 : forall n m:positive, div_data n m.
intros n m; elim n.
- intros n' [q r H_eq H_int];
case (Z_lt_ge_dec (2*r + 1)(Zpos m)).
+ split with (2*q) (2*r + 1).
rewrite Zpos_xI; rewrite H_eq; ring.
auto.
+ split with (2*q+1)(2*r + 1 - (Zpos m)).
rewrite Zpos_xI; rewrite H_eq; ring.
lia.
- intros n' [q r H_eq H_int].
case (Z_lt_ge_dec (Zmult 2 r)(Zpos m)).
split with (Zmult 2 q)(Zmult 2 r).
+ rewrite Zpos_xO; rewrite H_eq; ring.
+ auto.
+ split with (Zplus (Zmult 2 q) 1)(Zminus (Zmult 2 r)(Zpos m)).
* rewrite Zpos_xO; rewrite H_eq; ring.
* auto.
- case m.
+ split with 0%Z 1%Z.
* ring; auto.
* auto.
+ split with 0%Z 1%Z.
* ring.
* auto.
+ split with 1%Z 0%Z.
* ring.
* auto.
Qed.
Definition div_bin3 : forall n m:positive, div_data n m.
refine
((fix div_bin3 (n:positive) : forall m:positive, div_data n m :=
fun m =>
match n return div_data n m with
| 1%positive =>
match m return div_data 1 m with
| 1%positive => div_data_def 1 1 1 0 _ _
| xO p => div_data_def 1 (xO p) 0 1 _ _
| xI p => div_data_def 1 (xI p) 0 1 _ _
end
| xO p =>
match div_bin3 p m with
| div_data_def _ _ q r H_eq H_int =>
match Z_lt_ge_dec (Zmult 2 r)(Zpos m) with
| left hlt =>
div_data_def (xO p) m (Zmult 2 q)
(Zmult 2 r) _ _
| right hge =>
div_data_def (xO p) m (Zplus (Zmult 2 q) 1)
(Zminus (Zmult 2 r)(Zpos m)) _ _
end
end
| xI p =>
match div_bin3 p m with
| div_data_def _ _ q r H_eq H_int =>
match Z_lt_ge_dec (Zplus (Zmult 2 r) 1)(Zpos m)
with
| left hlt =>
div_data_def (xI p) m (Zmult 2 q)
(Zplus (Zmult 2 r) 1) _ _
| right hge =>
div_data_def (xI p) m (Zplus (Zmult 2 q) 1)
(Zminus (Zplus (Zmult 2 r) 1)(Zpos m)) _ _
end
end
end));
clear div_bin3; try rewrite Zpos_xI; try rewrite Zpos_xO;
try rewrite H_eq; auto with zarith; try (ring; fail);
try (split;[auto with zarith | compute; auto]).
Defined.
|
\section{Interaction Model}
\label{sec:conceptual-interaction}
The Interaction Model is the third part of the XRM conceptual model. The Behavioural Model focused on defining the capabilities of Actors according to their roles. Based on it, the Interaction Model aims to combine the different actions of users, the Target of these actions, and how one or more Actuators respond to this interaction.
Similar to the Behavioural Model, the Interaction Model defines primitives: the Interaction and the System Event.
In addition, it includes two sub-models distinguished by the level of abstraction. The one at a lower level aims to compose a more complex system starting from the primitives just defined: the Task. At a high level, on the other hand, the Activity is composed of a concatenation of Tasks and aims to provide a complete picture of the flow of the experience.
\subsection*{Design of the Task: Low-Level Conceptualization}
In order to give a more exhaustive definition of the concept of Task, it is first required to explore two fundamental elements: Interaction and the System Event.
\subsubsection*{Interaction}
The \emph{Interaction} represents a process where a Human Actor performs actions on a Non-Human Actor, the Actuator, to complete a task. Each interaction is defined by the User’s Actions.
An Interaction is to be considered within the Interaction Model as a building block that contains the three primitives analysed in the Behavioural Model (\autoref{sec:conceptual-behavioral}).
It must be a non-null set. The Non-Human Actors involved may be one or more than one in the case of a more complex Interaction and the Human Actor, which is the one that initiates the Interaction, cannot be omitted from the design. It is hard to provide a list of interactions because the combinations would be too many, so we distinguish some built-in interactions and their behaviour related to the Device involved:
\begin{table}[h]
\centering
\begin{tabular}{|l|l|}
\hline
\multicolumn{2}{|l|}{\textbf{Interaction}} \\ \hline
Take Screenshot & \begin{tabular}[c]{@{}l@{}}It represents an instant capture of the displayed \\ Environment or Virtual Object.\end{tabular} \\ \hline
Record View & \begin{tabular}[c]{@{}l@{}}It represents a recording of the displayed \\ Environment or Virtual Object.\end{tabular} \\ \hline
Save Acquisition & \begin{tabular}[c]{@{}l@{}}It represents that a screenshot or recording is \\ saved on the Device in use.\end{tabular} \\ \hline
Dictation & \begin{tabular}[c]{@{}l@{}}It represents that the user’s voice is recognized \\ by the Device.\end{tabular} \\ \hline
\end{tabular}
\caption{Interaction - graphical representation}
\label{tab:InteractionTable}
\end{table}
As can be seen from Figure \autoref{fig:InteractionBlock}, it shows the three main components contained within our building block, which can be renamed by the designer with a title that briefly explains the intended interaction.
\begin{figure}[h]
\centering
\includegraphics[width=7.5cm]{Figures/Conceptual Model/InteractionBlock.png}
\caption{Interaction - graphical representation}
\label{fig:InteractionBlock}
\end{figure}
Some examples of interactions that can be created and customised according to the experience are given below:
\begin{itemize}
\item The experience designer can model a "Proximity In" interaction involving the user as a Human Actor, the Walk In action as a User Action and the Virtual Object as an Actuator.
\item The experience designed using HMDs allows the user to interact with the Virtual Object by tapping (User Action: Tap) on a 3D Model (Actuator) to "Select the Object" (Effect). A subsequent Tap allows the user the next interaction, for example to play the content.
\end{itemize}
\subsubsection*{System Event}
The \emph{System Event} provides the signal that triggers the event call. The stimuli generated by the events are, of course, outside the direct control of the user \autoref{fig:SystemEvent}.
\begin{figure}[h]
\centering
\includegraphics[width=7.5cm]{Figures/Conceptual Model/SystemEvent.png}
\caption{System Event - graphical representation}
\label{fig:SystemEvent}
\end{figure}
The System Event is a building block in the same way as the Interaction block, with the difference that neither the Human Actor nor the User Action appears. The only element contained in the System Event block is the Non-Human Actor that participates in the System generated Event.
An example of a System Event is the Beacon Reception. This is a Bluetooth-based technology that allows Bluetooth devices to transmit and receive small messages within short distances. The system is able to recognise the wireless device and the effects triggered can be multiple and show up on one or more Non-Human Actors.
\subsubsection*{Task}
\emph{Task} is defined as an interaction or system event that generates an effect. \autoref{fig:Task} shows how it embeds two blocks connected by an arrow, recalling a cause-and-effect scenario.
\begin{figure}[h]
\centering
\includegraphics[width=12cm]{Figures/Conceptual Model/Task.png}
\caption{Task - graphical representation}
\label{fig:Task}
\end{figure}
The Task can be either user or system dependent. It is described by a sub-model using the building blocks presented so far.
The user-dependent Task is represented by the presence of the Interaction block, which defines the User Actions that the user can do on one or more Non-Human Actors, combined with the Effects generated on one or more Non-Human Actors. Interactions are seen in detail with respect to the higher level sub-model which will be described later.
A Task that depends on a System Event defines perceptible Effects on the system and the environment. A change in state of a system device (e.g., "increase in display brightness") is not generated as a response to explicit and intentional human actions in the XR experience, but instead results from phenomena perceived by Non-Human Actors, such as common devices like our smartphones that recognise the decrease in natural light.
At this level, the general purpose of the Task is set out with a representative sentence devised by the experience designer. The composition of the Task should be quite intuitive and straightforward after defining its atomic components individually.
By combining primitives representing an interaction (Human Actor, User Action, Target) or a System Event (Target) it is possible to associate the Effect that is generated on the Actuator. The following table shows an example overview of the many possible combinations.
\begin{table}[h]
\centering
\begin{tabular}{|c|c|c|c|c|c|}
\hline
\rowcolor[HTML]{DAE8FC}
\multicolumn{4}{|l|}{\cellcolor[HTML]{DAE8FC}{\color[HTML]{333333} Interaction/System Event}} &
\multicolumn{2}{l|}{\cellcolor[HTML]{DAE8FC}{\color[HTML]{333333} Effect}} \\ \hline
\rowcolor[HTML]{FFE6CC}
\multicolumn{1}{|l|}{\cellcolor[HTML]{FFE6CC}\begin{tabular}[c]{@{}l@{}}Human\\ Actor\end{tabular}} &
\multicolumn{1}{l|}{\cellcolor[HTML]{FFE6CC}\begin{tabular}[c]{@{}l@{}}User\\ Action\end{tabular}} &
\multicolumn{2}{l|}{\cellcolor[HTML]{FFE6CC}Target} &
\multicolumn{1}{l|}{\cellcolor[HTML]{DAE8FC}} &
\multicolumn{1}{l|}{\cellcolor[HTML]{DAE8FC}Actuator} \\ \hline
&
\begin{tabular}[c]{@{}c@{}}Press, \\ Click, \\ Speak\end{tabular} &
Device &
&
\begin{tabular}[c]{@{}c@{}}Screenshot Acquisition,\\ Recording Acquisition,\\ Acquired Element saved,\\ Speech to text\end{tabular} &
Device \\ \cline{2-6}
&
Frame &
&
QR Code &
&
\begin{tabular}[c]{@{}c@{}}Device, \\ E, VO\end{tabular} \\ \cline{2-2} \cline{4-4} \cline{6-6}
\multirow{-3}{*}{User U} &
Frame &
&
RFID &
&
\begin{tabular}[c]{@{}c@{}}Device,\\ E, VO\end{tabular} \\ \cline{1-2} \cline{4-4} \cline{6-6}
- &
- &
\multirow{-3}{*}{\begin{tabular}[c]{@{}c@{}}Interaction\\ Placholder \\ (IP)\end{tabular}} &
Beacon &
\multirow{-3}{*}{Show, Hide} &
\begin{tabular}[c]{@{}c@{}}Device,\\ E, VO\end{tabular} \\ \hline
\end{tabular}
\caption{ Task Combination - Physical Components (PHC)}
\label{tab:PHCtask}
\end{table}
%% ENVIRONMENT
\begin{table}[h]
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
\rowcolor[HTML]{DAE8FC}
\multicolumn{3}{|l|}{\cellcolor[HTML]{DAE8FC}{\color[HTML]{333333} Interaction/System Event}} &
\multicolumn{2}{l|}{\cellcolor[HTML]{DAE8FC}{\color[HTML]{333333} Effect}} \\ \hline
\rowcolor[HTML]{FFE6CC}
\multicolumn{1}{|l|}{\cellcolor[HTML]{FFE6CC}\begin{tabular}[c]{@{}l@{}}Human\\ Actor\end{tabular}} &
\multicolumn{1}{l|}{\cellcolor[HTML]{FFE6CC}\begin{tabular}[c]{@{}l@{}}User\\ Action\end{tabular}} &
\multicolumn{1}{l|}{\cellcolor[HTML]{FFE6CC}Target} &
\multicolumn{1}{l|}{\cellcolor[HTML]{DAE8FC}} &
\multicolumn{1}{l|}{\cellcolor[HTML]{DAE8FC}Actuator} \\ \hline
&
Walk In &
&
Show, Hide &
\\ \cline{2-2} \cline{4-4}
&
Walk Out &
\multirow{-2}{*}{\begin{tabular}[c]{@{}c@{}}Augmented\\ Environment\end{tabular}} &
Show, Hide &
\multirow{-2}{*}{E, VO} \\ \cline{2-5}
&
Walk In &
&
Show, Hide &
\\ \cline{2-2} \cline{4-4}
&
Walk Out &
\multirow{-2}{*}{\begin{tabular}[c]{@{}c@{}}Virtual\\ Environment\end{tabular}} &
Show, Hide &
\multirow{-2}{*}{E, VO} \\ \cline{2-5}
\multirow{-5}{*}{User U} &
\multicolumn{1}{l|}{Look Around} &
\multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}360° Video \\ Environment\end{tabular}} &
\multicolumn{1}{l|}{Change User View} &
\multicolumn{1}{l|}{E, VO} \\ \hline
\end{tabular}
\caption{ Task Combination - Environment (E)}
\label{tab:Envtask}
\end{table}
%% VIRTUAL OBJECT - VISUAL OBJECT
\begin{table}[h]
\centering
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
\rowcolor[HTML]{DAE8FC}
\multicolumn{5}{|l|}{\cellcolor[HTML]{DAE8FC}{\color[HTML]{333333} Interaction/System Event}} &
\multicolumn{2}{l|}{\cellcolor[HTML]{DAE8FC}{\color[HTML]{333333} Effect}} \\ \hline
\rowcolor[HTML]{FFE6CC}
\multicolumn{1}{|l|}{\cellcolor[HTML]{FFE6CC}\begin{tabular}[c]{@{}l@{}}Human\\ Actor\end{tabular}} &
\multicolumn{1}{l|}{\cellcolor[HTML]{FFE6CC}\begin{tabular}[c]{@{}l@{}}User\\ Action\end{tabular}} &
\multicolumn{3}{l|}{\cellcolor[HTML]{FFE6CC}Target} &
\multicolumn{1}{l|}{\cellcolor[HTML]{DAE8FC}} &
\multicolumn{1}{l|}{\cellcolor[HTML]{DAE8FC}Actuator} \\ \hline
&
\begin{tabular}[c]{@{}c@{}}Tap, \\ Press, \\ Click\end{tabular} &
&
&
&
\begin{tabular}[c]{@{}c@{}}Select\\ Component\end{tabular} &
\\ \cline{2-2} \cline{6-6}
&
\begin{tabular}[c]{@{}c@{}}Gaze In \\ and Dwell\end{tabular} &
&
&
&
&
\\ \cline{2-2}
&
Walk In &
&
&
&
\multirow{-2}{*}{Show} &
\\ \cline{2-2} \cline{6-6}
&
Gaze Out &
&
&
&
&
\\ \cline{2-2}
&
Walk Out &
&
\multirow{-5}{*}{} &
\multirow{-5}{*}{} &
\multirow{-2}{*}{Hide} &
\multirow{-5}{*}{E, VO} \\ \cline{2-2} \cline{4-7}
&
&
&
&
&
\begin{tabular}[c]{@{}c@{}}Change \\ Position\end{tabular} &
\\ \cline{6-6}
&
&
&
&
&
\begin{tabular}[c]{@{}c@{}}Change\\ Scale Factor\end{tabular} &
\\ \cline{6-6}
&
&
&
&
&
\begin{tabular}[c]{@{}c@{}}Change\\ Orientation\end{tabular} &
\\ \cline{6-6}
&
\multirow{-4}{*}{Manipulate} &
&
&
\multirow{-4}{*}{} &
\begin{tabular}[c]{@{}c@{}}Change\\ Texture\end{tabular} &
\multirow{-4}{*}{VO} \\ \cline{2-2} \cline{5-7}
&
&
&
&
Model &
&
\\ \cline{2-2} \cline{5-6}
&
&
&
&
&
\begin{tabular}[c]{@{}c@{}}Change \\ Offset\end{tabular} &
\\ \cline{6-6}
&
\multirow{-2}{*}{Swipe} &
&
&
\multirow{-2}{*}{Text} &
\begin{tabular}[c]{@{}c@{}}Change\\ Language\end{tabular} &
\\ \cline{2-2} \cline{5-6}
&
&
&
\multirow{-8}{*}{\begin{tabular}[c]{@{}c@{}}Static \\ Object\\ (SO)\end{tabular}} &
Image &
\begin{tabular}[c]{@{}c@{}}Change\\ Image\end{tabular} &
\\ \cline{2-2} \cline{4-6}
&
&
&
&
&
Play &
\\ \cline{6-6}
&
&
&
&
&
Pause &
\\ \cline{6-6}
&
&
&
&
\multirow{-3}{*}{} &
\begin{tabular}[c]{@{}c@{}}Playback\\ Control\end{tabular} &
\\ \cline{5-6}
&
&
&
&
Model &
&
\\ \cline{5-6}
&
\multirow{-5}{*}{Swipe} &
&
\multirow{-5}{*}{\begin{tabular}[c]{@{}c@{}}Dynamic\\ Object \\ (DO)\end{tabular}} &
Video &
&
\multirow{-9}{*}{VO} \\ \cline{2-2} \cline{4-7}
\multirow{-19}{*}{User U} &
&
\multirow{-19}{*}{\begin{tabular}[c]{@{}c@{}}Visual \\ Object\\ (VO)\end{tabular}} &
\begin{tabular}[c]{@{}c@{}}Operational\\ Object \\ (OO)\end{tabular} &
&
\begin{tabular}[c]{@{}c@{}}Active\\ Custom\\ Action\end{tabular} &
E, VO \\ \hline
\end{tabular}
\caption{ Task Combination - Virtual Object (VO), Visual Object (VIO)}
\label{tab:VIOTask}
\end{table}
%% VIRTUAL OBJECT - AUDITORY OBJECT
\begin{table}[h]
\centering
\begin{tabular}{|c|c|c|c|c|c|}
\hline
\rowcolor[HTML]{DAE8FC}
\multicolumn{4}{|l|}{\cellcolor[HTML]{DAE8FC}{\color[HTML]{333333} Interaction/System Event}} &
\multicolumn{2}{l|}{\cellcolor[HTML]{DAE8FC}{\color[HTML]{333333} Effect}} \\ \hline
\rowcolor[HTML]{FFE6CC}
\multicolumn{1}{|l|}{\cellcolor[HTML]{FFE6CC}\begin{tabular}[c]{@{}l@{}}Human\\ Actor\end{tabular}} &
\multicolumn{1}{l|}{\cellcolor[HTML]{FFE6CC}\begin{tabular}[c]{@{}l@{}}User\\ Action\end{tabular}} &
\multicolumn{2}{l|}{\cellcolor[HTML]{FFE6CC}Target} &
\multicolumn{1}{l|}{\cellcolor[HTML]{DAE8FC}} &
\multicolumn{1}{l|}{\cellcolor[HTML]{DAE8FC}Actuator} \\ \hline
&
\begin{tabular}[c]{@{}c@{}}Effects on \\ AO correspond\\ to User Actions\\ on other \\ Actors\end{tabular} &
\begin{tabular}[c]{@{}c@{}}Auditory \\ Object\\ (AO)\end{tabular} &
&
\begin{tabular}[c]{@{}c@{}}Play,\\ Pause,\\ Change\\ Language,\\ Playback\\ Control,\\ Audio\\ Control\end{tabular} &
Device, VO \\ \cline{2-6}
&
&
&
\begin{tabular}[c]{@{}c@{}}Background\\ Sound\end{tabular} &
&
Device, VO \\ \cline{2-6}
&
&
&
\begin{tabular}[c]{@{}c@{}}Object-associated\\ Sound\end{tabular} &
&
VO \\ \cline{2-6}
\multirow{-4}{*}{User U} &
&
&
\begin{tabular}[c]{@{}c@{}}External\\ Source\end{tabular} &
&
Device, VO \\ \hline
\end{tabular}
\caption{ Task Combination - Virtual Object (VO), Auditory Object (AO)}
\label{tab:AOTask}
\end{table}
\subsection*{Design of the Activity: High-Level Conceptualization}
The high-level Activity conceptualisation sub-model is defined as a compression of the low-level conceptualisation sub-model. It attempts to organise the individual Tasks and specifically the interactions and related effects, so as to construct a sequence that leads the user to the achievement of a particular end. This model does not go into detail about the individual elements that compose it, but rather aims to design the series of steps that the user must complete in order to reach the goal.
\subsubsection*{Activity}
The \emph{Activity} is defined as a flow of Tasks. The description of the flow defines the order in which the Tasks must be executed to build the whole experience. Figure \autoref{fig:Activity} represents the Activity as a collector of Tasks, from the starting Task 0, to the N-th Task that marks the conclusion of the single Activity.
\begin{figure}[h]
\centering
\includegraphics[width=13cm]{Figures/Conceptual Model/Activity.png}
\caption{Activity: graphical representation}
\label{fig:Activity}
\end{figure}
To describe the sequence of the actions we decided to use a well-known notation, namely the concepts derived from the BPMN 2.0 model.
The BPMN notation \footnote{http://www.bpmn.org} was developed by the "Business Process Management Initiative" and the "Object Management Group" \footnote{http://www.omg.org}, non-profit associations bringing together operators in the field of information technology and organisational analysis. The BPMN aims to provide an effective representation standard that is easy to use and understand by business users interested in the problem of modelling, design and possible digitalisation of business processes.
The BPMN is essentially a derivation of the formalism of flow charts but with some additions and modifications that make it possible to overcome certain limitations in the modelling of business processes. It makes it possible to construct business process diagrams (BPD) that represent graphs or networks made up of "objects" represented by the process operations, connected by control flows that define the logical relationship, dependencies and order of execution of the operations themselves.
The BPMN standard defines some basic graphical elements, divided into four categories. We have imported and re-adapted, according to our needs, only two of these categories, considered fundamental to describe the Activities of our model: flow and connecting objects. Flow objects include:
\begin{itemize}
\item Event: The Event is represented by a circle (\autoref{fig:ActivityElements}) and represents something that happens during a process. Events can have a "cause" that triggers them and a possible "outcome". There are three types of events depending on their location within the flow of a process: start, intermediate and end.
\item Node: The Node is represented with a blunt rectangle, indicating what we have previously defined as a Task that is carried out within the process considered (\autoref{fig:ActivityElements}). In the official BMPN 2.0 version the Node is called Activity. To avoid ambiguity with the Activity we defined as a flow of Tasks, we chose the term Node. Moreover, a Node represents an elementary and "atomic" entity, i.e. not further decomposable, the BMPN Activity, instead, can also include complex tasks.
\begin{figure}[h]
\centering
\includegraphics[width=12cm]{Figures/Conceptual Model/ActivityElements.png}
\caption{Activity Flow Objects - Event, Node and Sequence flow}
\label{fig:ActivityElements}
\end{figure}
\item Gateway: The Gateway is represented by a rhombus (\autoref{fig:Gateways}), it defines the points of the Activity where Task flows diverge or converge. It is used to represent traditional decision points as in classic flow charts, but also simple bifurcations of the Task flow into parallel Tasks or conversely the rejoining of parallel Tasks into a single flow. In other words, Gateways alter the normal direct temporal sequences determined by simple connecting elements, introducing the notion of parallelism, synchronisation and alternative paths. Let us consider the following types of gateway:
\begin{itemize}
\item Exclusive: Used to create alternative flows in a Activity. Since only one of the paths can be taken, once a Task has been executed, the others can no longer be executed.
\item Event-driven: the condition that determines the Task to be executed is based on an evaluated event, a condition on the state of the system to be respected.
\item Parallel: links several Tasks and indicates that each of them can be executed in parallel without evaluating any condition.
\item Inclusive: used to create alternative flows in which all tasks are evaluated.
\end{itemize}
\begin{figure}[h]
\centering
\includegraphics[width=10cm]{Figures/Conceptual Model/Gateways.png}
\caption{Activity Flow Objects - Gateways}
\label{fig:Gateways}
\end{figure}
\end{itemize}
In a process the flow elements (events, nodes or gateways) represent "what actually happens" so they must be logically connected to each other. This is what connectors are for.
\begin{itemize}
\item Sequence flow: is drawn with a filled arrow \autoref{fig:Activity} and is used to indicate the logical-sequential order between Nodes and Events.
\end{itemize}
|
(* This file is part of the LLIR Semantics project. *)
(* Licensing information is available in the LICENSE file. *)
(* (C) 2020 Nandor Licker. All rights reserved. *)
Require Import Coq.ZArith.ZArith.
Require Import Coq.Lists.List.
Require Import LLIR.LLIR.
Require Import LLIR.Dom.
Inductive LiveAt: func -> reg -> node -> Prop :=
| live_at:
forall
(f: func) (r: reg) (n: node) (use: node) (p: list node)
(PATH: ReversePath f n p use)
(NO_DEF: forall (def: node), In def (tl p) -> ~DefinedAt f def r)
(USE: UsedAt f use r),
LiveAt f r n.
Theorem live_at_succ:
forall (f: func) (r: reg) (n: node),
LiveAt f r n ->
UsedAt f n r
\/
exists (s: node), SuccOf f n s /\ LiveAt f r s.
Proof.
intros f r n Hlive; inversion Hlive; subst.
inversion PATH; subst.
{ left; auto. }
{
right; exists next; split; auto.
apply live_at with use p0; auto.
intros def Hin.
destruct p0; [inversion Hin|].
simpl in NO_DEF; simpl in Hin.
apply NO_DEF; right; assumption.
}
Qed.
|
(** printing ~ $\neg$ #¬# *)
(** printing -> $\ra$ #→# *)
(** printing => $\Ra$ #⇒# *)
(** printing ==> $\Ra$ #⇒# *)
(** printing <-> $\lra$ #↔# *)
(** printing /\ $\wedge$ #∧# *)
(** printing \/ $\vee$ #∨# *)
(** printing forall $\forall$ #∀# *)
(** printing exist $\exists$ #&exists;# *)
(** * Misc.v: Preliminaries *)
Set Implicit Arguments.
(* Require Export Setoid. *)
Require Export Arith.
From Coq Require Import Lia.
Require Import Coq.Classes.SetoidTactics.
Require Import Coq.Classes.SetoidClass.
Require Import Coq.Classes.Morphisms.
Local Open Scope signature_scope.
(* Should be in standard library Arith.EqNat.beq_nat. *)
Lemma beq_nat_neq: forall x y : nat, x <> y -> false = beq_nat x y.
Proof.
induction x;induction y;simpl;auto.
Qed.
Lemma if_beq_nat_nat_eq_dec : forall A (x y:nat) (a b:A),
(if beq_nat x y then a else b) = if eq_nat_dec x y then a else b.
Proof.
intros A x y a b.
destruct (eq_nat_dec x y);intros;subst.
rewrite <- beq_nat_refl;trivial.
rewrite <- beq_nat_neq;auto.
Qed.
Definition ifte A (test:bool) (thn els:A) := if test then thn else els.
Add Parametric Morphism (A:Type) : (@ifte A)
with signature (eq ==>eq ==> eq ==> eq) as ifte_morphism1.
Proof.
trivial.
Qed.
Add Parametric Morphism (A:Type) x : (@ifte A x)
with signature (eq ==> eq ==> eq) as ifte_morphism2.
Proof.
trivial.
Qed.
Add Parametric Morphism (A:Type) x y : (@ifte A x y)
with signature (eq ==> eq) as ifte_morphism3.
Proof.
trivial.
Qed.
(** ** Definition of iterator [compn]
[compn f u n x] is defined as (f (u (n-1)).. (f (u 0) x)) *)
Fixpoint compn (A:Type)(f:A -> A -> A) (x:A) (u:nat -> A) (n:nat) {struct n}: A :=
match n with O => x | (S p) => f (u p) (compn f x u p) end.
Lemma comp0 : forall (A:Type) (f:A -> A -> A) (x:A) (u:nat -> A), compn f x u 0 = x.
trivial.
Qed.
Lemma compS : forall (A:Type) (f:A -> A -> A) (x:A) (u:nat -> A) (n:nat),
compn f x u (S n) = f (u n) (compn f x u n).
trivial.
Qed.
(** ** Reducing if constructs *)
Lemma if_then : forall (P:Prop) (b:{ P }+{ ~ P })(A:Type)(p q:A),
P -> (if b then p else q) = p.
destruct b; simpl; intuition.
Qed.
Lemma if_else : forall (P :Prop) (b:{ P }+{ ~ P })(A:Type)(p q:A),
~P -> (if b then p else q) = q.
destruct b; simpl; intuition.
Qed.
Lemma if_then_not : forall (P Q:Prop) (b:{ P }+{ Q })(A:Type)(p q:A),
~ Q -> (if b then p else q) = p.
destruct b; simpl; intuition.
Qed.
Lemma if_else_not : forall (P Q:Prop) (b:{ P }+{ Q })(A:Type)(p q:A),
~P -> (if b then p else q) = q.
destruct b; simpl; intuition.
Qed.
(** ** Classical reasoning *)
Definition class (A:Prop) := ~ ~ A -> A.
Lemma class_neg : forall A:Prop, class ( ~ A).
unfold class; intuition.
Qed.
Lemma class_false : class False.
unfold class; intuition.
Qed.
#[export] Hint Resolve class_neg class_false : core.
Definition orc (A B:Prop) := forall C:Prop, class C -> (A -> C) -> (B -> C) -> C.
Lemma orc_left : forall A B:Prop, A -> orc A B.
red;intuition.
Qed.
Lemma orc_right : forall A B:Prop, B -> orc A B.
red;intuition.
Qed.
#[export] Hint Resolve orc_left orc_right : core.
Lemma class_orc : forall A B, class (orc A B).
repeat red; intros.
apply H0; red; intro.
apply H; red; intro.
apply H3; apply H4; auto.
Qed.
Arguments class_orc [A B].
Lemma orc_intro : forall A B, ( ~ A -> ~ B -> False) -> orc A B.
intros; apply class_orc; red; intros.
apply H; red; auto.
Qed.
Lemma class_and : forall A B, class A -> class B -> class (A /\ B).
unfold class; intuition.
Qed.
Lemma excluded_middle : forall A, orc A ( ~ A).
red; intros.
apply H; red; intro.
intuition.
Qed.
Definition exc (A :Type)(P:A -> Prop) :=
forall C:Prop, class C -> (forall x:A, P x -> C) -> C.
Lemma exc_intro : forall (A :Type)(P:A -> Prop) (x:A), P x -> exc P.
red;firstorder.
Qed.
Lemma class_exc : forall (A :Type)(P:A -> Prop), class (exc P).
repeat red; intros.
apply H0; clear H0; red; intro.
apply H; clear H; red; intro H2.
apply H2; intros; auto.
apply H0; apply (H1 x); auto.
Qed.
Lemma exc_intro_class : forall (A:Type) (P:A -> Prop), ((forall x, ~ P x) -> False) -> exc P.
intros; apply class_exc; red; intros.
apply H; red; intros; auto.
apply H0; apply exc_intro with (x:=x);auto.
Qed.
Lemma not_and_elim_left : forall A B, ~ (A /\ B) -> A -> ~B.
intuition.
Qed.
Lemma not_and_elim_right : forall A B, ~ (A /\ B) -> B -> ~A.
intuition.
Qed.
#[export] Hint Resolve class_orc class_and class_exc excluded_middle : core.
Lemma class_double_neg : forall P Q: Prop, class Q -> (P -> Q) -> ~ ~ P -> Q.
intros.
apply (excluded_middle (A:=P)); auto.
Qed.
(** ** Extensional equality *)
Definition feq A B (f g : A -> B) := forall x, f x = g x.
Lemma feq_refl : forall A B (f:A->B), feq f f.
red; trivial.
Qed.
Lemma feq_sym : forall A B (f g : A -> B), feq f g -> feq g f.
unfold feq; auto.
Qed.
Lemma feq_trans : forall A B (f g h: A -> B), feq f g -> feq g h -> feq f h.
unfold feq; intros.
transitivity (g x); auto.
Qed.
#[export] Hint Resolve feq_refl : core.
#[export] Hint Immediate feq_sym : core.
#[export] Hint Unfold feq : core.
Add Parametric Relation (A B : Type) : (A -> B) (feq (A:=A) (B:=B))
reflexivity proved by (feq_refl (A:=A) (B:=B))
symmetry proved by (feq_sym (A:=A) (B:=B))
transitivity proved by (feq_trans (A:=A) (B:=B))
as feq_rel.
(** Computational version of elimination on CompSpec *)
Lemma CompSpec_rect : forall (A : Type) (eq lt : A -> A -> Prop) (x y : A)
(P : comparison -> Type),
(eq x y -> P Eq) ->
(lt x y -> P Lt) ->
(lt y x -> P Gt)
-> forall c : comparison, CompSpec eq lt x y c -> P c.
intros A eq lt x y P Peq Plt1 Plt2; destruct c; intro.
apply Peq; inversion H; auto.
apply Plt1; inversion H; auto.
apply Plt2; inversion H; auto.
Defined.
(** Decidability *)
Lemma dec_sig_lt : forall P : nat -> Prop, (forall x, {P x}+{ ~ P x})
-> forall n, {i | i < n /\ P i}+{forall i, i < n -> ~ P i}.
intros P Pdec.
induction n.
right; intros; exfalso; lia.
destruct IHn as [(i,(He1,He2))|Hn]; auto.
left; exists i; auto.
destruct (Pdec n) as [HP|HnP].
left; exists n; auto.
right; intros; assert (i < n \/ i = n) as [H1|H2]; subst; auto; try lia.
Defined.
Lemma dec_exists_lt : forall P : nat -> Prop, (forall x, {P x}+{ ~ P x})
-> forall n, {exists i, i < n /\ P i}+{~ exists i, i < n /\ P i}.
intros P decP n; destruct (dec_sig_lt P decP n) as [(i,(H1,H2))|H].
left; exists i; auto.
right; intros (i,(H1,H2)); apply (H i H1 H2).
Qed.
Definition eq_nat2_dec : forall p q : nat*nat, { p=q }+{~ p=q }.
intros (p1,p2) (q1,q2).
destruct (eq_nat_dec p1 q1) as [H1|H1]; subst.
destruct (eq_nat_dec p2 q2) as [H2|H2]; subst; auto with zarith.
right; intro Heq; apply H2.
injection Heq; trivial.
right; intro Heq; apply H1.
injection Heq; trivial.
Defined.
Lemma nat_compare_specT
: forall x y : nat, CompareSpecT (x = y) (x < y)%nat (y < x)%nat (Nat.compare x y).
intros; apply CompareSpec2Type.
apply Nat.compare_spec.
Qed.
(** * Preliminary lemmas relating the ordre on nat and N *)
Require Export NArith.
Lemma N2Nat_lt_mono : forall n m, (n < m)%N <-> (N.to_nat n < N.to_nat m)%nat.
unfold N.lt; intros n m; rewrite N2Nat.inj_compare.
rewrite <- nat_compare_lt; split; auto.
Qed.
Lemma N2Nat_le_mono : forall n m, (n <= m)%N <-> (N.to_nat n <= N.to_nat m)%nat.
unfold N.le; intros n m; rewrite N2Nat.inj_compare.
rewrite <- nat_compare_le; split; trivial.
Qed.
Lemma N2Nat_inj_lt : forall n m, (n < m)%N -> (N.to_nat n < N.to_nat m)%nat.
intros; rewrite <- N2Nat_lt_mono; trivial.
Qed.
Lemma N2Nat_inj_le : forall n m, (n <= m)%N -> (N.to_nat n <= N.to_nat m)%nat.
intros; rewrite <- N2Nat_le_mono; trivial.
Qed.
Lemma N2Nat_inj_pos : forall n, (0 < n)%N -> (0 < N.to_nat n)%nat.
unfold N.lt; intros n; rewrite N2Nat.inj_compare.
rewrite <- nat_compare_lt; trivial.
Qed.
#[export] Hint Resolve N2Nat_inj_lt N2Nat_inj_pos N2Nat_inj_le : core.
Lemma Nsucc_pred_pos: forall n : N, (0 < n)%N -> N.succ (N.pred n) = n.
intros; apply N.lt_succ_pred with (0%N); trivial.
Qed.
#[export] Hint Resolve Nsucc_pred_pos : core.
Lemma Npos : forall n, (0 <= n)%N.
destruct n; discriminate.
Qed.
#[export] Hint Resolve Npos : core.
Lemma Neq_lt_0 : forall n, (n=0)%N \/ (0<n)%N.
intros; destruct (N.lt_eq_cases 0 n) as (Heq,_); intros.
destruct Heq; auto.
Qed.
#[export] Hint Resolve Neq_lt_0 : core.
Lemma Nlt0_le1 : forall n, (0<n)%N -> (1<=n)%N.
intros; change (N.succ 0 <= n)%N; rewrite N.le_succ_l; auto.
Qed.
#[export] Hint Immediate Nlt0_le1 : core.
(* Tactic to deal with closed inequalities on N *)
Ltac Nineq :=
match goal with
|- (N.le ?n ?m) => compute; discriminate
| |- (N.lt ?n ?m) => compute; reflexivity
| |- ~ (eq (A:=N) ?n ?m) => rewrite <- N.compare_eq_iff; compute; discriminate
end.
|
REBOL [
System: "REBOL [R3] Language Interpreter and Run-time Environment"
Title: "REBOL 3 Boot Base: Constants and Equates"
Rights: {
Copyright 2012 REBOL Technologies
REBOL is a trademark of REBOL Technologies
}
License: {
Licensed under the Apache License, Version 2.0
See: http://www.apache.org/licenses/LICENSE-2.0
}
Note: {
This code is evaluated just after actions, natives, sysobj, and other lower
levels definitions. This file intializes a minimal working environment
that is used for the rest of the boot.
}
]
; NOTE: The system is not fully booted at this point, so only simple
; expressions are allowed. Anything else will crash the boot.
; Standard constants
on: true
off: false
yes: true
no: false
zero: 0
; Special values
sys: system/contexts/sys
lib: system/contexts/lib
; Char constants
nul: NUL: #"^(NULL)"
space: #" "
sp: SP: space
backspace: #"^(BACK)"
bs: BS: backspace
tab: #"^-"
newline: #"^/"
newpage: #"^l"
slash: #"/"
backslash: #"\"
escape: #"^(ESC)"
cr: CR: #"^M"
lf: LF: newline
; Function synonyms
to-logic: :did
min: :minimum
max: :maximum
abs: :absolute
; Note: NULL symbol is in lib context slot 1, is initialized on boot
blank: _ ; e.g. sometimes `return blank` reads better than `return _`
; A "blackhole" is a name for the usage of the NUL character in the sense of
; "truthy emptiness". e.g. `set # 10` will not error, while `set _ 10` will.
; It was chosen for its looks, and since it also acts as the '\0' character it
; feels a bit like "sending things to `/dev/null`".
;
blackhole: #
; Concept of ~ as shorthand for ~unset~ is given here:
; https://forum.rebol.info/t/three-single-character-intents-x-x-and-x/1620
;
; !!! Should ~ be a BAD-WORD! or is this a good idea? Let's get experience...
;
~: does [~unset~]
|
lemma isolated_singularity_at_powr[singularity_intros]: assumes "isolated_singularity_at f z" "\<forall>\<^sub>F w in (at z). f w\<noteq>0" shows "isolated_singularity_at (\<lambda>w. (f w) powr (of_int n)) z" |
lemma bounded_interior[intro]: "bounded S \<Longrightarrow> bounded(interior S)" |
module nevanlinna_ac
__precompile__()
#setprecision(BigFloat, 128)
#BigFloat defalt precision 256
using LinearAlgebra
using Random; Random.seed!()
using DelimitedFiles
export eye, delta, gaussian, multi_gaussian
export Masubara_freq, Masubara_GF
export h, invh, h1, invh1
export Giωn, MasubaraGF, make_input
export pick_matrix, ispossemidef, isNevanlinnasolvable
export core, evaluation, spectrum_density
#input file format: ωn Re[G(iωn)] Im[G(iωn)]
include("utilities.jl")
include("interpolate.jl")
end |
[STATEMENT]
lemma lookup_tensor_vec:
assumes "is\<lhd>ds"
shows "lookup_base ds (tensor_vec_from_lookup ds e) is = e is"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. lookup_base ds (tensor_vec_from_lookup ds e) is = e is
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is \<lhd> ds
goal (1 subgoal):
1. lookup_base ds (tensor_vec_from_lookup ds e) is = e is
[PROOF STEP]
proof (induction arbitrary:e rule:valid_index.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
1. \<And>e. lookup_base [] (tensor_vec_from_lookup [] e) [] = e []
2. \<And>is ds i d e. \<lbrakk>is \<lhd> ds; \<And>e. lookup_base ds (tensor_vec_from_lookup ds e) is = e is; i < d\<rbrakk> \<Longrightarrow> lookup_base (d # ds) (tensor_vec_from_lookup (d # ds) e) (i # is) = e (i # is)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
goal (2 subgoals):
1. \<And>e. lookup_base [] (tensor_vec_from_lookup [] e) [] = e []
2. \<And>is ds i d e. \<lbrakk>is \<lhd> ds; \<And>e. lookup_base ds (tensor_vec_from_lookup ds e) is = e is; i < d\<rbrakk> \<Longrightarrow> lookup_base (d # ds) (tensor_vec_from_lookup (d # ds) e) (i # is) = e (i # is)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. lookup_base [] (tensor_vec_from_lookup [] e) [] = e []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lookup_base [] (tensor_vec_from_lookup [] e) [] = e []
goal (1 subgoal):
1. \<And>is ds i d e. \<lbrakk>is \<lhd> ds; \<And>e. lookup_base ds (tensor_vec_from_lookup ds e) is = e is; i < d\<rbrakk> \<Longrightarrow> lookup_base (d # ds) (tensor_vec_from_lookup (d # ds) e) (i # is) = e (i # is)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<And>is ds i d e. \<lbrakk>is \<lhd> ds; \<And>e. lookup_base ds (tensor_vec_from_lookup ds e) is = e is; i < d\<rbrakk> \<Longrightarrow> lookup_base (d # ds) (tensor_vec_from_lookup (d # ds) e) (i # is) = e (i # is)
[PROOF STEP]
case (Cons "is" ds i d e)
[PROOF STATE]
proof (state)
this:
is \<lhd> ds
i < d
lookup_base ds (tensor_vec_from_lookup ds ?e) is = ?e is
goal (1 subgoal):
1. \<And>is ds i d e. \<lbrakk>is \<lhd> ds; \<And>e. lookup_base ds (tensor_vec_from_lookup ds e) is = e is; i < d\<rbrakk> \<Longrightarrow> lookup_base (d # ds) (tensor_vec_from_lookup (d # ds) e) (i # is) = e (i # is)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is \<lhd> ds
i < d
lookup_base ds (tensor_vec_from_lookup ds ?e) is = ?e is
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
is \<lhd> ds
i < d
lookup_base ds (tensor_vec_from_lookup ds ?e) is = ?e is
goal (1 subgoal):
1. lookup_base (d # ds) (tensor_vec_from_lookup (d # ds) e) (i # is) = e (i # is)
[PROOF STEP]
unfolding tensor_vec_from_lookup_Cons lookup_base_Cons
[PROOF STATE]
proof (prove)
using this:
is \<lhd> ds
i < d
lookup_base ds (tensor_vec_from_lookup ds ?e) is = ?e is
goal (1 subgoal):
1. lookup_base ds (fixed_length_sublist (concat (map (\<lambda>i. tensor_vec_from_lookup ds (\<lambda>is. e (i # is))) [0..<d])) (prod_list ds) i) is = e (i # is)
[PROOF STEP]
by (simp add: length_tensor_vec_from_lookup concat_parts'[of d "\<lambda>i. tensor_vec_from_lookup ds (\<lambda>is. e (i # is))" "prod_list ds" i] \<open>i < d\<close>)
[PROOF STATE]
proof (state)
this:
lookup_base (d # ds) (tensor_vec_from_lookup (d # ds) e) (i # is) = e (i # is)
goal:
No subgoals!
[PROOF STEP]
qed |
! RUN: %python %S/test_errors.py %s %flang_fc1
! Tests module procedures declared and defined in the same module.
! These cases are correct.
module m1
interface
integer module function f1(x)
real, intent(in) :: x
end function
integer module function f2(x)
real, intent(in) :: x
end function
module function f3(x) result(res)
integer :: res
real, intent(in) :: x
end function
module function f4(x) result(res)
integer :: res
real, intent(in) :: x
end function
module subroutine s1
end subroutine
pure module subroutine s2
end subroutine
module subroutine s3
end subroutine
end interface
contains
integer module function f1(x)
real, intent(in) :: x
f1 = x
end function
module procedure f2
f2 = x
end procedure
module function f3(x) result(res)
integer :: res
real, intent(in) :: x
res = x
end function
module procedure f4
res = x
end procedure
module subroutine s1
end subroutine
pure module subroutine s2
end subroutine
module procedure s3
end procedure
end module
! Error cases
module m2
interface
integer module function f1(x)
real, intent(in) :: x
end function
integer module function f2(x)
real, intent(in) :: x
end function
module function f3(x) result(res)
integer :: res
real, intent(in) :: x
end function
module function f4(x) result(res)
integer :: res
real, intent(in) :: x
end function
module subroutine s1
end subroutine
pure module subroutine s2
end subroutine
end interface
contains
integer module function f1(x)
!ERROR: Dummy argument 'x' has type INTEGER(4); the corresponding argument in the interface body has type REAL(4)
integer, intent(in) :: x
f1 = x
end function
!ERROR: 'notf2' was not declared a separate module procedure
module procedure notf2
end procedure
!ERROR: Return type of function 'f3' does not match return type of the corresponding interface body
module function f3(x) result(res)
real :: res
real, intent(in) :: x
res = x
end function
!ERROR: Module subroutine 'f4' was declared as a function in the corresponding interface body
module subroutine f4
end subroutine
!ERROR: Module function 's1' was declared as a subroutine in the corresponding interface body
module function s1
end function
!ERROR: Module subprogram 's2' and its corresponding interface body are not both PURE
impure module subroutine s2
end subroutine
end module
|
A set is a $G_\delta$ set if and only if its complement is an $F_\sigma$ set. |
/-
Copyright (c) 2022 Yaël Dillies, George Shakan. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yaël Dillies, George Shakan
-/
import combinatorics.double_counting
import data.finset.pointwise
import data.rat.nnrat
/-!
# The Plünnecke-Ruzsa inequality
> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
> Any changes to this file require a corresponding PR to mathlib4.
This file proves Ruzsa's triangle inequality, the Plünnecke-Petridis lemma, and the Plünnecke-Ruzsa
inequality.
## Main declarations
* `finset.card_sub_mul_le_card_sub_mul_card_sub`: Ruzsa's triangle inequality, difference version.
* `finset.card_add_mul_le_card_add_mul_card_add`: Ruzsa's triangle inequality, sum version.
* `finset.pluennecke_petridis`: The Plünnecke-Petridis lemma.
* `finset.card_smul_div_smul_le`: The Plünnecke-Ruzsa inequality.
## References
* [Giorgis Petridis, *The Plünnecke-Ruzsa inequality: an overview*][petridis2014]
* [Terrence Tao, Van Vu, *Additive Combinatorics][tao-vu]
-/
open nat
open_locale nnrat pointwise
namespace finset
variables {α : Type*} [comm_group α] [decidable_eq α] {A B C : finset α}
/-- **Ruzsa's triangle inequality**. Division version. -/
@[to_additive card_sub_mul_le_card_sub_mul_card_sub
"**Ruzsa's triangle inequality**. Subtraction version."]
lemma card_div_mul_le_card_div_mul_card_div (A B C : finset α) :
(A / C).card * B.card ≤ (A / B).card * (B / C).card :=
begin
rw [←card_product (A / B), ←mul_one ((finset.product _ _).card)],
refine card_mul_le_card_mul (λ b ac, ac.1 * ac.2 = b) (λ x hx, _)
(λ x hx, card_le_one_iff.2 $ λ u v hu hv,
((mem_bipartite_below _).1 hu).2.symm.trans ((mem_bipartite_below _).1 hv).2),
obtain ⟨a, c, ha, hc, rfl⟩ := mem_div.1 hx,
refine card_le_card_of_inj_on (λ b, (a / b, b / c)) (λ b hb, _) (λ b₁ _ b₂ _ h, _),
{ rw mem_bipartite_above,
exact ⟨mk_mem_product (div_mem_div ha hb) (div_mem_div hb hc), div_mul_div_cancel' _ _ _⟩ },
{ exact div_right_injective (prod.ext_iff.1 h).1 }
end
/-- **Ruzsa's triangle inequality**. Div-mul-mul version. -/
@[to_additive card_sub_mul_le_card_add_mul_card_add
"**Ruzsa's triangle inequality**. Sub-add-add version."]
lemma card_div_mul_le_card_mul_mul_card_mul (A B C : finset α) :
(A / C).card * B.card ≤ (A * B).card * (B * C).card :=
begin
rw [←div_inv_eq_mul, ←card_inv B, ←card_inv (B * C), mul_inv, ←div_eq_mul_inv],
exact card_div_mul_le_card_div_mul_card_div _ _ _,
end
/-- **Ruzsa's triangle inequality**. Mul-div-div version. -/
@[to_additive card_add_mul_le_card_sub_mul_card_add
"**Ruzsa's triangle inequality**. Add-sub-sub version."]
lemma card_mul_mul_le_card_div_mul_card_mul (A B C : finset α) :
(A * C).card * B.card ≤ (A / B).card * (B * C).card :=
by { rw [←div_inv_eq_mul, ←div_inv_eq_mul B], exact card_div_mul_le_card_div_mul_card_div _ _ _ }
/-- **Ruzsa's triangle inequality**. Mul-mul-div version. -/
@[to_additive card_add_mul_le_card_add_mul_card_sub
"**Ruzsa's triangle inequality**. Add-add-sub version."]
lemma card_mul_mul_le_card_mul_mul_card_div (A B C : finset α) :
(A * C).card * B.card ≤ (A * B).card * (B / C).card :=
by { rw [←div_inv_eq_mul, div_eq_mul_inv B], exact card_div_mul_le_card_mul_mul_card_mul _ _ _ }
@[to_additive]
/-! ### Sum triangle inequality -/
-- Auxiliary lemma for Ruzsa's triangle sum inequality, and the Plünnecke-Ruzsa inequality.
@[to_additive]
private lemma mul_aux (hA : A.nonempty) (hAB : A ⊆ B)
(h : ∀ A' ∈ B.powerset.erase ∅, ((A * C).card : ℚ≥0) / ↑(A.card) ≤ ((A' * C).card) / ↑(A'.card)) :
∀ A' ⊆ A, (A * C).card * A'.card ≤ (A' * C).card * A.card :=
begin
rintro A' hAA',
obtain rfl | hA' := A'.eq_empty_or_nonempty,
{ simp },
have hA₀ : (0 : ℚ≥0) < A.card := cast_pos.2 hA.card_pos,
have hA₀' : (0 : ℚ≥0) < A'.card := cast_pos.2 hA'.card_pos,
exact_mod_cast (div_le_div_iff hA₀ hA₀').1 (h _ $ mem_erase_of_ne_of_mem hA'.ne_empty $
mem_powerset.2 $ hAA'.trans hAB),
end
/-- **Ruzsa's triangle inequality**. Multiplication version. -/
@[to_additive card_add_mul_card_le_card_add_mul_card_add
"**Ruzsa's triangle inequality**. Addition version."]
lemma card_mul_mul_card_le_card_mul_mul_card_mul (A B C : finset α) :
(A * C).card * B.card ≤ (A * B).card * (B * C).card :=
begin
obtain rfl | hB := B.eq_empty_or_nonempty,
{ simp },
have hB' : B ∈ B.powerset.erase ∅ := mem_erase_of_ne_of_mem hB.ne_empty (mem_powerset_self _),
obtain ⟨U, hU, hUA⟩ := exists_min_image (B.powerset.erase ∅) (λ U, (U * A).card/U.card : _ → ℚ≥0)
⟨B, hB'⟩,
rw [mem_erase, mem_powerset, ←nonempty_iff_ne_empty] at hU,
refine cast_le.1 (_ : (_ : ℚ≥0) ≤ _),
push_cast,
refine (le_div_iff $ by exact cast_pos.2 hB.card_pos).1 _,
rw [mul_div_right_comm, mul_comm _ B],
refine (cast_le.2 $ card_le_card_mul_left _ hU.1).trans _,
refine le_trans _ (mul_le_mul (hUA _ hB') (cast_le.2 $ card_le_of_subset $
mul_subset_mul_right hU.2) (zero_le _) $ zero_le _),
rw [←mul_div_right_comm, ←mul_assoc],
refine (le_div_iff $ by exact cast_pos.2 hU.1.card_pos).2 _,
exact_mod_cast mul_pluennecke_petridis C (mul_aux hU.1 hU.2 hUA),
end
/-- **Ruzsa's triangle inequality**. Add-sub-sub version. -/
lemma card_mul_mul_le_card_div_mul_card_div (A B C : finset α) :
(A * C).card * B.card ≤ (A / B).card * (B / C).card :=
begin
rw [div_eq_mul_inv, ←card_inv B, ←card_inv (B / C), inv_div', div_inv_eq_mul],
exact card_mul_mul_card_le_card_mul_mul_card_mul _ _ _,
end
/-- **Ruzsa's triangle inequality**. Sub-add-sub version. -/
lemma card_div_mul_le_card_mul_mul_card_div (A B C : finset α) :
(A / C).card * B.card ≤ (A * B).card * (B / C).card :=
by { rw [div_eq_mul_inv, div_eq_mul_inv], exact card_mul_mul_card_le_card_mul_mul_card_mul _ _ _ }
/-- **Ruzsa's triangle inequality**. Sub-sub-add version. -/
lemma card_div_mul_le_card_div_mul_card_mul (A B C : finset α) :
(A / C).card * B.card ≤ (A / B).card * (B * C).card :=
by { rw [←div_inv_eq_mul, div_eq_mul_inv], exact card_mul_mul_le_card_div_mul_card_div _ _ _ }
lemma card_add_nsmul_le {α : Type*} [add_comm_group α] [decidable_eq α] {A B : finset α}
(hAB : ∀ A' ⊆ A, (A + B).card * A'.card ≤ (A' + B).card * A.card) (n : ℕ) :
((A + n • B).card : ℚ≥0) ≤ ((A + B).card / A.card) ^ n * A.card :=
begin
obtain rfl | hA := A.eq_empty_or_nonempty,
{ simp },
induction n with n ih,
{ simp },
rw [succ_nsmul, ←add_assoc, pow_succ, mul_assoc, ←mul_div_right_comm, le_div_iff, ←cast_mul],
swap, exact (cast_pos.2 hA.card_pos),
refine (cast_le.2 $ add_pluennecke_petridis _ hAB).trans _,
rw cast_mul,
exact mul_le_mul_of_nonneg_left ih (zero_le _),
end
@[to_additive]
lemma card_mul_pow_le (hAB : ∀ A' ⊆ A, (A * B).card * A'.card ≤ (A' * B).card * A.card) (n : ℕ) :
((A * B ^ n).card : ℚ≥0) ≤ ((A * B).card / A.card) ^ n * A.card :=
begin
obtain rfl | hA := A.eq_empty_or_nonempty,
{ simp },
induction n with n ih,
{ simp },
rw [pow_succ, ←mul_assoc, pow_succ, @mul_assoc ℚ≥0, ←mul_div_right_comm, le_div_iff, ←cast_mul],
swap, exact (cast_pos.2 hA.card_pos),
refine (cast_le.2 $ mul_pluennecke_petridis _ hAB).trans _,
rw cast_mul,
exact mul_le_mul_of_nonneg_left ih (zero_le _),
end
/-- The **Plünnecke-Ruzsa inequality**. Multiplication version. Note that this is genuinely harder
than the division version because we cannot use a double counting argument. -/
@[to_additive "The **Plünnecke-Ruzsa inequality**. Addition version. Note that this is genuinely
harder than the subtraction version because we cannot use a double counting argument."]
lemma card_pow_div_pow_le (hA : A.nonempty) (B : finset α) (m n : ℕ) :
((B ^ m / B ^ n).card : ℚ≥0) ≤ ((A * B).card / A.card) ^ (m + n) * A.card :=
begin
have hA' : A ∈ A.powerset.erase ∅ := mem_erase_of_ne_of_mem hA.ne_empty (mem_powerset_self _),
obtain ⟨C, hC, hCA⟩ := exists_min_image (A.powerset.erase ∅) (λ C, (C * B).card/C.card : _ → ℚ≥0)
⟨A, hA'⟩,
rw [mem_erase, mem_powerset, ←nonempty_iff_ne_empty] at hC,
refine (mul_le_mul_right $ cast_pos.2 hC.1.card_pos).1 _,
norm_cast,
refine (cast_le.2 $ card_div_mul_le_card_mul_mul_card_mul _ _ _).trans _,
push_cast,
rw mul_comm _ C,
refine (mul_le_mul (card_mul_pow_le (mul_aux hC.1 hC.2 hCA) _)
(card_mul_pow_le (mul_aux hC.1 hC.2 hCA) _) (zero_le _) $ zero_le _).trans _,
rw [mul_mul_mul_comm, ←pow_add, ←mul_assoc],
exact mul_le_mul_of_nonneg_right (mul_le_mul (pow_le_pow_of_le_left (zero_le _) (hCA _ hA') _)
(cast_le.2 $ card_le_of_subset hC.2) (zero_le _) $ zero_le _) (zero_le _),
end
/-- The **Plünnecke-Ruzsa inequality**. Subtraction version. -/
@[to_additive "The **Plünnecke-Ruzsa inequality**. Subtraction version."]
lemma card_pow_div_pow_le' (hA : A.nonempty) (B : finset α) (m n : ℕ) :
((B ^ m / B ^ n).card : ℚ≥0) ≤ ((A / B).card / A.card) ^ (m + n) * A.card :=
begin
rw [←card_inv, inv_div', ←inv_pow, ←inv_pow, div_eq_mul_inv A],
exact card_pow_div_pow_le hA _ _ _,
end
/-- Special case of the **Plünnecke-Ruzsa inequality**. Multiplication version. -/
@[to_additive "Special case of the **Plünnecke-Ruzsa inequality**. Addition version."]
lemma card_pow_le (hA : A.nonempty) (B : finset α) (n : ℕ) :
((B ^ n).card : ℚ≥0) ≤ ((A * B).card / A.card) ^ n * A.card :=
by simpa only [pow_zero, div_one] using card_pow_div_pow_le hA _ _ 0
/-- Special case of the **Plünnecke-Ruzsa inequality**. Division version. -/
@[to_additive "Special case of the **Plünnecke-Ruzsa inequality**. Subtraction version."]
lemma card_pow_le' (hA : A.nonempty) (B : finset α) (n : ℕ) :
((B ^ n).card : ℚ≥0) ≤ ((A / B).card / A.card) ^ n * A.card :=
by simpa only [pow_zero, div_one] using card_pow_div_pow_le' hA _ _ 0
end finset
|
# Read in data from text connection
datalines <- readLines(tc <- textConnection("710889
B0YBKJ
406566
B0YBLH
228276
B0YBKL
557910
B0YBKR
585284
B0YBKT")); close(tc)
# Check data valid
checkSedol <- function(datalines)
{
ok <- grep("^[[:digit:][:upper:]]{6}$", datalines)
if(length(ok) < length(datalines))
{
stop("there are invalid lines")
}
}
checkSedol(datalines)
# Append check digit
appendCheckDigit <- function(x)
{
if(length(x) > 1) return(sapply(x, appendCheckDigit))
ascii <- as.integer(charToRaw(x))
scores <- ifelse(ascii < 65, ascii - 48, ascii - 55)
weights <- c(1, 3, 1, 7, 3, 9)
chkdig <- (10 - sum(scores * weights) %% 10) %% 10
paste(x, as.character(chkdig), sep="")
}
withchkdig <- appendCheckDigit(datalines)
#Print in format requested
writeLines(withchkdig)
|
{-# OPTIONS --without-K #-}
open import Base
module Spaces.WedgeCircles {i} (A : Set i) where
{-
The idea is
data wedge-circles : Set (suc i) where
base : wedge-circles
loops : A → base ≡ base
-}
private
data #wedge-circles : Set (suc i) where
#base : #wedge-circles
wedge-circles : Set (suc i)
wedge-circles = #wedge-circles
base : wedge-circles
base = #base
postulate -- HIT
loops : A → base ≡ base
wedge-circles-rec : ∀ {i} (P : wedge-circles → Set i) (x : P base)
(p : (t : A) → transport P (loops t) x ≡ x) → ((t : wedge-circles) → P t)
wedge-circles-rec P x p #base = x
postulate -- HIT
β : ∀ {i} (P : wedge-circles → Set i) (x : P base)
(p : (t : A) → transport P (loops t) x ≡ x) (t : A)
→ apd (wedge-circles-rec P x p) (loops t) ≡ p t
wedge-circles-rec-nondep : ∀ {i} (B : Set i) (x : B) (p : A → x ≡ x)
→ (wedge-circles → B)
wedge-circles-rec-nondep B x p #base = x
postulate -- HIT
β-nondep : ∀ {i} (B : Set i) (x : B) (p : A → x ≡ x) (t : A)
→ ap (wedge-circles-rec-nondep B x p) (loops t) ≡ p t
|
As employers search for applicants within labor pools that were once considered taboo, the employment process has become a corporate version of the game we used to play as kids . . . hide-and-seek. Unscrupulous prospective employees have no incentive to reveal their tarnished work histories. In fact, they do everything they can to cover them up. When successful, they put employers at great risk.
Low unemployment has made it more difficult and expensive to recruit employees. Since it is so much harder to get quality applicants than it was in the past, it can be tempting for managers to cut corners, overlook potential problems, and hope for the best.
Employers have no choice but to protect themselves. It's imperative that they do all within their power to gather the information they need to make sound hiring decisions. The risks associated with hiring from the least-desirable applicant pools are much greater. The consequences are more severe. Using a hiring process that fails to incorporate background checks, interviews, skill assessments, personality assessments, attitude assessments, educational verifications, trial periods, and reference checks is like agreeing to play Russian roulette without observing all the chambers of the weapon first.
Click here for more articles by Mason Duchatschek. |
lemma zero_mul (m : mynat) : 0 * m = 0 :=
begin
induction m with a ha,
rw mul_zero,
refl,
rw mul_succ,
rw ha,
simp,
end
|
\section{Conclusion}
\label{sec:con}
Software design and implementation defects lead to not only functional
misbehavior but also performance losses. Diagnosing performance problems
caused by software defects are both important and challenging. This chapter
made several contributions to improving the state of the art of diagnosing
real-world performance problems. Our empirical study showed that end users
often use comparison-based methods to observe and report performance problems,
making statistical debugging a promising choice for performance diagnosis.
Our investigation of different design points of statistical debugging shows
that branch predicates, with the help of two types of statistical models, are
especially helpful for performance diagnosis. It points out useful failure
predictors for 19 out of 20 real-world performance problems.
Furthermore, our investigation shows that statistical debugging can also
work for production-run performance diagnosis with sampling support, incurring
less than 10\% overhead in our evaluation. Our study also points out
directions for future work on fine-granularity performance diagnosis.
%\acks
%We thank the anonymous reviewers for their valuable comments which have substantially improved the content and presentation of this paper;
%Professor Darko Marinov and Professor Ben Liblit for their insightful feedback and help; Jie Liu for his tremendous help in statistical concepts and methods.
%This work is supported in part by NSF grants CCF-1018180,
%CCF-1054616, and CCF-1217582; and a Clare Boothe Luce
%faculty fellowship.
|
State Before: G : Type u_1
inst✝ : Group G
H K L : Subgroup G
hH : relindex H L ≠ 0
hK : relindex K L ≠ 0
⊢ relindex (H ⊓ K) L ≠ 0 State After: G : Type u_1
inst✝ : Group G
H K L : Subgroup G
hK : relindex K L ≠ 0
hH : relindex H (K ⊓ L) ≠ 0
⊢ relindex (H ⊓ K) L ≠ 0 Tactic: replace hH : H.relindex (K ⊓ L) ≠ 0 := mt (relindex_eq_zero_of_le_right inf_le_right) hH State Before: G : Type u_1
inst✝ : Group G
H K L : Subgroup G
hK : relindex K L ≠ 0
hH : relindex H (K ⊓ L) ≠ 0
⊢ relindex (H ⊓ K) L ≠ 0 State After: G : Type u_1
inst✝ : Group G
H K L : Subgroup G
hK : relindex (K ⊓ L) L ≠ 0
hH : relindex (H ⊓ (K ⊓ L)) (K ⊓ L) ≠ 0
⊢ relindex (H ⊓ K ⊓ L) L ≠ 0 Tactic: rw [← inf_relindex_right] at hH hK⊢ State Before: G : Type u_1
inst✝ : Group G
H K L : Subgroup G
hK : relindex (K ⊓ L) L ≠ 0
hH : relindex (H ⊓ (K ⊓ L)) (K ⊓ L) ≠ 0
⊢ relindex (H ⊓ K ⊓ L) L ≠ 0 State After: G : Type u_1
inst✝ : Group G
H K L : Subgroup G
hK : relindex (K ⊓ L) L ≠ 0
hH : relindex (H ⊓ (K ⊓ L)) (K ⊓ L) ≠ 0
⊢ relindex (H ⊓ (K ⊓ L)) L ≠ 0 Tactic: rw [inf_assoc] State Before: G : Type u_1
inst✝ : Group G
H K L : Subgroup G
hK : relindex (K ⊓ L) L ≠ 0
hH : relindex (H ⊓ (K ⊓ L)) (K ⊓ L) ≠ 0
⊢ relindex (H ⊓ (K ⊓ L)) L ≠ 0 State After: no goals Tactic: exact relindex_ne_zero_trans hH hK |
####
# LCX Oracle tests
####
facts("suppFcnTest LCX") do
srand(8675309); data = randn(100, 2)
#VG There is a disturbing dependency on the solver here!!!!
w = LCXOracle(data, .1, 0; Gamma =.35)
zstar, ustar = suppFcn([1, 1], w, :Min)
@fact zstar --> roughly(-3.1455496412236243)
@fact ustar[1] --> roughly(-1.313810356077738)
@fact ustar[2] --> roughly(-1.8317392851458862)
zstar, ustar = suppFcn([1, 1], w, :Max)
@fact zstar --> roughly(3.447833040263504)
@fact ustar[1] --> roughly(1.5387299947906286)
@fact ustar[2] --> roughly(1.9091030454728752)
zstar, ustar = suppFcn([-1, 1], w, :Min)
@fact zstar --> roughly(-2.8182398717617616)
@fact ustar[1] --> roughly(1.3068007701076567)
@fact ustar[2] --> roughly(-1.5114391016541049)
zstar, ustar = suppFcn([-1, 1], w, :Max)
@fact zstar --> roughly(3.157077158917673)
@fact ustar[1] --> roughly(-1.7212256391067058)
@fact ustar[2] --> roughly(1.4358515198109671)
end
facts("portTest LCX") do
srand(8675309); data = randn(500, 2)
w = LCXOracle(data, .1, .2, Gamma=.2, ab_cut_tol=5e-6)
portTest(w, -1.4293015271256384, [0.5424436347803758, 0.4575563652196242])
end |
[STATEMENT]
lemma ordinal_of_nat_times_omega [simp]:
"0 < k \<Longrightarrow> ordinal_of_nat k * \<omega> = \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. 0 < k \<Longrightarrow> ordinal_of_nat k * \<omega> = \<omega>
[PROOF STEP]
apply (simp add: omega_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. 0 < k \<Longrightarrow> oLimit (\<lambda>n. ordinal_of_nat (k * n)) = oLimit ordinal_of_nat
[PROOF STEP]
apply (rule oLimit_eqI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
1. \<And>n. 0 < k \<Longrightarrow> \<exists>m. ordinal_of_nat (k * n) \<le> ordinal_of_nat m
2. \<And>n. 0 < k \<Longrightarrow> \<exists>m. ordinal_of_nat n \<le> ordinal_of_nat (k * m)
[PROOF STEP]
apply (rule_tac exI, rule order_refl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<And>n. 0 < k \<Longrightarrow> \<exists>m. ordinal_of_nat n \<le> ordinal_of_nat (k * m)
[PROOF STEP]
apply (rule_tac x=n in exI, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done |
args = commandArgs(trailingOnly=TRUE)
if(length(args) < 7){
stop("R --slave < this_code.r --args <gene-bc imputation h5/loom> <gene-bc feature h5/loom> <cell_type.rds> <pca_dim> <res> <gene_name_rds> <mapping function>")
}
source("/home/yuanhao/single_cell/scripts/evaluation_pipeline/evaluation/utilities.r")
if(args[4] == ""){
pca_dim = 50 # useless when feature is provided
}else{
pca_dim = as.integer(args[4])
}
if(args[5] == ""){
res = 1.4
}else{
res = as.numeric(args[5])
}
if(args[2] != ""){
feature_bc_mat = readh5_loom(args[2], is_feature = TRUE)
output_dir = paste(c(delete_last_element(unlist(strsplit(args[1], "/", fixed = T))), "cluster_evaluation_0.3", get_last_element(delete_last_element(unlist(strsplit(args[1], "[/\\.]", perl = T)))), "feature"), collapse = "/")
}else{
output_dir = paste(c(delete_last_element(unlist(strsplit(args[1], "/", fixed = T))), "cluster_evaluation_0.3", get_last_element(delete_last_element(unlist(strsplit(args[1], "[/\\.]", perl = T)))), "pca"), collapse = "/")
feature_bc_mat = NULL
}
gene_bc_mat = get_gene_bc_mat(args[1])
if(args[6] != ""){
gene_bc_mat = gene_bc_mat[gsub("_", "-", rownames(gene_bc_mat)) %in% readRDS(args[6]), ]
}
if(args[7] != ""){
switch(args[7],
"pbmc"={
mapping_function = cell_type_identification_pbmc
},
"retina"={
mapping_function = cell_type_identification_retina
},{
stop("no such mapping")
})
classification_result = seurat_classification(gene_bc_mat = gene_bc_mat, feature_bc_mat = feature_bc_mat, cell_type = readRDS(args[3]),
output_dir = output_dir, pca_dim = pca_dim, res = res, min_pct = 0.25, show_plots = F,
cell_type_identification_fun = mapping_function)
print(classification_result)
}
|
function initial_state_szegedy(sqrtstochastic::SparseMatrixCSC{<:Number})
vec(sqrtstochastic)/sqrt(size(sqrtstochastic, 1))
end
function initial_state(qws::QWSearch{<:AbstractSzegedy})
initial_state_szegedy(qws.model.sqrtstochastic)
end
function evolve(qwd::QWDynamics{<:AbstractSzegedy},
state::AbstractVector{T}) where T<:Number
_evolve_szegedy((qwd.parameters[:operators])..., state)
end
function _evolve_szegedy(operator1::AbstractMatrix{T},
operator2::AbstractMatrix{T},
state::AbstractVector{T}) where T<:Number
operator2*(operator1*state)
end
function measure(::QWDynamics{<:AbstractSzegedy},
state::AbstractVector{<:Number})
dim = floor(Int, sqrt(length(state)))
vec(mapslices(sum, reshape((abs.(state)).^2, (dim, dim)), dims=[1]))
end
function measure(::QWDynamics{<:AbstractSzegedy},
state::AbstractVector{<:Number},
vertices::Vector{Int})
dim = floor(Int, sqrt(length(state)))
vec(mapslices(sum, abs.(reshape(state, (dim, dim))[:,vertices]).^2, dims=[1]))
end
|
# Fisher metric
struct FisherMetric{N} <: AbstractMetric
I::Function
dom::Function
end
# Constructors
FisherMetricManifold(N::Int,I::Function,dom::Function=p->true) = MetricManifold(
Euclidean(N),
FisherMetric{N}(I,dom)
)
FisherMetricManifold(d,dom::Function=p->true) = MetricManifold(
Euclidean(length(fieldnames(d))),
FisherMetric{length(fieldnames(d))}(p -> fim(eval(Expr(:call,d,p...))),dom)
)
# Methods
function local_metric(M::MetricManifold{ℝ,<:AbstractManifold,<:FisherMetric},p,B::InducedBasis)
metric(M).I(p)
end
function check_point(M::MetricManifold{ℝ,<:AbstractManifold,<:FisherMetric{N}}, p; kwargs...) where {N}
(size(p)) == (N,) || return DomainError(size(p),"The size of $p is not $((N,)).")
metric(M).dom(p) || return DomainError(p,"p is not a valid point in the metric domain")
return nothing
end
function log!(M::MetricManifold{ℝ,<:AbstractManifold,<:FisherMetric},X,p,q)
# Use shooting
X .= optimize(X -> norm(q - geodesic(M,p,X)(1.0)), q - p * norm(exp(M,p,X) - p) / norm(q - p)).minimizer
end
function inner(M::MetricManifold{ℝ,<:AbstractManifold,<:FisherMetric},p,X,Y)
X' * metric(M).I(p) * Y
end
# Default basis (to make things easy)
function default_basis(M,p)
induced_basis(M,Manifolds.RetractionAtlas(),p,TangentSpace)
end |
(* Title: HOL/Rings.thy
Author: Gertrud Bauer
Author: Steven Obua
Author: Tobias Nipkow
Author: Lawrence C Paulson
Author: Markus Wenzel
Author: Jeremy Avigad
*)
section {* Rings *}
theory Rings
imports Groups
begin
class semiring = ab_semigroup_add + semigroup_mult +
assumes distrib_right[algebra_simps]: "(a + b) * c = a * c + b * c"
assumes distrib_left[algebra_simps]: "a * (b + c) = a * b + a * c"
begin
text{*For the @{text combine_numerals} simproc*}
lemma combine_common_factor:
"a * e + (b * e + c) = (a + b) * e + c"
by (simp add: distrib_right ac_simps)
end
class mult_zero = times + zero +
assumes mult_zero_left [simp]: "0 * a = 0"
assumes mult_zero_right [simp]: "a * 0 = 0"
begin
lemma mult_not_zero:
"a * b \<noteq> 0 \<Longrightarrow> a \<noteq> 0 \<and> b \<noteq> 0"
by auto
end
class semiring_0 = semiring + comm_monoid_add + mult_zero
class semiring_0_cancel = semiring + cancel_comm_monoid_add
begin
subclass semiring_0
proof
fix a :: 'a
have "0 * a + 0 * a = 0 * a + 0" by (simp add: distrib_right [symmetric])
thus "0 * a = 0" by (simp only: add_left_cancel)
next
fix a :: 'a
have "a * 0 + a * 0 = a * 0 + 0" by (simp add: distrib_left [symmetric])
thus "a * 0 = 0" by (simp only: add_left_cancel)
qed
end
class comm_semiring = ab_semigroup_add + ab_semigroup_mult +
assumes distrib: "(a + b) * c = a * c + b * c"
begin
subclass semiring
proof
fix a b c :: 'a
show "(a + b) * c = a * c + b * c" by (simp add: distrib)
have "a * (b + c) = (b + c) * a" by (simp add: ac_simps)
also have "... = b * a + c * a" by (simp only: distrib)
also have "... = a * b + a * c" by (simp add: ac_simps)
finally show "a * (b + c) = a * b + a * c" by blast
qed
end
class comm_semiring_0 = comm_semiring + comm_monoid_add + mult_zero
begin
subclass semiring_0 ..
end
class comm_semiring_0_cancel = comm_semiring + cancel_comm_monoid_add
begin
subclass semiring_0_cancel ..
subclass comm_semiring_0 ..
end
class zero_neq_one = zero + one +
assumes zero_neq_one [simp]: "0 \<noteq> 1"
begin
lemma one_neq_zero [simp]: "1 \<noteq> 0"
by (rule not_sym) (rule zero_neq_one)
definition of_bool :: "bool \<Rightarrow> 'a"
where
"of_bool p = (if p then 1 else 0)"
lemma of_bool_eq [simp, code]:
"of_bool False = 0"
"of_bool True = 1"
by (simp_all add: of_bool_def)
lemma of_bool_eq_iff:
"of_bool p = of_bool q \<longleftrightarrow> p = q"
by (simp add: of_bool_def)
lemma split_of_bool [split]:
"P (of_bool p) \<longleftrightarrow> (p \<longrightarrow> P 1) \<and> (\<not> p \<longrightarrow> P 0)"
by (cases p) simp_all
lemma split_of_bool_asm:
"P (of_bool p) \<longleftrightarrow> \<not> (p \<and> \<not> P 1 \<or> \<not> p \<and> \<not> P 0)"
by (cases p) simp_all
end
class semiring_1 = zero_neq_one + semiring_0 + monoid_mult
text {* Abstract divisibility *}
class dvd = times
begin
definition dvd :: "'a \<Rightarrow> 'a \<Rightarrow> bool" (infix "dvd" 50) where
"b dvd a \<longleftrightarrow> (\<exists>k. a = b * k)"
lemma dvdI [intro?]: "a = b * k \<Longrightarrow> b dvd a"
unfolding dvd_def ..
lemma dvdE [elim?]: "b dvd a \<Longrightarrow> (\<And>k. a = b * k \<Longrightarrow> P) \<Longrightarrow> P"
unfolding dvd_def by blast
end
context comm_monoid_mult
begin
subclass dvd .
lemma dvd_refl [simp]:
"a dvd a"
proof
show "a = a * 1" by simp
qed
lemma dvd_trans:
assumes "a dvd b" and "b dvd c"
shows "a dvd c"
proof -
from assms obtain v where "b = a * v" by (auto elim!: dvdE)
moreover from assms obtain w where "c = b * w" by (auto elim!: dvdE)
ultimately have "c = a * (v * w)" by (simp add: mult.assoc)
then show ?thesis ..
qed
lemma one_dvd [simp]:
"1 dvd a"
by (auto intro!: dvdI)
lemma dvd_mult [simp]:
"a dvd c \<Longrightarrow> a dvd (b * c)"
by (auto intro!: mult.left_commute dvdI elim!: dvdE)
lemma dvd_mult2 [simp]:
"a dvd b \<Longrightarrow> a dvd (b * c)"
using dvd_mult [of a b c] by (simp add: ac_simps)
lemma dvd_triv_right [simp]:
"a dvd b * a"
by (rule dvd_mult) (rule dvd_refl)
lemma dvd_triv_left [simp]:
"a dvd a * b"
by (rule dvd_mult2) (rule dvd_refl)
lemma mult_dvd_mono:
assumes "a dvd b"
and "c dvd d"
shows "a * c dvd b * d"
proof -
from `a dvd b` obtain b' where "b = a * b'" ..
moreover from `c dvd d` obtain d' where "d = c * d'" ..
ultimately have "b * d = (a * c) * (b' * d')" by (simp add: ac_simps)
then show ?thesis ..
qed
lemma dvd_mult_left:
"a * b dvd c \<Longrightarrow> a dvd c"
by (simp add: dvd_def mult.assoc) blast
lemma dvd_mult_right:
"a * b dvd c \<Longrightarrow> b dvd c"
using dvd_mult_left [of b a c] by (simp add: ac_simps)
end
class comm_semiring_1 = zero_neq_one + comm_semiring_0 + comm_monoid_mult
(*previously almost_semiring*)
begin
subclass semiring_1 ..
lemma dvd_0_left_iff [simp]:
"0 dvd a \<longleftrightarrow> a = 0"
by (auto intro: dvd_refl elim!: dvdE)
lemma dvd_0_right [iff]:
"a dvd 0"
proof
show "0 = a * 0" by simp
qed
lemma dvd_0_left:
"0 dvd a \<Longrightarrow> a = 0"
by simp
lemma dvd_add [simp]:
assumes "a dvd b" and "a dvd c"
shows "a dvd (b + c)"
proof -
from `a dvd b` obtain b' where "b = a * b'" ..
moreover from `a dvd c` obtain c' where "c = a * c'" ..
ultimately have "b + c = a * (b' + c')" by (simp add: distrib_left)
then show ?thesis ..
qed
end
class semiring_dvd = comm_semiring_1 +
assumes dvd_add_times_triv_left_iff [simp]: "a dvd c * a + b \<longleftrightarrow> a dvd b"
assumes dvd_addD: "a dvd b + c \<Longrightarrow> a dvd b \<Longrightarrow> a dvd c"
begin
lemma dvd_add_times_triv_right_iff [simp]:
"a dvd b + c * a \<longleftrightarrow> a dvd b"
using dvd_add_times_triv_left_iff [of a c b] by (simp add: ac_simps)
lemma dvd_add_triv_left_iff [simp]:
"a dvd a + b \<longleftrightarrow> a dvd b"
using dvd_add_times_triv_left_iff [of a 1 b] by simp
lemma dvd_add_triv_right_iff [simp]:
"a dvd b + a \<longleftrightarrow> a dvd b"
using dvd_add_times_triv_right_iff [of a b 1] by simp
lemma dvd_add_right_iff:
assumes "a dvd b"
shows "a dvd b + c \<longleftrightarrow> a dvd c"
using assms by (auto dest: dvd_addD)
lemma dvd_add_left_iff:
assumes "a dvd c"
shows "a dvd b + c \<longleftrightarrow> a dvd b"
using assms dvd_add_right_iff [of a c b] by (simp add: ac_simps)
end
class no_zero_divisors = zero + times +
assumes no_zero_divisors: "a \<noteq> 0 \<Longrightarrow> b \<noteq> 0 \<Longrightarrow> a * b \<noteq> 0"
begin
lemma divisors_zero:
assumes "a * b = 0"
shows "a = 0 \<or> b = 0"
proof (rule classical)
assume "\<not> (a = 0 \<or> b = 0)"
then have "a \<noteq> 0" and "b \<noteq> 0" by auto
with no_zero_divisors have "a * b \<noteq> 0" by blast
with assms show ?thesis by simp
qed
end
class semiring_1_cancel = semiring + cancel_comm_monoid_add
+ zero_neq_one + monoid_mult
begin
subclass semiring_0_cancel ..
subclass semiring_1 ..
end
class comm_semiring_1_cancel = comm_semiring + cancel_comm_monoid_add
+ zero_neq_one + comm_monoid_mult
begin
subclass semiring_1_cancel ..
subclass comm_semiring_0_cancel ..
subclass comm_semiring_1 ..
end
class ring = semiring + ab_group_add
begin
subclass semiring_0_cancel ..
text {* Distribution rules *}
lemma minus_mult_left: "- (a * b) = - a * b"
by (rule minus_unique) (simp add: distrib_right [symmetric])
lemma minus_mult_right: "- (a * b) = a * - b"
by (rule minus_unique) (simp add: distrib_left [symmetric])
text{*Extract signs from products*}
lemmas mult_minus_left [simp] = minus_mult_left [symmetric]
lemmas mult_minus_right [simp] = minus_mult_right [symmetric]
lemma minus_mult_minus [simp]: "- a * - b = a * b"
by simp
lemma minus_mult_commute: "- a * b = a * - b"
by simp
lemma right_diff_distrib [algebra_simps]:
"a * (b - c) = a * b - a * c"
using distrib_left [of a b "-c "] by simp
lemma left_diff_distrib [algebra_simps]:
"(a - b) * c = a * c - b * c"
using distrib_right [of a "- b" c] by simp
lemmas ring_distribs =
distrib_left distrib_right left_diff_distrib right_diff_distrib
lemma eq_add_iff1:
"a * e + c = b * e + d \<longleftrightarrow> (a - b) * e + c = d"
by (simp add: algebra_simps)
lemma eq_add_iff2:
"a * e + c = b * e + d \<longleftrightarrow> c = (b - a) * e + d"
by (simp add: algebra_simps)
end
lemmas ring_distribs =
distrib_left distrib_right left_diff_distrib right_diff_distrib
class comm_ring = comm_semiring + ab_group_add
begin
subclass ring ..
subclass comm_semiring_0_cancel ..
lemma square_diff_square_factored:
"x * x - y * y = (x + y) * (x - y)"
by (simp add: algebra_simps)
end
class ring_1 = ring + zero_neq_one + monoid_mult
begin
subclass semiring_1_cancel ..
lemma square_diff_one_factored:
"x * x - 1 = (x + 1) * (x - 1)"
by (simp add: algebra_simps)
end
class comm_ring_1 = comm_ring + zero_neq_one + comm_monoid_mult
(*previously ring*)
begin
subclass ring_1 ..
subclass comm_semiring_1_cancel ..
subclass semiring_dvd
proof
fix a b c
show "a dvd c * a + b \<longleftrightarrow> a dvd b" (is "?P \<longleftrightarrow> ?Q")
proof
assume ?Q then show ?P by simp
next
assume ?P then obtain d where "c * a + b = a * d" ..
then have "b = a * (d - c)" by (simp add: algebra_simps)
then show ?Q ..
qed
assume "a dvd b + c" and "a dvd b"
show "a dvd c"
proof -
from `a dvd b` obtain d where "b = a * d" ..
moreover from `a dvd b + c` obtain e where "b + c = a * e" ..
ultimately have "a * d + c = a * e" by simp
then have "c = a * (e - d)" by (simp add: algebra_simps)
then show "a dvd c" ..
qed
qed
lemma dvd_minus_iff [simp]: "x dvd - y \<longleftrightarrow> x dvd y"
proof
assume "x dvd - y"
then have "x dvd - 1 * - y" by (rule dvd_mult)
then show "x dvd y" by simp
next
assume "x dvd y"
then have "x dvd - 1 * y" by (rule dvd_mult)
then show "x dvd - y" by simp
qed
lemma minus_dvd_iff [simp]: "- x dvd y \<longleftrightarrow> x dvd y"
proof
assume "- x dvd y"
then obtain k where "y = - x * k" ..
then have "y = x * - k" by simp
then show "x dvd y" ..
next
assume "x dvd y"
then obtain k where "y = x * k" ..
then have "y = - x * - k" by simp
then show "- x dvd y" ..
qed
lemma dvd_diff [simp]:
"x dvd y \<Longrightarrow> x dvd z \<Longrightarrow> x dvd (y - z)"
using dvd_add [of x y "- z"] by simp
end
class semiring_no_zero_divisors = semiring_0 + no_zero_divisors
begin
lemma mult_eq_0_iff [simp]:
shows "a * b = 0 \<longleftrightarrow> a = 0 \<or> b = 0"
proof (cases "a = 0 \<or> b = 0")
case False then have "a \<noteq> 0" and "b \<noteq> 0" by auto
then show ?thesis using no_zero_divisors by simp
next
case True then show ?thesis by auto
qed
end
class ring_no_zero_divisors = ring + semiring_no_zero_divisors
begin
text{*Cancellation of equalities with a common factor*}
lemma mult_cancel_right [simp]:
"a * c = b * c \<longleftrightarrow> c = 0 \<or> a = b"
proof -
have "(a * c = b * c) = ((a - b) * c = 0)"
by (simp add: algebra_simps)
thus ?thesis by (simp add: disj_commute)
qed
lemma mult_cancel_left [simp]:
"c * a = c * b \<longleftrightarrow> c = 0 \<or> a = b"
proof -
have "(c * a = c * b) = (c * (a - b) = 0)"
by (simp add: algebra_simps)
thus ?thesis by simp
qed
lemma mult_left_cancel:
"c \<noteq> 0 \<Longrightarrow> c * a = c * b \<longleftrightarrow> a = b"
by simp
lemma mult_right_cancel:
"c \<noteq> 0 \<Longrightarrow> a * c = b * c \<longleftrightarrow> a = b"
by simp
end
class ring_1_no_zero_divisors = ring_1 + ring_no_zero_divisors
begin
lemma square_eq_1_iff:
"x * x = 1 \<longleftrightarrow> x = 1 \<or> x = - 1"
proof -
have "(x - 1) * (x + 1) = x * x - 1"
by (simp add: algebra_simps)
hence "x * x = 1 \<longleftrightarrow> (x - 1) * (x + 1) = 0"
by simp
thus ?thesis
by (simp add: eq_neg_iff_add_eq_0)
qed
lemma mult_cancel_right1 [simp]:
"c = b * c \<longleftrightarrow> c = 0 \<or> b = 1"
by (insert mult_cancel_right [of 1 c b], force)
lemma mult_cancel_right2 [simp]:
"a * c = c \<longleftrightarrow> c = 0 \<or> a = 1"
by (insert mult_cancel_right [of a c 1], simp)
lemma mult_cancel_left1 [simp]:
"c = c * b \<longleftrightarrow> c = 0 \<or> b = 1"
by (insert mult_cancel_left [of c 1 b], force)
lemma mult_cancel_left2 [simp]:
"c * a = c \<longleftrightarrow> c = 0 \<or> a = 1"
by (insert mult_cancel_left [of c a 1], simp)
end
class idom = comm_ring_1 + no_zero_divisors
begin
subclass ring_1_no_zero_divisors ..
lemma square_eq_iff: "a * a = b * b \<longleftrightarrow> (a = b \<or> a = - b)"
proof
assume "a * a = b * b"
then have "(a - b) * (a + b) = 0"
by (simp add: algebra_simps)
then show "a = b \<or> a = - b"
by (simp add: eq_neg_iff_add_eq_0)
next
assume "a = b \<or> a = - b"
then show "a * a = b * b" by auto
qed
lemma dvd_mult_cancel_right [simp]:
"a * c dvd b * c \<longleftrightarrow> c = 0 \<or> a dvd b"
proof -
have "a * c dvd b * c \<longleftrightarrow> (\<exists>k. b * c = (a * k) * c)"
unfolding dvd_def by (simp add: ac_simps)
also have "(\<exists>k. b * c = (a * k) * c) \<longleftrightarrow> c = 0 \<or> a dvd b"
unfolding dvd_def by simp
finally show ?thesis .
qed
lemma dvd_mult_cancel_left [simp]:
"c * a dvd c * b \<longleftrightarrow> c = 0 \<or> a dvd b"
proof -
have "c * a dvd c * b \<longleftrightarrow> (\<exists>k. b * c = (a * k) * c)"
unfolding dvd_def by (simp add: ac_simps)
also have "(\<exists>k. b * c = (a * k) * c) \<longleftrightarrow> c = 0 \<or> a dvd b"
unfolding dvd_def by simp
finally show ?thesis .
qed
end
text {*
The theory of partially ordered rings is taken from the books:
\begin{itemize}
\item \emph{Lattice Theory} by Garret Birkhoff, American Mathematical Society 1979
\item \emph{Partially Ordered Algebraic Systems}, Pergamon Press 1963
\end{itemize}
Most of the used notions can also be looked up in
\begin{itemize}
\item @{url "http://www.mathworld.com"} by Eric Weisstein et. al.
\item \emph{Algebra I} by van der Waerden, Springer.
\end{itemize}
*}
class ordered_semiring = semiring + comm_monoid_add + ordered_ab_semigroup_add +
assumes mult_left_mono: "a \<le> b \<Longrightarrow> 0 \<le> c \<Longrightarrow> c * a \<le> c * b"
assumes mult_right_mono: "a \<le> b \<Longrightarrow> 0 \<le> c \<Longrightarrow> a * c \<le> b * c"
begin
lemma mult_mono:
"a \<le> b \<Longrightarrow> c \<le> d \<Longrightarrow> 0 \<le> b \<Longrightarrow> 0 \<le> c \<Longrightarrow> a * c \<le> b * d"
apply (erule mult_right_mono [THEN order_trans], assumption)
apply (erule mult_left_mono, assumption)
done
lemma mult_mono':
"a \<le> b \<Longrightarrow> c \<le> d \<Longrightarrow> 0 \<le> a \<Longrightarrow> 0 \<le> c \<Longrightarrow> a * c \<le> b * d"
apply (rule mult_mono)
apply (fast intro: order_trans)+
done
end
class ordered_cancel_semiring = ordered_semiring + cancel_comm_monoid_add
begin
subclass semiring_0_cancel ..
lemma mult_nonneg_nonneg[simp]: "0 \<le> a \<Longrightarrow> 0 \<le> b \<Longrightarrow> 0 \<le> a * b"
using mult_left_mono [of 0 b a] by simp
lemma mult_nonneg_nonpos: "0 \<le> a \<Longrightarrow> b \<le> 0 \<Longrightarrow> a * b \<le> 0"
using mult_left_mono [of b 0 a] by simp
lemma mult_nonpos_nonneg: "a \<le> 0 \<Longrightarrow> 0 \<le> b \<Longrightarrow> a * b \<le> 0"
using mult_right_mono [of a 0 b] by simp
text {* Legacy - use @{text mult_nonpos_nonneg} *}
lemma mult_nonneg_nonpos2: "0 \<le> a \<Longrightarrow> b \<le> 0 \<Longrightarrow> b * a \<le> 0"
by (drule mult_right_mono [of b 0], auto)
lemma split_mult_neg_le: "(0 \<le> a & b \<le> 0) | (a \<le> 0 & 0 \<le> b) \<Longrightarrow> a * b \<le> 0"
by (auto simp add: mult_nonneg_nonpos mult_nonneg_nonpos2)
end
class linordered_semiring = ordered_semiring + linordered_cancel_ab_semigroup_add
begin
subclass ordered_cancel_semiring ..
subclass ordered_comm_monoid_add ..
lemma mult_left_less_imp_less:
"c * a < c * b \<Longrightarrow> 0 \<le> c \<Longrightarrow> a < b"
by (force simp add: mult_left_mono not_le [symmetric])
lemma mult_right_less_imp_less:
"a * c < b * c \<Longrightarrow> 0 \<le> c \<Longrightarrow> a < b"
by (force simp add: mult_right_mono not_le [symmetric])
end
class linordered_semiring_1 = linordered_semiring + semiring_1
begin
lemma convex_bound_le:
assumes "x \<le> a" "y \<le> a" "0 \<le> u" "0 \<le> v" "u + v = 1"
shows "u * x + v * y \<le> a"
proof-
from assms have "u * x + v * y \<le> u * a + v * a"
by (simp add: add_mono mult_left_mono)
thus ?thesis using assms unfolding distrib_right[symmetric] by simp
qed
end
class linordered_semiring_strict = semiring + comm_monoid_add + linordered_cancel_ab_semigroup_add +
assumes mult_strict_left_mono: "a < b \<Longrightarrow> 0 < c \<Longrightarrow> c * a < c * b"
assumes mult_strict_right_mono: "a < b \<Longrightarrow> 0 < c \<Longrightarrow> a * c < b * c"
begin
subclass semiring_0_cancel ..
subclass linordered_semiring
proof
fix a b c :: 'a
assume A: "a \<le> b" "0 \<le> c"
from A show "c * a \<le> c * b"
unfolding le_less
using mult_strict_left_mono by (cases "c = 0") auto
from A show "a * c \<le> b * c"
unfolding le_less
using mult_strict_right_mono by (cases "c = 0") auto
qed
lemma mult_left_le_imp_le:
"c * a \<le> c * b \<Longrightarrow> 0 < c \<Longrightarrow> a \<le> b"
by (force simp add: mult_strict_left_mono _not_less [symmetric])
lemma mult_right_le_imp_le:
"a * c \<le> b * c \<Longrightarrow> 0 < c \<Longrightarrow> a \<le> b"
by (force simp add: mult_strict_right_mono not_less [symmetric])
lemma mult_pos_pos[simp]: "0 < a \<Longrightarrow> 0 < b \<Longrightarrow> 0 < a * b"
using mult_strict_left_mono [of 0 b a] by simp
lemma mult_pos_neg: "0 < a \<Longrightarrow> b < 0 \<Longrightarrow> a * b < 0"
using mult_strict_left_mono [of b 0 a] by simp
lemma mult_neg_pos: "a < 0 \<Longrightarrow> 0 < b \<Longrightarrow> a * b < 0"
using mult_strict_right_mono [of a 0 b] by simp
text {* Legacy - use @{text mult_neg_pos} *}
lemma mult_pos_neg2: "0 < a \<Longrightarrow> b < 0 \<Longrightarrow> b * a < 0"
by (drule mult_strict_right_mono [of b 0], auto)
lemma zero_less_mult_pos:
"0 < a * b \<Longrightarrow> 0 < a \<Longrightarrow> 0 < b"
apply (cases "b\<le>0")
apply (auto simp add: le_less not_less)
apply (drule_tac mult_pos_neg [of a b])
apply (auto dest: less_not_sym)
done
lemma zero_less_mult_pos2:
"0 < b * a \<Longrightarrow> 0 < a \<Longrightarrow> 0 < b"
apply (cases "b\<le>0")
apply (auto simp add: le_less not_less)
apply (drule_tac mult_pos_neg2 [of a b])
apply (auto dest: less_not_sym)
done
text{*Strict monotonicity in both arguments*}
lemma mult_strict_mono:
assumes "a < b" and "c < d" and "0 < b" and "0 \<le> c"
shows "a * c < b * d"
using assms apply (cases "c=0")
apply (simp)
apply (erule mult_strict_right_mono [THEN less_trans])
apply (force simp add: le_less)
apply (erule mult_strict_left_mono, assumption)
done
text{*This weaker variant has more natural premises*}
lemma mult_strict_mono':
assumes "a < b" and "c < d" and "0 \<le> a" and "0 \<le> c"
shows "a * c < b * d"
by (rule mult_strict_mono) (insert assms, auto)
lemma mult_less_le_imp_less:
assumes "a < b" and "c \<le> d" and "0 \<le> a" and "0 < c"
shows "a * c < b * d"
using assms apply (subgoal_tac "a * c < b * c")
apply (erule less_le_trans)
apply (erule mult_left_mono)
apply simp
apply (erule mult_strict_right_mono)
apply assumption
done
lemma mult_le_less_imp_less:
assumes "a \<le> b" and "c < d" and "0 < a" and "0 \<le> c"
shows "a * c < b * d"
using assms apply (subgoal_tac "a * c \<le> b * c")
apply (erule le_less_trans)
apply (erule mult_strict_left_mono)
apply simp
apply (erule mult_right_mono)
apply simp
done
lemma mult_less_imp_less_left:
assumes less: "c * a < c * b" and nonneg: "0 \<le> c"
shows "a < b"
proof (rule ccontr)
assume "\<not> a < b"
hence "b \<le> a" by (simp add: linorder_not_less)
hence "c * b \<le> c * a" using nonneg by (rule mult_left_mono)
with this and less show False by (simp add: not_less [symmetric])
qed
lemma mult_less_imp_less_right:
assumes less: "a * c < b * c" and nonneg: "0 \<le> c"
shows "a < b"
proof (rule ccontr)
assume "\<not> a < b"
hence "b \<le> a" by (simp add: linorder_not_less)
hence "b * c \<le> a * c" using nonneg by (rule mult_right_mono)
with this and less show False by (simp add: not_less [symmetric])
qed
end
class linordered_semiring_1_strict = linordered_semiring_strict + semiring_1
begin
subclass linordered_semiring_1 ..
lemma convex_bound_lt:
assumes "x < a" "y < a" "0 \<le> u" "0 \<le> v" "u + v = 1"
shows "u * x + v * y < a"
proof -
from assms have "u * x + v * y < u * a + v * a"
by (cases "u = 0")
(auto intro!: add_less_le_mono mult_strict_left_mono mult_left_mono)
thus ?thesis using assms unfolding distrib_right[symmetric] by simp
qed
end
class ordered_comm_semiring = comm_semiring_0 + ordered_ab_semigroup_add +
assumes comm_mult_left_mono: "a \<le> b \<Longrightarrow> 0 \<le> c \<Longrightarrow> c * a \<le> c * b"
begin
subclass ordered_semiring
proof
fix a b c :: 'a
assume "a \<le> b" "0 \<le> c"
thus "c * a \<le> c * b" by (rule comm_mult_left_mono)
thus "a * c \<le> b * c" by (simp only: mult.commute)
qed
end
class ordered_cancel_comm_semiring = ordered_comm_semiring + cancel_comm_monoid_add
begin
subclass comm_semiring_0_cancel ..
subclass ordered_comm_semiring ..
subclass ordered_cancel_semiring ..
end
class linordered_comm_semiring_strict = comm_semiring_0 + linordered_cancel_ab_semigroup_add +
assumes comm_mult_strict_left_mono: "a < b \<Longrightarrow> 0 < c \<Longrightarrow> c * a < c * b"
begin
subclass linordered_semiring_strict
proof
fix a b c :: 'a
assume "a < b" "0 < c"
thus "c * a < c * b" by (rule comm_mult_strict_left_mono)
thus "a * c < b * c" by (simp only: mult.commute)
qed
subclass ordered_cancel_comm_semiring
proof
fix a b c :: 'a
assume "a \<le> b" "0 \<le> c"
thus "c * a \<le> c * b"
unfolding le_less
using mult_strict_left_mono by (cases "c = 0") auto
qed
end
class ordered_ring = ring + ordered_cancel_semiring
begin
subclass ordered_ab_group_add ..
lemma less_add_iff1:
"a * e + c < b * e + d \<longleftrightarrow> (a - b) * e + c < d"
by (simp add: algebra_simps)
lemma less_add_iff2:
"a * e + c < b * e + d \<longleftrightarrow> c < (b - a) * e + d"
by (simp add: algebra_simps)
lemma le_add_iff1:
"a * e + c \<le> b * e + d \<longleftrightarrow> (a - b) * e + c \<le> d"
by (simp add: algebra_simps)
lemma le_add_iff2:
"a * e + c \<le> b * e + d \<longleftrightarrow> c \<le> (b - a) * e + d"
by (simp add: algebra_simps)
lemma mult_left_mono_neg:
"b \<le> a \<Longrightarrow> c \<le> 0 \<Longrightarrow> c * a \<le> c * b"
apply (drule mult_left_mono [of _ _ "- c"])
apply simp_all
done
lemma mult_right_mono_neg:
"b \<le> a \<Longrightarrow> c \<le> 0 \<Longrightarrow> a * c \<le> b * c"
apply (drule mult_right_mono [of _ _ "- c"])
apply simp_all
done
lemma mult_nonpos_nonpos: "a \<le> 0 \<Longrightarrow> b \<le> 0 \<Longrightarrow> 0 \<le> a * b"
using mult_right_mono_neg [of a 0 b] by simp
lemma split_mult_pos_le:
"(0 \<le> a \<and> 0 \<le> b) \<or> (a \<le> 0 \<and> b \<le> 0) \<Longrightarrow> 0 \<le> a * b"
by (auto simp add: mult_nonpos_nonpos)
end
class linordered_ring = ring + linordered_semiring + linordered_ab_group_add + abs_if
begin
subclass ordered_ring ..
subclass ordered_ab_group_add_abs
proof
fix a b
show "\<bar>a + b\<bar> \<le> \<bar>a\<bar> + \<bar>b\<bar>"
by (auto simp add: abs_if not_le not_less algebra_simps simp del: add.commute dest: add_neg_neg add_nonneg_nonneg)
qed (auto simp add: abs_if)
lemma zero_le_square [simp]: "0 \<le> a * a"
using linear [of 0 a]
by (auto simp add: mult_nonpos_nonpos)
lemma not_square_less_zero [simp]: "\<not> (a * a < 0)"
by (simp add: not_less)
end
(* The "strict" suffix can be seen as describing the combination of linordered_ring and no_zero_divisors.
Basically, linordered_ring + no_zero_divisors = linordered_ring_strict.
*)
class linordered_ring_strict = ring + linordered_semiring_strict
+ ordered_ab_group_add + abs_if
begin
subclass linordered_ring ..
lemma mult_strict_left_mono_neg: "b < a \<Longrightarrow> c < 0 \<Longrightarrow> c * a < c * b"
using mult_strict_left_mono [of b a "- c"] by simp
lemma mult_strict_right_mono_neg: "b < a \<Longrightarrow> c < 0 \<Longrightarrow> a * c < b * c"
using mult_strict_right_mono [of b a "- c"] by simp
lemma mult_neg_neg: "a < 0 \<Longrightarrow> b < 0 \<Longrightarrow> 0 < a * b"
using mult_strict_right_mono_neg [of a 0 b] by simp
subclass ring_no_zero_divisors
proof
fix a b
assume "a \<noteq> 0" then have A: "a < 0 \<or> 0 < a" by (simp add: neq_iff)
assume "b \<noteq> 0" then have B: "b < 0 \<or> 0 < b" by (simp add: neq_iff)
have "a * b < 0 \<or> 0 < a * b"
proof (cases "a < 0")
case True note A' = this
show ?thesis proof (cases "b < 0")
case True with A'
show ?thesis by (auto dest: mult_neg_neg)
next
case False with B have "0 < b" by auto
with A' show ?thesis by (auto dest: mult_strict_right_mono)
qed
next
case False with A have A': "0 < a" by auto
show ?thesis proof (cases "b < 0")
case True with A'
show ?thesis by (auto dest: mult_strict_right_mono_neg)
next
case False with B have "0 < b" by auto
with A' show ?thesis by auto
qed
qed
then show "a * b \<noteq> 0" by (simp add: neq_iff)
qed
lemma zero_less_mult_iff: "0 < a * b \<longleftrightarrow> 0 < a \<and> 0 < b \<or> a < 0 \<and> b < 0"
by (cases a 0 b 0 rule: linorder_cases[case_product linorder_cases])
(auto simp add: mult_neg_neg not_less le_less dest: zero_less_mult_pos zero_less_mult_pos2)
lemma zero_le_mult_iff: "0 \<le> a * b \<longleftrightarrow> 0 \<le> a \<and> 0 \<le> b \<or> a \<le> 0 \<and> b \<le> 0"
by (auto simp add: eq_commute [of 0] le_less not_less zero_less_mult_iff)
lemma mult_less_0_iff:
"a * b < 0 \<longleftrightarrow> 0 < a \<and> b < 0 \<or> a < 0 \<and> 0 < b"
apply (insert zero_less_mult_iff [of "-a" b])
apply force
done
lemma mult_le_0_iff:
"a * b \<le> 0 \<longleftrightarrow> 0 \<le> a \<and> b \<le> 0 \<or> a \<le> 0 \<and> 0 \<le> b"
apply (insert zero_le_mult_iff [of "-a" b])
apply force
done
text{*Cancellation laws for @{term "c*a < c*b"} and @{term "a*c < b*c"},
also with the relations @{text "\<le>"} and equality.*}
text{*These ``disjunction'' versions produce two cases when the comparison is
an assumption, but effectively four when the comparison is a goal.*}
lemma mult_less_cancel_right_disj:
"a * c < b * c \<longleftrightarrow> 0 < c \<and> a < b \<or> c < 0 \<and> b < a"
apply (cases "c = 0")
apply (auto simp add: neq_iff mult_strict_right_mono
mult_strict_right_mono_neg)
apply (auto simp add: not_less
not_le [symmetric, of "a*c"]
not_le [symmetric, of a])
apply (erule_tac [!] notE)
apply (auto simp add: less_imp_le mult_right_mono
mult_right_mono_neg)
done
lemma mult_less_cancel_left_disj:
"c * a < c * b \<longleftrightarrow> 0 < c \<and> a < b \<or> c < 0 \<and> b < a"
apply (cases "c = 0")
apply (auto simp add: neq_iff mult_strict_left_mono
mult_strict_left_mono_neg)
apply (auto simp add: not_less
not_le [symmetric, of "c*a"]
not_le [symmetric, of a])
apply (erule_tac [!] notE)
apply (auto simp add: less_imp_le mult_left_mono
mult_left_mono_neg)
done
text{*The ``conjunction of implication'' lemmas produce two cases when the
comparison is a goal, but give four when the comparison is an assumption.*}
lemma mult_less_cancel_right:
"a * c < b * c \<longleftrightarrow> (0 \<le> c \<longrightarrow> a < b) \<and> (c \<le> 0 \<longrightarrow> b < a)"
using mult_less_cancel_right_disj [of a c b] by auto
lemma mult_less_cancel_left:
"c * a < c * b \<longleftrightarrow> (0 \<le> c \<longrightarrow> a < b) \<and> (c \<le> 0 \<longrightarrow> b < a)"
using mult_less_cancel_left_disj [of c a b] by auto
lemma mult_le_cancel_right:
"a * c \<le> b * c \<longleftrightarrow> (0 < c \<longrightarrow> a \<le> b) \<and> (c < 0 \<longrightarrow> b \<le> a)"
by (simp add: not_less [symmetric] mult_less_cancel_right_disj)
lemma mult_le_cancel_left:
"c * a \<le> c * b \<longleftrightarrow> (0 < c \<longrightarrow> a \<le> b) \<and> (c < 0 \<longrightarrow> b \<le> a)"
by (simp add: not_less [symmetric] mult_less_cancel_left_disj)
lemma mult_le_cancel_left_pos:
"0 < c \<Longrightarrow> c * a \<le> c * b \<longleftrightarrow> a \<le> b"
by (auto simp: mult_le_cancel_left)
lemma mult_le_cancel_left_neg:
"c < 0 \<Longrightarrow> c * a \<le> c * b \<longleftrightarrow> b \<le> a"
by (auto simp: mult_le_cancel_left)
lemma mult_less_cancel_left_pos:
"0 < c \<Longrightarrow> c * a < c * b \<longleftrightarrow> a < b"
by (auto simp: mult_less_cancel_left)
lemma mult_less_cancel_left_neg:
"c < 0 \<Longrightarrow> c * a < c * b \<longleftrightarrow> b < a"
by (auto simp: mult_less_cancel_left)
end
lemmas mult_sign_intros =
mult_nonneg_nonneg mult_nonneg_nonpos
mult_nonpos_nonneg mult_nonpos_nonpos
mult_pos_pos mult_pos_neg
mult_neg_pos mult_neg_neg
class ordered_comm_ring = comm_ring + ordered_comm_semiring
begin
subclass ordered_ring ..
subclass ordered_cancel_comm_semiring ..
end
class linordered_semidom = comm_semiring_1_cancel + linordered_comm_semiring_strict +
(*previously linordered_semiring*)
assumes zero_less_one [simp]: "0 < 1"
begin
lemma pos_add_strict:
shows "0 < a \<Longrightarrow> b < c \<Longrightarrow> b < a + c"
using add_strict_mono [of 0 a b c] by simp
lemma zero_le_one [simp]: "0 \<le> 1"
by (rule zero_less_one [THEN less_imp_le])
lemma not_one_le_zero [simp]: "\<not> 1 \<le> 0"
by (simp add: not_le)
lemma not_one_less_zero [simp]: "\<not> 1 < 0"
by (simp add: not_less)
lemma less_1_mult:
assumes "1 < m" and "1 < n"
shows "1 < m * n"
using assms mult_strict_mono [of 1 m 1 n]
by (simp add: less_trans [OF zero_less_one])
lemma mult_left_le: "c \<le> 1 \<Longrightarrow> 0 \<le> a \<Longrightarrow> a * c \<le> a"
using mult_left_mono[of c 1 a] by simp
lemma mult_le_one: "a \<le> 1 \<Longrightarrow> 0 \<le> b \<Longrightarrow> b \<le> 1 \<Longrightarrow> a * b \<le> 1"
using mult_mono[of a 1 b 1] by simp
end
class linordered_idom = comm_ring_1 +
linordered_comm_semiring_strict + ordered_ab_group_add +
abs_if + sgn_if
(*previously linordered_ring*)
begin
subclass linordered_semiring_1_strict ..
subclass linordered_ring_strict ..
subclass ordered_comm_ring ..
subclass idom ..
subclass linordered_semidom
proof
have "0 \<le> 1 * 1" by (rule zero_le_square)
thus "0 < 1" by (simp add: le_less)
qed
lemma linorder_neqE_linordered_idom:
assumes "x \<noteq> y" obtains "x < y" | "y < x"
using assms by (rule neqE)
text {* These cancellation simprules also produce two cases when the comparison is a goal. *}
lemma mult_le_cancel_right1:
"c \<le> b * c \<longleftrightarrow> (0 < c \<longrightarrow> 1 \<le> b) \<and> (c < 0 \<longrightarrow> b \<le> 1)"
by (insert mult_le_cancel_right [of 1 c b], simp)
lemma mult_le_cancel_right2:
"a * c \<le> c \<longleftrightarrow> (0 < c \<longrightarrow> a \<le> 1) \<and> (c < 0 \<longrightarrow> 1 \<le> a)"
by (insert mult_le_cancel_right [of a c 1], simp)
lemma mult_le_cancel_left1:
"c \<le> c * b \<longleftrightarrow> (0 < c \<longrightarrow> 1 \<le> b) \<and> (c < 0 \<longrightarrow> b \<le> 1)"
by (insert mult_le_cancel_left [of c 1 b], simp)
lemma mult_le_cancel_left2:
"c * a \<le> c \<longleftrightarrow> (0 < c \<longrightarrow> a \<le> 1) \<and> (c < 0 \<longrightarrow> 1 \<le> a)"
by (insert mult_le_cancel_left [of c a 1], simp)
lemma mult_less_cancel_right1:
"c < b * c \<longleftrightarrow> (0 \<le> c \<longrightarrow> 1 < b) \<and> (c \<le> 0 \<longrightarrow> b < 1)"
by (insert mult_less_cancel_right [of 1 c b], simp)
lemma mult_less_cancel_right2:
"a * c < c \<longleftrightarrow> (0 \<le> c \<longrightarrow> a < 1) \<and> (c \<le> 0 \<longrightarrow> 1 < a)"
by (insert mult_less_cancel_right [of a c 1], simp)
lemma mult_less_cancel_left1:
"c < c * b \<longleftrightarrow> (0 \<le> c \<longrightarrow> 1 < b) \<and> (c \<le> 0 \<longrightarrow> b < 1)"
by (insert mult_less_cancel_left [of c 1 b], simp)
lemma mult_less_cancel_left2:
"c * a < c \<longleftrightarrow> (0 \<le> c \<longrightarrow> a < 1) \<and> (c \<le> 0 \<longrightarrow> 1 < a)"
by (insert mult_less_cancel_left [of c a 1], simp)
lemma sgn_sgn [simp]:
"sgn (sgn a) = sgn a"
unfolding sgn_if by simp
lemma sgn_0_0:
"sgn a = 0 \<longleftrightarrow> a = 0"
unfolding sgn_if by simp
lemma sgn_1_pos:
"sgn a = 1 \<longleftrightarrow> a > 0"
unfolding sgn_if by simp
lemma sgn_1_neg:
"sgn a = - 1 \<longleftrightarrow> a < 0"
unfolding sgn_if by auto
lemma sgn_pos [simp]:
"0 < a \<Longrightarrow> sgn a = 1"
unfolding sgn_1_pos .
lemma sgn_neg [simp]:
"a < 0 \<Longrightarrow> sgn a = - 1"
unfolding sgn_1_neg .
lemma sgn_times:
"sgn (a * b) = sgn a * sgn b"
by (auto simp add: sgn_if zero_less_mult_iff)
lemma abs_sgn: "\<bar>k\<bar> = k * sgn k"
unfolding sgn_if abs_if by auto
lemma sgn_greater [simp]:
"0 < sgn a \<longleftrightarrow> 0 < a"
unfolding sgn_if by auto
lemma sgn_less [simp]:
"sgn a < 0 \<longleftrightarrow> a < 0"
unfolding sgn_if by auto
lemma abs_dvd_iff [simp]: "\<bar>m\<bar> dvd k \<longleftrightarrow> m dvd k"
by (simp add: abs_if)
lemma dvd_abs_iff [simp]: "m dvd \<bar>k\<bar> \<longleftrightarrow> m dvd k"
by (simp add: abs_if)
lemma dvd_if_abs_eq:
"\<bar>l\<bar> = \<bar>k\<bar> \<Longrightarrow> l dvd k"
by(subst abs_dvd_iff[symmetric]) simp
text {* The following lemmas can be proven in more general structures, but
are dangerous as simp rules in absence of @{thm neg_equal_zero},
@{thm neg_less_pos}, @{thm neg_less_eq_nonneg}. *}
lemma equation_minus_iff_1 [simp, no_atp]:
"1 = - a \<longleftrightarrow> a = - 1"
by (fact equation_minus_iff)
lemma minus_equation_iff_1 [simp, no_atp]:
"- a = 1 \<longleftrightarrow> a = - 1"
by (subst minus_equation_iff, auto)
lemma le_minus_iff_1 [simp, no_atp]:
"1 \<le> - b \<longleftrightarrow> b \<le> - 1"
by (fact le_minus_iff)
lemma minus_le_iff_1 [simp, no_atp]:
"- a \<le> 1 \<longleftrightarrow> - 1 \<le> a"
by (fact minus_le_iff)
lemma less_minus_iff_1 [simp, no_atp]:
"1 < - b \<longleftrightarrow> b < - 1"
by (fact less_minus_iff)
lemma minus_less_iff_1 [simp, no_atp]:
"- a < 1 \<longleftrightarrow> - 1 < a"
by (fact minus_less_iff)
end
text {* Simprules for comparisons where common factors can be cancelled. *}
lemmas mult_compare_simps =
mult_le_cancel_right mult_le_cancel_left
mult_le_cancel_right1 mult_le_cancel_right2
mult_le_cancel_left1 mult_le_cancel_left2
mult_less_cancel_right mult_less_cancel_left
mult_less_cancel_right1 mult_less_cancel_right2
mult_less_cancel_left1 mult_less_cancel_left2
mult_cancel_right mult_cancel_left
mult_cancel_right1 mult_cancel_right2
mult_cancel_left1 mult_cancel_left2
text {* Reasoning about inequalities with division *}
context linordered_semidom
begin
lemma less_add_one: "a < a + 1"
proof -
have "a + 0 < a + 1"
by (blast intro: zero_less_one add_strict_left_mono)
thus ?thesis by simp
qed
lemma zero_less_two: "0 < 1 + 1"
by (blast intro: less_trans zero_less_one less_add_one)
end
context linordered_idom
begin
lemma mult_right_le_one_le:
"0 \<le> x \<Longrightarrow> 0 \<le> y \<Longrightarrow> y \<le> 1 \<Longrightarrow> x * y \<le> x"
by (auto simp add: mult_le_cancel_left2)
lemma mult_left_le_one_le:
"0 \<le> x \<Longrightarrow> 0 \<le> y \<Longrightarrow> y \<le> 1 \<Longrightarrow> y * x \<le> x"
by (auto simp add: mult_le_cancel_right2)
end
text {* Absolute Value *}
context linordered_idom
begin
lemma mult_sgn_abs:
"sgn x * \<bar>x\<bar> = x"
unfolding abs_if sgn_if by auto
lemma abs_one [simp]:
"\<bar>1\<bar> = 1"
by (simp add: abs_if)
end
class ordered_ring_abs = ordered_ring + ordered_ab_group_add_abs +
assumes abs_eq_mult:
"(0 \<le> a \<or> a \<le> 0) \<and> (0 \<le> b \<or> b \<le> 0) \<Longrightarrow> \<bar>a * b\<bar> = \<bar>a\<bar> * \<bar>b\<bar>"
context linordered_idom
begin
subclass ordered_ring_abs proof
qed (auto simp add: abs_if not_less mult_less_0_iff)
lemma abs_mult:
"\<bar>a * b\<bar> = \<bar>a\<bar> * \<bar>b\<bar>"
by (rule abs_eq_mult) auto
lemma abs_mult_self:
"\<bar>a\<bar> * \<bar>a\<bar> = a * a"
by (simp add: abs_if)
lemma abs_mult_less:
"\<bar>a\<bar> < c \<Longrightarrow> \<bar>b\<bar> < d \<Longrightarrow> \<bar>a\<bar> * \<bar>b\<bar> < c * d"
proof -
assume ac: "\<bar>a\<bar> < c"
hence cpos: "0<c" by (blast intro: le_less_trans abs_ge_zero)
assume "\<bar>b\<bar> < d"
thus ?thesis by (simp add: ac cpos mult_strict_mono)
qed
lemma abs_less_iff:
"\<bar>a\<bar> < b \<longleftrightarrow> a < b \<and> - a < b"
by (simp add: less_le abs_le_iff) (auto simp add: abs_if)
lemma abs_mult_pos:
"0 \<le> x \<Longrightarrow> \<bar>y\<bar> * x = \<bar>y * x\<bar>"
by (simp add: abs_mult)
lemma abs_diff_less_iff:
"\<bar>x - a\<bar> < r \<longleftrightarrow> a - r < x \<and> x < a + r"
by (auto simp add: diff_less_eq ac_simps abs_less_iff)
end
code_identifier
code_module Rings \<rightharpoonup> (SML) Arith and (OCaml) Arith and (Haskell) Arith
end
|
"All our discontents about what we want appeared to spring from the want of thankfulness for what we have."
# 505. ... for some beautiful, unseasonably warm weather in the middle of February.
# 507. ... for a wonderful friend who also happens to be an accountant who can help me with my (pain in the neck) taxes!
# 508. ... for a sweet husband who took care of me while I was sick.
# 509. ... for hot mint tea and thin mints.... oh yeah.
I love the quote! It's says, with greater impact, something I quoted and covered re. Gratefulness in my last blog post! How I want to embrace thankfulness each day!
I often think I'm a thankful person, but it I'm honest, it's always clouded by anxiety and fear of the future. Wondering if my world will be rocked tomorrow, keeps me from embracing God's grace today! Such anxiety cripples true thankfulness!
Love your title here -- the list that never ends! Indeed, His mercy endures forever . . . so the list must go on!
hope you are feeling better! I love discovering new places...you are blessed to have so many nieces and nephews..
Love seeing your parents in these photos!! Also glad I'm not the only one who runs behind on these weekly lists, haha... A resounding "amen" to #510; I am SO thankful God is patient with me! |
import os
import pickle
import cv2
import numpy as np
from matplotlib import pyplot as plt
def load_data(filepath):
# Loading dataset
data = pickle.load(open(filepath, 'rb'))
# Plot data
for i in range(15):
plt.imshow(cv2.cvtColor(data[i+50], cv2.COLOR_BGR2RGB))
plt.show()
return
if __name__ == "__main__":
#data = pickle.load(open("data/",'rb'))
#X_test = data['X_test']
#pickle.dump(X_test[0:100], open("./ans_imgs",'wb'))
load_data("./ans_imgs")
|
# Github: DreamFireworks
# Serhan Eraslan
size<-c(10000) # Simulation size
flip<-c(sample((0:1),size= size, replace=T)) # Random flipping
tails<-sum(flip)/size # Prob. of tails
heads<-1-yazi # Prob. of heads
result<-data.frame(size,tails,heads)
colnames(result)<-c("SIM. SIZE","PROB. OF TAILS","PROB. OF HEADS")
rownames(result)<-c("SIM. 1")
result
|
From Topology Require Export TopologicalSpaces WeakTopology FilterLimits Compactness.
From Coq Require Import FunctionalExtensionality.
From ZornsLemma Require Import DependentTypeChoice EnsembleProduct FiniteIntersections.
Section product_topology.
Variable A:Type.
Variable X:forall a:A, TopologicalSpace.
Definition product_space_point_set : Type :=
forall a:A, X a.
Definition product_space_proj (a:A) :
product_space_point_set -> X a :=
fun (x:product_space_point_set) => x a.
Definition ProductTopology : TopologicalSpace :=
WeakTopology product_space_proj.
Lemma product_space_proj_continuous: forall a:A,
continuous (product_space_proj a) (X:=ProductTopology).
Proof.
apply weak_topology_makes_continuous_funcs.
Qed.
Lemma product_net_limit: forall (I:DirectedSet)
(x:Net I ProductTopology) (x0:ProductTopology),
inhabited (DS_set I) ->
(forall a:A, net_limit (fun i:DS_set I => x i a) (x0 a)) ->
net_limit x x0.
Proof.
intros.
now apply net_limit_in_projections_impl_net_limit_in_weak_topology.
Qed.
Lemma product_filter_limit:
forall (F:Filter ProductTopology)
(x0:ProductTopology),
(forall a:A, filter_limit (filter_direct_image
(product_space_proj a) F) (x0 a)) ->
filter_limit F x0.
Proof.
intros.
assert (subbasis
(weak_topology_subbasis product_space_proj)
(X:=ProductTopology)) by
apply Build_TopologicalSpace_from_subbasis_subbasis.
red. intros.
red. intros U ?.
destruct H1.
destruct H1 as [U' []].
cut (In (filter_family F) U').
- intro.
apply filter_upward_closed with U'; trivial.
- destruct H1.
destruct (subbasis_cover _ _ H0 _ _ H3 H1) as
[B [? [V [? []]]]].
cut (In (filter_family F) (IndexedIntersection V)).
+ intro.
eapply filter_upward_closed;
eassumption.
+ apply filter_finite_indexed_intersection;
trivial.
intro b.
pose proof (H5 b).
inversion H8.
apply H.
constructor.
apply open_neighborhood_is_neighborhood.
constructor; trivial.
destruct H6.
pose proof (H6 b).
rewrite <- H9 in H11.
now destruct H11.
Qed.
Theorem TychonoffProductTheorem:
(forall a:A, compact (X a)) -> compact ProductTopology.
Proof.
intro.
apply ultrafilter_limit_impl_compact.
intros.
destruct (choice_on_dependent_type (fun (a:A) (x:X a) =>
filter_limit (filter_direct_image (product_space_proj a) U) x))
as [choice_fun].
- intro.
destruct (compact_impl_filter_cluster_point _ (H a)
(filter_direct_image (product_space_proj a) U)) as [xa].
exists xa.
apply ultrafilter_cluster_point_is_limit; trivial.
red. intros.
now destruct (H0 (inverse_image (product_space_proj a) S));
[left | right];
constructor;
[ | rewrite inverse_image_complement ].
- exists choice_fun.
now apply product_filter_limit.
Qed.
End product_topology.
Arguments ProductTopology {A}.
Arguments product_space_proj {A} {X}.
Lemma product_map_continuous: forall {A:Type}
(X:TopologicalSpace) (Y:A->TopologicalSpace)
(f:forall a:A, X -> Y a) (x:X),
(forall a:A, continuous_at (f a) x) ->
continuous_at (fun x:X => (fun a:A => f a x)) x
(Y:=ProductTopology Y).
Proof.
intros.
apply func_preserving_net_limits_is_continuous.
intros.
apply product_net_limit.
- destruct (H0 Full_set) as [i].
+ apply open_full.
+ constructor.
+ now exists.
- intros.
now apply continuous_func_preserves_net_limits.
Qed.
Section product_topology2.
(* we provide a version of the product topology on [X] and [Y]
whose underlying set is [point_set X * point_set Y], for
more convenience as compared with the general definition *)
Variable X Y:TopologicalSpace.
Inductive twoT := | twoT_1 | twoT_2.
Let prod2_fun (i:twoT) := match i with
| twoT_1 => X | twoT_2 => Y end.
Let prod2 := ProductTopology prod2_fun.
Let prod2_conv1 (p:prod2) : X * Y :=
(p twoT_1, p twoT_2).
Let prod2_conv2 (p : X * Y) : prod2 :=
let (x,y):=p in fun i:twoT => match i with
| twoT_1 => x | twoT_2 => y
end.
Lemma prod2_comp1: forall p:prod2,
prod2_conv2 (prod2_conv1 p) = p.
Proof.
intros.
extensionality i.
now destruct i.
Qed.
Lemma prod2_comp2: forall p:X * Y,
prod2_conv1 (prod2_conv2 p) = p.
Proof.
now intros [? ?].
Qed.
Let prod2_proj := fun i:twoT =>
match i return (X * Y -> (prod2_fun i)) with
| twoT_1 => @fst X Y
| twoT_2 => @snd X Y
end.
Definition ProductTopology2 : TopologicalSpace :=
WeakTopology prod2_proj.
Lemma prod2_conv1_cont: continuous prod2_conv1 (Y:=ProductTopology2).
Proof.
apply pointwise_continuity.
intros p.
apply func_preserving_net_limits_is_continuous.
intros.
apply net_limit_in_projections_impl_net_limit_in_weak_topology.
- destruct (H Full_set).
+ apply open_full.
+ constructor.
+ exact (inhabits x0).
- destruct a;
simpl.
+ now apply net_limit_in_weak_topology_impl_net_limit_in_projections
with (a:=twoT_1) in H.
+ now apply net_limit_in_weak_topology_impl_net_limit_in_projections
with (a:=twoT_2) in H.
Qed.
Lemma prod2_conv2_cont: continuous prod2_conv2 (X:=ProductTopology2).
Proof.
apply pointwise_continuity.
destruct x as [x y].
apply func_preserving_net_limits_is_continuous.
intros.
apply net_limit_in_projections_impl_net_limit_in_weak_topology.
- destruct (H Full_set).
+ apply open_full.
+ constructor.
+ exact (inhabits x1).
- destruct a.
+ unfold product_space_proj.
simpl.
replace (fun i => prod2_conv2 (x0 i) twoT_1) with
(fun i => fst (x0 i)).
* now apply net_limit_in_weak_topology_impl_net_limit_in_projections
with (a:=twoT_1) in H.
* extensionality i.
now destruct (x0 i).
+ unfold product_space_proj.
simpl.
replace (fun i:DS_set I => prod2_conv2 (x0 i) twoT_2) with
(fun i:DS_set I => snd (x0 i)).
* now apply net_limit_in_weak_topology_impl_net_limit_in_projections
with (a:=twoT_2) in H.
* extensionality i.
now destruct (x0 i).
Qed.
Lemma product2_fst_continuous:
continuous (@fst X Y)
(X:=ProductTopology2).
Proof.
exact (weak_topology_makes_continuous_funcs
_ _ _ prod2_proj twoT_1).
Qed.
Lemma product2_snd_continuous:
continuous (@snd X Y)
(X:=ProductTopology2).
Proof.
exact (weak_topology_makes_continuous_funcs
_ _ _ prod2_proj twoT_2).
Qed.
Lemma product2_map_continuous_at: forall (W:TopologicalSpace)
(f:W -> X) (g:W -> Y) (w:W),
continuous_at f w -> continuous_at g w ->
continuous_at (fun w:W => (f w, g w)) w (Y:=ProductTopology2).
Proof.
intros.
replace (fun w:W => (f w, g w)) with
(fun w:W => prod2_conv1
(fun i:twoT =>
match i with
| twoT_1 => f w
| twoT_2 => g w end)).
- apply (@continuous_composition_at W prod2 ProductTopology2
prod2_conv1
(fun w:W =>
fun i:twoT => match i with
| twoT_1 => f w | twoT_2 => g w end)).
+ apply continuous_func_continuous_everywhere.
apply prod2_conv1_cont.
+ apply product_map_continuous.
now destruct a.
- now extensionality w0.
Qed.
Corollary product2_map_continuous: forall (W:TopologicalSpace)
(f:W -> X) (g:W -> Y),
continuous f -> continuous g ->
continuous (fun w:W => (f w, g w))
(Y:=ProductTopology2).
Proof.
intros.
apply pointwise_continuity.
intros.
apply product2_map_continuous_at.
- apply continuous_func_continuous_everywhere.
assumption.
- apply continuous_func_continuous_everywhere.
assumption.
Qed.
Inductive ProductTopology2_basis :
Family ProductTopology2 :=
| intro_product2_basis_elt:
forall (U:Ensemble X)
(V:Ensemble Y),
open U -> open V ->
In ProductTopology2_basis (EnsembleProduct U V).
Lemma ProductTopology2_basis_is_basis:
open_basis ProductTopology2_basis.
Proof.
assert (open_basis (finite_intersections (weak_topology_subbasis prod2_proj))
(X:=ProductTopology2)) by apply
Build_TopologicalSpace_from_open_basis_basis.
apply eq_ind with (1:=H).
apply Extensionality_Ensembles; split; red; intros U ?.
- induction H0.
+ rewrite <- EnsembleProduct_Full.
constructor; apply open_full.
+ destruct H0.
destruct a.
* simpl.
rewrite inverse_image_fst.
constructor; auto with topology.
* simpl.
rewrite inverse_image_snd.
constructor; auto with topology.
+ destruct IHfinite_intersections as [U1 V1].
destruct IHfinite_intersections0 as [U2 V2].
rewrite EnsembleProduct_Intersection.
constructor; auto with topology.
- destruct H0.
rewrite EnsembleProduct_proj.
constructor 3.
+ constructor.
replace (@fst X Y) with (prod2_proj twoT_1); auto.
constructor. assumption.
+ constructor.
replace (@snd X Y) with (prod2_proj twoT_2); auto.
constructor. assumption.
Qed.
End product_topology2.
Section two_arg_convenience_results.
Variable X Y Z:TopologicalSpace.
Variable f:X -> Y -> Z.
Definition continuous_2arg :=
continuous (fun p:X * Y =>
f (fst p) (snd p))
(X:=ProductTopology2 X Y).
Definition continuous_at_2arg (x:X) (y:Y) :=
continuous_at (fun p:X * Y =>
f (fst p) (snd p)) (x, y)
(X:=ProductTopology2 X Y).
Lemma continuous_2arg_func_continuous_everywhere:
continuous_2arg -> forall (x:X) (y:Y),
continuous_at_2arg x y.
Proof.
intros.
now apply continuous_func_continuous_everywhere.
Qed.
Lemma pointwise_continuity_2arg:
(forall (x:X) (y:Y),
continuous_at_2arg x y) -> continuous_2arg.
Proof.
intros.
apply pointwise_continuity.
intros [? ?].
apply H.
Qed.
End two_arg_convenience_results.
Arguments continuous_2arg {X} {Y} {Z}.
Arguments continuous_at_2arg {X} {Y} {Z}.
Lemma continuous_composition_at_2arg:
forall (W X Y Z:TopologicalSpace)
(f:X -> Y -> Z) (g:W -> X) (h:W -> Y)
(w:W),
continuous_at_2arg f (g w) (h w) ->
continuous_at g w -> continuous_at h w ->
continuous_at (fun w:W => f (g w) (h w)) w.
Proof.
intros.
red in H.
apply (continuous_composition_at
(fun p:ProductTopology2 X Y =>
f (fst p) (snd p))
(fun w:W => (g w, h w))); trivial.
now apply product2_map_continuous_at.
Qed.
Corollary continuous_composition_2arg:
forall {U X Y Z : TopologicalSpace} (f : U -> X) (g : U -> Y) (h : X -> Y -> Z),
continuous f -> continuous g -> continuous_2arg h ->
continuous (fun p => h (f p) (g p)).
Proof.
intros.
apply pointwise_continuity.
intros.
apply continuous_composition_at_2arg.
- apply continuous_2arg_func_continuous_everywhere.
assumption.
- apply continuous_func_continuous_everywhere.
assumption.
- apply continuous_func_continuous_everywhere.
assumption.
Qed.
Lemma EnsembleProduct_open {X Y : TopologicalSpace} (U : Ensemble X) (V : Ensemble Y) :
open U -> open V -> @open (@ProductTopology2 X Y) (EnsembleProduct U V).
Proof.
intros.
apply ProductTopology2_basis_is_basis.
constructor; assumption.
Qed.
Lemma Hausdorff_ProductTopology2 {X Y : TopologicalSpace} :
Hausdorff X -> Hausdorff Y ->
Hausdorff (ProductTopology2 X Y).
Proof.
intros HX HY [x0 y0] [x1 y1] Hxy.
specialize (HX x0 x1).
specialize (HY y0 y1).
(* Is there some "symmetry" that can be used, so the proof doesn't
contain redundant parts? *)
destruct (classic (x0 = x1)) as [|Hx].
{ subst.
assert (y0 <> y1) as Hy by congruence.
clear Hxy.
specialize (HY Hy) as [U [V [HU [HV [HU0 [HV0 HUV]]]]]].
exists (EnsembleProduct Full_set U), (EnsembleProduct Full_set V).
repeat split; auto using EnsembleProduct_open, open_full.
simpl.
rewrite EnsembleProduct_Intersection.
rewrite Powerset_facts.Intersection_Full_set.
rewrite HUV.
apply EnsembleProduct_Empty_r.
}
clear Hxy.
specialize (HX Hx) as [U [V [HU [HV [HU0 [HV0 HUV]]]]]].
exists (EnsembleProduct U Full_set), (EnsembleProduct V Full_set).
repeat split; auto using EnsembleProduct_open, open_full.
simpl.
rewrite EnsembleProduct_Intersection.
rewrite Powerset_facts.Intersection_Full_set.
rewrite HUV.
apply EnsembleProduct_Empty_l.
Qed.
|
(** * Rel: Properties of Relations *)
Require Export SfLib.
(** This short, optional chapter develops some basic definitions and a
few theorems about binary relations in Coq. The key definitions
are repeated where they are actually used (in the [Smallstep]
chapter), so readers who are already comfortable with these ideas
can safely skim or skip this chapter. However, relations are also
a good source of exercises for developing facility with Coq's
basic reasoning facilities, so it may be useful to look at it just
after the [Logic] chapter. *)
(** A (binary) _relation_ on a set [X] is a family of propositions
parameterized by two elements of [X] -- i.e., a proposition about
pairs of elements of [X]. *)
Definition relation (X: Type) := X->X->Prop.
(** Somewhat confusingly, the Coq standard library hijacks the generic
term "relation" for this specific instance. To maintain
consistency with the library, we will do the same. So, henceforth
the Coq identifier [relation] will always refer to a binary
relation between some set and itself, while the English word
"relation" can refer either to the specific Coq concept or the
more general concept of a relation between any number of possibly
different sets. The context of the discussion should always make
clear which is meant. *)
(** An example relation on [nat] is [le], the less-that-or-equal-to
relation which we usually write like this [n1 <= n2]. *)
Print le.
(* ====> Inductive le (n : nat) : nat -> Prop :=
le_n : n <= n
| le_S : forall m : nat, n <= m -> n <= S m *)
Check le : nat -> nat -> Prop.
Check le : relation nat.
(* ######################################################### *)
(** * Basic Properties of Relations *)
(** As anyone knows who has taken an undergraduate discrete math
course, there is a lot to be said about relations in general --
ways of classifying relations (are they reflexive, transitive,
etc.), theorems that can be proved generically about classes of
relations, constructions that build one relation from another,
etc. For example... *)
(** A relation [R] on a set [X] is a _partial function_ if, for every
[x], there is at most one [y] such that [R x y] -- i.e., if [R x
y1] and [R x y2] together imply [y1 = y2]. *)
Definition partial_function {X: Type} (R: relation X) :=
forall x y1 y2 : X, R x y1 -> R x y2 -> y1 = y2.
(** For example, the [next_nat] relation defined earlier is a partial
function. *)
Print next_nat.
(* ====> Inductive next_nat (n : nat) : nat -> Prop :=
nn : next_nat n (S n) *)
Check next_nat : relation nat.
Theorem next_nat_partial_function :
partial_function next_nat.
Proof.
unfold partial_function.
intros x y1 y2 H1 H2.
inversion H1. inversion H2.
reflexivity. Qed.
(** However, the [<=] relation on numbers is not a partial function.
In short: Assume, for a contradiction, that [<=] is a partial
function. But then, since [0 <= 0] and [0 <= 1], it follows that
[0 = 1]. This is nonsense, so our assumption was
contradictory. *)
Theorem le_not_a_partial_function :
~ (partial_function le).
Proof.
unfold not. unfold partial_function. intros Hc.
assert (0 = 1) as Nonsense.
Case "Proof of assertion".
apply Hc with (x := 0).
apply le_n.
apply le_S. apply le_n.
inversion Nonsense. Qed.
(** **** Exercise: 2 stars, optional *)
(** Show that the [total_relation] defined in earlier is not a partial
function. *)
(* FILL IN HERE *)
(** [] *)
(** **** Exercise: 2 stars, optional *)
(** Show that the [empty_relation] defined earlier is a partial
function. *)
(* FILL IN HERE *)
(** [] *)
(** A _reflexive_ relation on a set [X] is one for which every element
of [X] is related to itself. *)
Definition reflexive {X: Type} (R: relation X) :=
forall a : X, R a a.
Theorem le_reflexive :
reflexive le.
Proof.
unfold reflexive. intros n. apply le_n. Qed.
(** A relation [R] is _transitive_ if [R a c] holds whenever [R a b]
and [R b c] do. *)
Definition transitive {X: Type} (R: relation X) :=
forall a b c : X, (R a b) -> (R b c) -> (R a c).
Theorem le_trans :
transitive le.
Proof.
intros n m o Hnm Hmo.
induction Hmo.
Case "le_n". apply Hnm.
Case "le_S". apply le_S. apply IHHmo. Qed.
Theorem lt_trans:
transitive lt.
Proof.
unfold lt. unfold transitive.
intros n m o Hnm Hmo.
apply le_S in Hnm.
apply le_trans with (a := (S n)) (b := (S m)) (c := o).
apply Hnm.
apply Hmo. Qed.
(** **** Exercise: 2 stars, optional *)
(** We can also prove [lt_trans] more laboriously by induction,
without using le_trans. Do this.*)
Theorem lt_trans' :
transitive lt.
Proof.
(* Prove this by induction on evidence that [m] is less than [o]. *)
unfold lt. unfold transitive.
intros n m o Hnm Hmo.
induction Hmo as [| m' Hm'o].
(* FILL IN HERE *) Admitted.
(** [] *)
(** **** Exercise: 2 stars, optional *)
(** Prove the same thing again by induction on [o]. *)
Theorem lt_trans'' :
transitive lt.
Proof.
unfold lt. unfold transitive.
intros n m o Hnm Hmo.
induction o as [| o'].
(* FILL IN HERE *) Admitted.
(** [] *)
(** The transitivity of [le], in turn, can be used to prove some facts
that will be useful later (e.g., for the proof of antisymmetry
below)... *)
Theorem le_Sn_le : forall n m, S n <= m -> n <= m.
Proof.
intros n m H. apply le_trans with (S n).
apply le_S. apply le_n.
apply H. Qed.
(** **** Exercise: 1 star, optional *)
Theorem le_S_n : forall n m,
(S n <= S m) -> (n <= m).
Proof.
(* FILL IN HERE *) Admitted.
(** [] *)
(** **** Exercise: 2 stars, optional (le_Sn_n_inf) *)
(** Provide an informal proof of the following theorem:
Theorem: For every [n], [~(S n <= n)]
A formal proof of this is an optional exercise below, but try
the informal proof without doing the formal proof first.
Proof:
(* FILL IN HERE *)
[]
*)
(** **** Exercise: 1 star, optional *)
Theorem le_Sn_n : forall n,
~ (S n <= n).
Proof.
(* FILL IN HERE *) Admitted.
(** [] *)
(** Reflexivity and transitivity are the main concepts we'll need for
later chapters, but, for a bit of additional practice working with
relations in Coq, here are a few more common ones.
A relation [R] is _symmetric_ if [R a b] implies [R b a]. *)
Definition symmetric {X: Type} (R: relation X) :=
forall a b : X, (R a b) -> (R b a).
(** **** Exercise: 2 stars, optional *)
Theorem le_not_symmetric :
~ (symmetric le).
Proof.
(* FILL IN HERE *) Admitted.
(** [] *)
(** A relation [R] is _antisymmetric_ if [R a b] and [R b a] together
imply [a = b] -- that is, if the only "cycles" in [R] are trivial
ones. *)
Definition antisymmetric {X: Type} (R: relation X) :=
forall a b : X, (R a b) -> (R b a) -> a = b.
(** **** Exercise: 2 stars, optional *)
Theorem le_antisymmetric :
antisymmetric le.
Proof.
(* FILL IN HERE *) Admitted.
(** [] *)
(** **** Exercise: 2 stars, optional *)
Theorem le_step : forall n m p,
n < m ->
m <= S p ->
n <= p.
Proof.
(* FILL IN HERE *) Admitted.
(** [] *)
(** A relation is an _equivalence_ if it's reflexive, symmetric, and
transitive. *)
Definition equivalence {X:Type} (R: relation X) :=
(reflexive R) /\ (symmetric R) /\ (transitive R).
(** A relation is a _partial order_ when it's reflexive,
_anti_-symmetric, and transitive. In the Coq standard library
it's called just "order" for short. *)
Definition order {X:Type} (R: relation X) :=
(reflexive R) /\ (antisymmetric R) /\ (transitive R).
(** A preorder is almost like a partial order, but doesn't have to be
antisymmetric. *)
Definition preorder {X:Type} (R: relation X) :=
(reflexive R) /\ (transitive R).
Theorem le_order :
order le.
Proof.
unfold order. split.
Case "refl". apply le_reflexive.
split.
Case "antisym". apply le_antisymmetric.
Case "transitive.". apply le_trans. Qed.
(* ########################################################### *)
(** * Reflexive, Transitive Closure *)
(** The _reflexive, transitive closure_ of a relation [R] is the
smallest relation that contains [R] and that is both reflexive and
transitive. Formally, it is defined like this in the Relations
module of the Coq standard library: *)
Inductive clos_refl_trans {A: Type} (R: relation A) : relation A :=
| rt_step : forall x y, R x y -> clos_refl_trans R x y
| rt_refl : forall x, clos_refl_trans R x x
| rt_trans : forall x y z,
clos_refl_trans R x y ->
clos_refl_trans R y z ->
clos_refl_trans R x z.
(** For example, the reflexive and transitive closure of the
[next_nat] relation coincides with the [le] relation. *)
Theorem next_nat_closure_is_le : forall n m,
(n <= m) <-> ((clos_refl_trans next_nat) n m).
Proof.
intros n m. split.
Case "->".
intro H. induction H.
SCase "le_n". apply rt_refl.
SCase "le_S".
apply rt_trans with m. apply IHle. apply rt_step. apply nn.
Case "<-".
intro H. induction H.
SCase "rt_step". inversion H. apply le_S. apply le_n.
SCase "rt_refl". apply le_n.
SCase "rt_trans".
apply le_trans with y.
apply IHclos_refl_trans1.
apply IHclos_refl_trans2. Qed.
(** The above definition of reflexive, transitive closure is
natural -- it says, explicitly, that the reflexive and transitive
closure of [R] is the least relation that includes [R] and that is
closed under rules of reflexivity and transitivity. But it turns
out that this definition is not very convenient for doing
proofs -- the "nondeterminism" of the [rt_trans] rule can sometimes
lead to tricky inductions.
Here is a more useful definition... *)
Inductive refl_step_closure {X:Type} (R: relation X) : relation X :=
| rsc_refl : forall (x : X), refl_step_closure R x x
| rsc_step : forall (x y z : X),
R x y ->
refl_step_closure R y z ->
refl_step_closure R x z.
(** (Note that, aside from the naming of the constructors, this
definition is the same as the [multi] step relation used in many
other chapters.) *)
(** (The following [Tactic Notation] definitions are explained in
another chapter. You can ignore them if you haven't read the
explanation yet.) *)
Tactic Notation "rt_cases" tactic(first) ident(c) :=
first;
[ Case_aux c "rt_step" | Case_aux c "rt_refl"
| Case_aux c "rt_trans" ].
Tactic Notation "rsc_cases" tactic(first) ident(c) :=
first;
[ Case_aux c "rsc_refl" | Case_aux c "rsc_step" ].
(** Our new definition of reflexive, transitive closure "bundles"
the [rt_step] and [rt_trans] rules into the single rule step.
The left-hand premise of this step is a single use of [R],
leading to a much simpler induction principle.
Before we go on, we should check that the two definitions do
indeed define the same relation...
First, we prove two lemmas showing that [refl_step_closure] mimics
the behavior of the two "missing" [clos_refl_trans]
constructors. *)
Theorem rsc_R : forall (X:Type) (R:relation X) (x y : X),
R x y -> refl_step_closure R x y.
Proof.
intros X R x y H.
apply rsc_step with y. apply H. apply rsc_refl. Qed.
(** **** Exercise: 2 stars, optional (rsc_trans) *)
Theorem rsc_trans :
forall (X:Type) (R: relation X) (x y z : X),
refl_step_closure R x y ->
refl_step_closure R y z ->
refl_step_closure R x z.
Proof.
(* FILL IN HERE *) Admitted.
(** [] *)
(** Then we use these facts to prove that the two definitions of
reflexive, transitive closure do indeed define the same
relation. *)
(** **** Exercise: 3 stars, optional (rtc_rsc_coincide) *)
Theorem rtc_rsc_coincide :
forall (X:Type) (R: relation X) (x y : X),
clos_refl_trans R x y <-> refl_step_closure R x y.
Proof.
(* FILL IN HERE *) Admitted.
(** [] *)
(** $Date: 2014-12-31 15:31:47 -0500 (Wed, 31 Dec 2014) $ *)
|
\ messagebox
\
\ Copyright (C) 2016 David J Goehrig <[email protected]>
\
\ This software is provided 'as-is', without any express or implied
\ warranty. In no event will the authors be held liable for any damages
\ arising from the use of this software.
\
\ Permission is granted to anyone to use this software for any purpose
\ including commercial applications, and to alter it and redistribute it
\ freely, subject to the following restrictions:
\
\ 1. The origin of this software must not be misrepresented; you must not
\ claim that you wrote the original software. If you use this software
\ in a product, an acknowledgment in the product documentation would be
\ appreciated but is not required.
\ 2. Altered source versions must be plainly marked as such, and must not be
\ misrepresented as being the original software.
\ 3. This notice may not be removed or altered from any source distribution.
\
$00000010 constant SDL_MESSAGEBOX_ERROR
$00000020 constant SDL_MESSAGEBOX_WARNING
$00000040 constant SDL_MESSAGEBOX_INFORMATION
$00000001 constant SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT
$00000002 constant SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT
0
enum SDL_MESSAGEBOX_COLOR_BACKGROUND
enum SDL_MESSAGEBOX_COLOR_TEXT
enum SDL_MESSAGEBOX_COLOR_BUTTON_BORDER
enum SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND
enum SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED
enum SDL_MESSAGEBOX_COLOR_MAX
drop
: SDL_MessageBoxButtonData create 3 cells allot ;
: SDL_MessageBoxButtonData:flags ;
: SDL_MessageBoxButtonData:buttonid 1 cells + ;
: SDL_MessageBoxButtonData:text 2 cells + ;
: SDL_MessageBoxColor 1 cells allot ;
: SDL_MessageBoxColor:r ; \ Uint8
: SDL_MessageBoxColor:g 1+ ; \ Uint8
: SDL_MessageBoxColor:b 2+ ; \ Uint8
: SDL_MessageBoxColorScheme create SDL_MESSAGEBOX_COLOR_MAX cells allot ;
: SDL_MessageBoxData create 7 cells allot ;
: SDL_MessageBoxData:flags ;
: SDL_MessageBoxData:window 1 cells + ;
: SDL_MessageBoxData:title 2 cells + ;
: SDL_MessageBoxData:message 3 cells + ;
: SDL_MessageBoxData:numbuttons 4 cells + ;
: SDL_MessageBoxData:buttons 5 cells + ;
: SDL_MessageBoxData:colorScheme 6 cells + ;
FUNCTION: SDL_ShowMessageBox ( msgbox n* -- flag )
FUNCTION: SDL_ShowSimpleMessageBox ( flags z z win -- flag )
|
Suppose $f$ is a continuous function from an open set $S$ to itself, and $f$ has a continuous inverse $g$. If $f$ is differentiable at $x \in S$, then $g$ is differentiable at $f(x)$. |
(** * 6.887 Formal Reasoning About Programs - Lab 3
* Model Checking, including abstraction *)
Require Import Frap.
Set Implicit Arguments.
(* Authors: Peng Wang ([email protected]), Adam Chlipala ([email protected]) *)
(* Examples based on ideas introduced in ModelChecking.v, from the book source.
* Key definitions about model checking are imported from the Frap library. *)
(* Use model checking to verify the following program
* against the property that j==3 when the program finishes.
<<
int i = 0;
int j = 0;
void foo() {
while (i <= 2){
++i;
++j;
}
}
>>
*)
(* CHALLENGE #1: We've made a small mistake in formalizing this program as a
* transition system. Correct the mistake. (Otherwise, the program will not,
* in fact, satisfy the spec!) *)
Inductive pc :=
| Loop
| i_add_1
| j_add_1
| Done.
Record vars := {
I : nat;
J : nat
}.
Record state := {
Pc : pc;
Vars : vars
}.
Definition foo_init := { {| Pc := Loop; Vars := {| I := 0; J := 0 |} |} }.
Inductive step : state -> state -> Prop :=
| Step_Loop_done : forall i j, i = 3 /\ j = 3 ->
step {| Pc := Loop; Vars := {| I := i;
J := j |} |}
{| Pc := Done; Vars := {| I := i;
J := j |} |}
| Step_Loop_enter : forall i j, i < 3 /\ j < 3 ->
step {| Pc := Loop; Vars := {| I := i;
J := j |} |}
{| Pc := i_add_1; Vars := {| I := i;
J := j |} |}
| Step_i_add_1 : forall i j,
step {| Pc := i_add_1; Vars := {| I := i;
J := j |} |}
{| Pc := j_add_1; Vars := {| I := 1 + i;
J := j |} |}
| Step_j_add_1 : forall i j,
step {| Pc := j_add_1; Vars := {| I := i;
J := j |} |}
{| Pc := Loop; Vars := {| I := i;
J := 1 + j |} |}.
Definition foo_sys := {|
Initial := foo_init;
Step := step
|}.
Definition foo_correct (st : state) :=
st.(Pc) = Done -> st.(Vars).(J) = 3.
(* A hint to help the model checker, related to when to unfold definitions *)
Arguments foo_correct / .
(* CHALLENGE #2: Prove the system correct.
* WARNING: with the broken system above, the model checker is likely to run for
* intractably long! However, when you fix the system definition, this should
* be a very easy proof, thanks to the magic of automatic state-space
* exploration. *)
Theorem foo_ok :
invariantFor foo_sys foo_correct.
Proof.
model_check.
Qed.
(* Next, we'll look at verifying the following two-thread producer/consumer
* program against the property that MIN <= x <= MAX always holds.
<<
x = MIN;
void producer(){
while(true){
lock();
if (x < MAX) {
++x;
}
unlock();
}
}
void consumer(){
while(true){
lock();
if (x > MIN) {
--x;
}
unlock();
}
}
>>
*)
(* Here's our formal encoding of the system, which this time you can trust to be
* correct. *)
Notation num := nat.
Section prco.
(* We use sections and variables to introduce local, unknown parameters. *)
Variable MIN : num.
Variable MAX : num.
Record shared_state val := { Locked : bool; X : val }.
Inductive producer_pc :=
| PrLock
| PrTest
| PrInc
| PrUnlock.
Definition producer_state := threaded_state (shared_state num) producer_pc.
Definition producer_init := { {| Shared := {| Locked := false; X := MIN |};
Private := PrLock |} }.
Inductive producer_step : producer_state -> producer_state -> Prop :=
| PrStep_Lock : forall x,
producer_step {| Shared := {| Locked := false; X := x|}; Private := PrLock |}
{| Shared := {| Locked := true; X := x|}; Private := PrTest |}
| PrStep_Test_true : forall l x,
x < MAX ->
producer_step {| Shared := {| Locked := l; X := x|}; Private := PrTest |}
{| Shared := {| Locked := l; X := x|}; Private := PrInc |}
| PrStep_Test_false : forall l x,
x >= MAX ->
producer_step {| Shared := {| Locked := l; X := x|}; Private := PrTest |}
{| Shared := {| Locked := l; X := x|}; Private := PrUnlock |}
| PrStep_Inc : forall l x,
producer_step {| Shared := {| Locked := l; X := x|}; Private := PrInc |}
{| Shared := {| Locked := l; X := 1 + x|}; Private := PrUnlock |}
| PrStep_Unlock : forall l x,
producer_step {| Shared := {| Locked := l; X := x|}; Private := PrUnlock |}
{| Shared := {| Locked := false; X := x|}; Private := PrLock |}.
Definition producer_sys := {|
Initial := producer_init;
Step := producer_step
|}.
Inductive consumer_pc :=
| CoLock
| CoTest
| CoDec
| CoUnlock.
Definition consumer_state := threaded_state (shared_state num) consumer_pc.
Definition consumer_init := { {| Shared := {| Locked := false; X := MIN |};
Private := CoLock |} }.
Inductive consumer_step : consumer_state -> consumer_state -> Prop :=
| CoStep_Lock : forall x,
consumer_step {| Shared := {| Locked := false; X := x|}; Private := CoLock |}
{| Shared := {| Locked := true; X := x|}; Private := CoTest |}
| CoStep_Test_true : forall l x,
x > MIN ->
consumer_step {| Shared := {| Locked := l; X := x|}; Private := CoTest |}
{| Shared := {| Locked := l; X := x|}; Private := CoDec |}
| CoStep_Test_false : forall l x,
x <= MIN ->
consumer_step {| Shared := {| Locked := l; X := x|}; Private := CoTest |}
{| Shared := {| Locked := l; X := x|}; Private := CoUnlock |}
| CoStep_Dec : forall l x,
consumer_step {| Shared := {| Locked := l; X := x|}; Private := CoDec |}
{| Shared := {| Locked := l; X := x - 1|}; Private := CoUnlock |}
| CoStep_Unlock : forall l x,
consumer_step {| Shared := {| Locked := l; X := x|}; Private := CoUnlock |}
{| Shared := {| Locked := false; X := x|}; Private := CoLock |}.
Definition consumer_sys := {|
Initial := consumer_init;
Step := consumer_step
|}.
Definition prco_sys := parallel producer_sys consumer_sys.
Definition prco_state := threaded_state (shared_state num) (producer_pc * consumer_pc).
Definition prco_correct (s : prco_state) :=
MIN <= s.(Shared).(X) <= MAX.
(* Let's re-express the combined initial state as a singleton set. *)
Theorem prco_init_is :
parallel1 producer_init consumer_init = { {| Shared := {| Locked := false; X := MIN|};
Private := (PrLock, CoLock) |} }.
Proof.
simplify.
apply sets_equal; simplify.
propositional.
{
invert H; invert H2; invert H4; equality.
}
invert H0.
repeat constructor.
Qed.
End prco.
Hint Rewrite prco_init_is.
Arguments prco_correct / .
(* We can try model checking [proco_sys] with different [MIN] and [MAX]
* values. *)
Theorem prco_ok_example :
invariantFor (prco_sys 1 2) (prco_correct 1 2).
Proof.
Time model_check_find_invariant.
model_check_finish.
Qed.
(* But the time for model checking grows rapidly with larger constants.
* We should apply abstraction. *)
(* CHALLENGE #3: Come up with a suitable abstraction of this system and use it
* to verify the original program *for all [MIN] and [MAX] values (assuming 0 < MIN < MAX)*, by reduction
* to a finite-state system that can be model checked. *)
Section prco_a.
Variable MIN : num.
Variable MAX : num.
(* We make this assumption about MIN and MAX, which becomes a hypothesis that can be used in the following part of the section *)
Hypothesis MIN_MAX : 0 < MIN < MAX.
Theorem prco_ok :
invariantFor (prco_sys MIN MAX) (prco_correct MIN MAX).
Proof.
Admitted.
End prco_a.
|
(*
Copyright 2018
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)
theory dequeue_init_opt_mem
imports dequeue_opt
begin
context assembly
begin
interpretation until_ret: cfg_system step \<open>until {(ts_ret, pc_ret)}\<close> wf_state location
by standard (simp add: wf_state_def det_system.is_weak_invar_def)
declare until_def[simp]
declare wf_state_def[simp]
declare location_def[simp]
text \<open>
This method runs symbolic execution per instruction.
It unfolds the step function, fetches the next instruction
and then simplifies until no further let's are in the goal.
\<close>
method symbolic_execution uses add del =
(rule wps_rls)?,
(simp del: del)?,
simp only: assembly_def cong: Let'_weak_cong,
rewrite_one_let',
rewrite_one_let' del: del,
rewrite_one_let' add: exec_instr.simps del: del,
rewrite_one_let' add: unfold_semantics del: del,
(rewrite_one_let' add: add del: del)+,
rule until_ret.linvar_unfoldI,
simp del: del
text \<open>
Symbolic execution can produce multiple subgoals (e.g., due to conditional jumps).
If one subgoal is finished, call this method once to restart the symbolic execution on the
unfinished next subgoal.
\<close>
method restart_symbolic_execution uses add del =
(rewrite_one_let' add: add del: del)+,
rule until_ret.linvar_unfoldI,
simp del: del
|
rule until_ret.linvar_unfoldI,
simp del: del
text \<open>
If symbolic execution is finished, the subgoal often contains a large term, possibly with let's.
This can be simplified by running simplification.
\<close>
method finish_symbolic_execution uses add del =
simp add: simp_rules add del: del,
(rewrite_one_let' add: add del: del)+,
(simp add: simp_rules add del: del; fail)?
text \<open>
The Floyd invariant expresses for some locations properties that are invariably true.
Simply expresses that a byte in the memory remains untouched.
\<close>
definition pp_\<Theta> :: \<open>_ \<Rightarrow> _ \<Rightarrow> _ \<Rightarrow> _ \<Rightarrow> _ \<Rightarrow> _ \<Rightarrow> _ \<Rightarrow> floyd_invar\<close> where
\<open>pp_\<Theta> rsp\<^sub>0 dequeue\<^sub>p\<^sub>t\<^sub>r a v\<^sub>0 init_ret ts_ret pc_ret \<equiv> [
\<comment> \<open>precondition\<close>
(1, 0) \<mapsto> \<lambda>\<sigma>. RDI \<sigma> = dequeue\<^sub>p\<^sub>t\<^sub>r
\<and> \<sigma> \<turnstile> *[a,1] = v\<^sub>0
\<and> RSP \<sigma> = rsp\<^sub>0
\<and> \<sigma> \<turnstile> *[rsp\<^sub>0,8] = init_ret,
\<comment> \<open>postcondition\<close>
(ts_ret, pc_ret - 1) \<mapsto> \<lambda>\<sigma>. \<sigma> \<turnstile> *[a,1] = v\<^sub>0
\<and> RSP \<sigma> = rsp\<^sub>0 + 8
]\<close>
schematic_goal pp_\<Theta>_zero[simp]: \<comment> \<open>@{term 0} is not a numeral\<close>
shows \<open>pp_\<Theta> rsp\<^sub>0 dequeue\<^sub>p\<^sub>t\<^sub>r a v\<^sub>0 init_ret ts_ret pc_ret (1, 0) = ?x\<close>
unfolding pp_\<Theta>_def
by simp
schematic_goal pp_\<Theta>_one[simp]: \<comment> \<open>@{term 1} is not a numeral\<close>
shows \<open>pp_\<Theta> rsp\<^sub>0 dequeue\<^sub>p\<^sub>t\<^sub>r a v\<^sub>0 init_ret ts_ret pc_ret (1, 1) = ?x\<close>
unfolding pp_\<Theta>_def
by simp
schematic_goal pp_\<Theta>_numeral[simp]:
shows \<open>pp_\<Theta> rsp\<^sub>0 dequeue\<^sub>p\<^sub>t\<^sub>r a v\<^sub>0 init_ret ts_ret pc_ret (1, numeral m) = ?x\<close>
unfolding pp_\<Theta>_def
by simp
schematic_goal pp_\<Theta>_ret[simp]:
shows \<open>pp_\<Theta> rsp\<^sub>0 dequeue\<^sub>p\<^sub>t\<^sub>r a v\<^sub>0 init_ret ts_ret pc_ret (ts_ret, pc_ret - 1) = ?x\<close>
unfolding pp_\<Theta>_def
by simp
lemma rewrite_dequeue_init:
assumes \<open>master blocks (dequeue\<^sub>p\<^sub>t\<^sub>r, 8) 2\<close>
and \<open>master blocks (dequeue\<^sub>p\<^sub>t\<^sub>r + 8, 8) 3\<close>
and \<open>master blocks (dequeue\<^sub>p\<^sub>t\<^sub>r + 0x10, 8) 4\<close>
and \<open>master blocks (dequeue\<^sub>p\<^sub>t\<^sub>r + 0x18, 8) 5\<close>
and \<open>master blocks (dequeue\<^sub>p\<^sub>t\<^sub>r + 0x20, 8) 6\<close>
and \<open>master blocks (a, 1) 7\<close>
and \<open>master blocks (rsp\<^sub>0, 8) 8\<close>
and \<open>seps blocks\<close>
and \<open>label_to_index \<alpha> (the (address_to_label init_ret)) = Some (ts_ret, pc_ret)\<close>
and \<open>ts_ret \<noteq> 1\<close>
shows \<open>until_ret.is_std_invar ts_ret pc_ret (until_ret.floyd.invar ts_ret pc_ret (pp_\<Theta> rsp\<^sub>0 dequeue\<^sub>p\<^sub>t\<^sub>r a v\<^sub>0 init_ret ts_ret pc_ret))\<close>
(* Boilerplate code to start the VCG *)
apply (rule until_ret.floyd_invarI)
apply (rewrite at \<open>until_ret.floyd_vcs ts_ret pc_ret \<hole> _\<close> pp_\<Theta>_def)
apply (intro until_ret.floyd_vcsI; clarsimp?)
(* Subgoal for (ts, pc) = (1, 0) to (ts_ret, pc_ret - 1) *)
subgoal premises prems for \<sigma> \<comment> \<open>Only one subgoal so this style isn't really necessary.\<close>
(* Insert relevant knowledge *)
apply (insert prems assms)
(* Apply VCG/symb. execution *)
apply symbolic_execution (* test *)
apply symbolic_execution (* mov *)
apply symbolic_execution (* je .label_14 *)
apply symbolic_execution (* ret *)
apply finish_symbolic_execution
(* je .label_14 not taken *)
apply restart_symbolic_execution
apply symbolic_execution (* mov *)
apply symbolic_execution (* mov *)
apply symbolic_execution (* xor *)
apply symbolic_execution (* mov *)
apply symbolic_execution (* mov *)
apply symbolic_execution (* mov *)
apply symbolic_execution (* ret *)
apply finish_symbolic_execution
done
done
end
end
|
SUBROUTINE MFFTB9(C,FAC)
*
* PURPOSE:
* ELEMENTARY COOLEY-TUKEY RADIX 3 STEP APPLIED TO A VECTOR-OF
* 2-VECTORS-OF-COMPLEX C[IMS,NM [IVS,NV [IES,NE]]].
* SEE REF.[1] FOR NOTATIONS.
* THIS ROUTINE CAN BE USED ONLY BY ROUTINE MFFTIM, WHICH CONTROLS
* ITS OPERATION THROUGH THE MFFTPA COMMON
*
* DUMMY ARGUMENTS :
*
* C ARRAY BEING FOURIER TRANSFORMED
* FAC PHASE FACTORS, PREPARED BY MFFTP; NOT MODIFIED IN OUTPUT
*
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
COMMON /MFFTPA/ IMS,IVS,IES,NM,NV,NE,MX,LX,MLIM,MSTEP,LLIM,LSTEP,
$ NUSTEP,IVLIM,ILIM,MD2LIM,LD2LIM
INTEGER NUSTEP
DOUBLE COMPLEX C(0:NUSTEP-1,0:2),FAC(0:*)
DOUBLE COMPLEX T0,T1,T2,F1,F2
REAL *8 SIN60
PARAMETER ( SIN60 = 8.6602540378443864E-1)
STOP 'IL FAUT VERIFIER MTFFB9'
RETURN
IF(LX.NE.1)THEN
DO 200 MU=0,MLIM,MSTEP
DO 150 IV=MU,MU+IVLIM,IVS
ILAMF=0
DO 100 ILAM=IV,IV+ILIM
T0=C(ILAM,1)*FAC(ILAMF)+C(ILAM,2)*FAC(ILAMF+NUSTEP)
T2=(C(ILAM,1)*FAC(ILAMF)-C(ILAM,2)*FAC(ILAMF+NUSTEP))*
$ SIN60
T1=C(ILAM,0)-0.5*T0
C(ILAM,0)=C(ILAM,0)+T0
C(ILAM,1)=(T1+DCMPLX(-DIMAG(T2),DREAL(T2)))
C(ILAM,2)=(T1-DCMPLX(-DIMAG(T2),DREAL(T2)))
ILAMF=ILAMF+1
100 CONTINUE
150 CONTINUE
200 CONTINUE
ELSE
DO 400 MU=0,MLIM,MSTEP
DO 350 IV=MU,MU+IVLIM,IVS
DO 300 ILAM=IV,IV+ILIM
T0=C(ILAM,1)+C(ILAM,2)
T2=(C(ILAM,1)-C(ILAM,2))*SIN60
T1=C(ILAM,0)-0.5*T0
C(ILAM,0)=C(ILAM,0)+T0
C(ILAM,1)=(T1+DCMPLX(-DIMAG(T2),DREAL(T2)))
C(ILAM,2)=(T1-DCMPLX(-DIMAG(T2),DREAL(T2)))
300 CONTINUE
350 CONTINUE
400 CONTINUE
ENDIF
END
|
[GOAL]
D : GlueData
U : Set ↑(GlueData.glued D.toGlueData)
⊢ IsOpen U ↔ ∀ (i : D.J), IsOpen (↑(GlueData.ι D.toGlueData i) ⁻¹' U)
[PROOFSTEP]
delta CategoryTheory.GlueData.ι
[GOAL]
D : GlueData
U : Set ↑(GlueData.glued D.toGlueData)
⊢ IsOpen U ↔ ∀ (i : D.J), IsOpen (↑(Multicoequalizer.π (GlueData.diagram D.toGlueData) i) ⁻¹' U)
[PROOFSTEP]
simp_rw [← Multicoequalizer.ι_sigmaπ 𝖣.diagram]
[GOAL]
D : GlueData
U : Set ↑(GlueData.glued D.toGlueData)
⊢ IsOpen U ↔
∀ (i : D.J),
IsOpen
(↑(Sigma.ι (GlueData.diagram D.toGlueData).right i ≫
Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) ⁻¹'
U)
[PROOFSTEP]
rw [← (homeoOfIso (Multicoequalizer.isoCoequalizer 𝖣.diagram).symm).isOpen_preimage]
[GOAL]
D : GlueData
U : Set ↑(GlueData.glued D.toGlueData)
⊢ IsOpen (↑(homeoOfIso (Multicoequalizer.isoCoequalizer (GlueData.diagram D.toGlueData)).symm) ⁻¹' U) ↔
∀ (i : D.J),
IsOpen
(↑(Sigma.ι (GlueData.diagram D.toGlueData).right i ≫
Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) ⁻¹'
U)
[PROOFSTEP]
rw [coequalizer_isOpen_iff]
[GOAL]
D : GlueData
U : Set ↑(GlueData.glued D.toGlueData)
⊢ IsOpen
(↑(colimit.ι
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
WalkingParallelPair.one) ⁻¹'
(↑(homeoOfIso (Multicoequalizer.isoCoequalizer (GlueData.diagram D.toGlueData)).symm) ⁻¹' U)) ↔
∀ (i : D.J),
IsOpen
(↑(Sigma.ι (GlueData.diagram D.toGlueData).right i ≫
Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) ⁻¹'
U)
[PROOFSTEP]
dsimp only [GlueData.diagram_l, GlueData.diagram_left, GlueData.diagram_r, GlueData.diagram_right, parallelPair_obj_one]
[GOAL]
D : GlueData
U : Set ↑(GlueData.glued D.toGlueData)
⊢ IsOpen
(↑(colimit.ι
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
WalkingParallelPair.one) ⁻¹'
(↑(homeoOfIso (Multicoequalizer.isoCoequalizer (GlueData.diagram D.toGlueData)).symm) ⁻¹' U)) ↔
∀ (i : D.J), IsOpen (↑(Sigma.ι D.U i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) ⁻¹' U)
[PROOFSTEP]
rw [colimit_isOpen_iff.{_, u}]
-- porting note: changed `.{u}` to `.{_,u}`. fun fact: the proof
-- breaks down if this `rw` is merged with the `rw` above.
[GOAL]
D : GlueData
U : Set ↑(GlueData.glued D.toGlueData)
⊢ (∀ (j : Discrete D.J),
IsOpen
(↑(colimit.ι (Discrete.functor D.U) j) ⁻¹'
(↑(colimit.ι
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
WalkingParallelPair.one) ⁻¹'
(↑(homeoOfIso (Multicoequalizer.isoCoequalizer (GlueData.diagram D.toGlueData)).symm) ⁻¹' U)))) ↔
∀ (i : D.J), IsOpen (↑(Sigma.ι D.U i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) ⁻¹' U)
[PROOFSTEP]
constructor
[GOAL]
case mp
D : GlueData
U : Set ↑(GlueData.glued D.toGlueData)
⊢ (∀ (j : Discrete D.J),
IsOpen
(↑(colimit.ι (Discrete.functor D.U) j) ⁻¹'
(↑(colimit.ι
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
WalkingParallelPair.one) ⁻¹'
(↑(homeoOfIso (Multicoequalizer.isoCoequalizer (GlueData.diagram D.toGlueData)).symm) ⁻¹' U)))) →
∀ (i : D.J), IsOpen (↑(Sigma.ι D.U i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) ⁻¹' U)
[PROOFSTEP]
intro h j
[GOAL]
case mp
D : GlueData
U : Set ↑(GlueData.glued D.toGlueData)
h :
∀ (j : Discrete D.J),
IsOpen
(↑(colimit.ι (Discrete.functor D.U) j) ⁻¹'
(↑(colimit.ι
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
WalkingParallelPair.one) ⁻¹'
(↑(homeoOfIso (Multicoequalizer.isoCoequalizer (GlueData.diagram D.toGlueData)).symm) ⁻¹' U)))
j : D.J
⊢ IsOpen (↑(Sigma.ι D.U j ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) ⁻¹' U)
[PROOFSTEP]
exact h ⟨j⟩
[GOAL]
case mpr
D : GlueData
U : Set ↑(GlueData.glued D.toGlueData)
⊢ (∀ (i : D.J), IsOpen (↑(Sigma.ι D.U i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) ⁻¹' U)) →
∀ (j : Discrete D.J),
IsOpen
(↑(colimit.ι (Discrete.functor D.U) j) ⁻¹'
(↑(colimit.ι
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
WalkingParallelPair.one) ⁻¹'
(↑(homeoOfIso (Multicoequalizer.isoCoequalizer (GlueData.diagram D.toGlueData)).symm) ⁻¹' U)))
[PROOFSTEP]
intro h j
[GOAL]
case mpr
D : GlueData
U : Set ↑(GlueData.glued D.toGlueData)
h : ∀ (i : D.J), IsOpen (↑(Sigma.ι D.U i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) ⁻¹' U)
j : Discrete D.J
⊢ IsOpen
(↑(colimit.ι (Discrete.functor D.U) j) ⁻¹'
(↑(colimit.ι
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
WalkingParallelPair.one) ⁻¹'
(↑(homeoOfIso (Multicoequalizer.isoCoequalizer (GlueData.diagram D.toGlueData)).symm) ⁻¹' U)))
[PROOFSTEP]
cases j
[GOAL]
case mpr.mk
D : GlueData
U : Set ↑(GlueData.glued D.toGlueData)
h : ∀ (i : D.J), IsOpen (↑(Sigma.ι D.U i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) ⁻¹' U)
as✝ : D.J
⊢ IsOpen
(↑(colimit.ι (Discrete.functor D.U) { as := as✝ }) ⁻¹'
(↑(colimit.ι
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
WalkingParallelPair.one) ⁻¹'
(↑(homeoOfIso (Multicoequalizer.isoCoequalizer (GlueData.diagram D.toGlueData)).symm) ⁻¹' U)))
[PROOFSTEP]
apply h
[GOAL]
D : GlueData
⊢ ∀ {x y : (i : D.J) × ↑(GlueData.U D.toGlueData i)}, Rel D x y → Rel D y x
[PROOFSTEP]
rintro a b (⟨⟨⟩⟩ | ⟨x, e₁, e₂⟩)
[GOAL]
case inl.refl
D : GlueData
a : (i : D.J) × ↑(GlueData.U D.toGlueData i)
⊢ Rel D a a
case inr.intro.intro
D : GlueData
a b : (i : D.J) × ↑(GlueData.U D.toGlueData i)
x : ↑(GlueData.V D.toGlueData (a.fst, b.fst))
e₁ : ↑(GlueData.f D.toGlueData a.fst b.fst) x = a.snd
e₂ : ↑(GlueData.f D.toGlueData b.fst a.fst) (↑(GlueData.t D.toGlueData a.fst b.fst) x) = b.snd
⊢ Rel D b a
[PROOFSTEP]
exacts [Or.inl rfl, Or.inr ⟨D.t _ _ x, by simp [e₁, e₂]⟩]
[GOAL]
D : GlueData
a b : (i : D.J) × ↑(GlueData.U D.toGlueData i)
x : ↑(GlueData.V D.toGlueData (a.fst, b.fst))
e₁ : ↑(GlueData.f D.toGlueData a.fst b.fst) x = a.snd
e₂ : ↑(GlueData.f D.toGlueData b.fst a.fst) (↑(GlueData.t D.toGlueData a.fst b.fst) x) = b.snd
⊢ ↑(GlueData.f D.toGlueData b.fst a.fst) (↑(GlueData.t D.toGlueData a.fst b.fst) x) = b.snd ∧
↑(GlueData.f D.toGlueData a.fst b.fst)
(↑(GlueData.t D.toGlueData b.fst a.fst) (↑(GlueData.t D.toGlueData a.fst b.fst) x)) =
a.snd
[PROOFSTEP]
simp [e₁, e₂]
[GOAL]
D : GlueData
⊢ ∀ {x y z : (i : D.J) × ↑(GlueData.U D.toGlueData i)}, Rel D x y → Rel D y z → Rel D x z
[PROOFSTEP]
rintro ⟨i, a⟩ ⟨j, b⟩ ⟨k, c⟩ (⟨⟨⟩⟩ | ⟨x, e₁, e₂⟩)
[GOAL]
case mk.mk.mk.inl.refl
D : GlueData
i : D.J
a : ↑(GlueData.U D.toGlueData i)
k : D.J
c : ↑(GlueData.U D.toGlueData k)
⊢ Rel D { fst := i, snd := a } { fst := k, snd := c } → Rel D { fst := i, snd := a } { fst := k, snd := c }
case mk.mk.mk.inr.intro.intro
D : GlueData
i : D.J
a : ↑(GlueData.U D.toGlueData i)
j : D.J
b : ↑(GlueData.U D.toGlueData j)
k : D.J
c : ↑(GlueData.U D.toGlueData k)
x : ↑(GlueData.V D.toGlueData ({ fst := i, snd := a }.fst, { fst := j, snd := b }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x = { fst := i, snd := a }.snd
e₂ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
{ fst := j, snd := b }.snd
⊢ Rel D { fst := j, snd := b } { fst := k, snd := c } → Rel D { fst := i, snd := a } { fst := k, snd := c }
[PROOFSTEP]
exact id
[GOAL]
case mk.mk.mk.inr.intro.intro
D : GlueData
i : D.J
a : ↑(GlueData.U D.toGlueData i)
j : D.J
b : ↑(GlueData.U D.toGlueData j)
k : D.J
c : ↑(GlueData.U D.toGlueData k)
x : ↑(GlueData.V D.toGlueData ({ fst := i, snd := a }.fst, { fst := j, snd := b }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x = { fst := i, snd := a }.snd
e₂ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
{ fst := j, snd := b }.snd
⊢ Rel D { fst := j, snd := b } { fst := k, snd := c } → Rel D { fst := i, snd := a } { fst := k, snd := c }
[PROOFSTEP]
rintro (⟨⟨⟩⟩ | ⟨y, e₃, e₄⟩)
[GOAL]
case mk.mk.mk.inr.intro.intro.inl.refl
D : GlueData
i : D.J
a : ↑(GlueData.U D.toGlueData i)
j : D.J
b : ↑(GlueData.U D.toGlueData j)
x : ↑(GlueData.V D.toGlueData ({ fst := i, snd := a }.fst, { fst := j, snd := b }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x = { fst := i, snd := a }.snd
e₂ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
{ fst := j, snd := b }.snd
⊢ Rel D { fst := i, snd := a } { fst := j, snd := b }
case mk.mk.mk.inr.intro.intro.inr.intro.intro
D : GlueData
i : D.J
a : ↑(GlueData.U D.toGlueData i)
j : D.J
b : ↑(GlueData.U D.toGlueData j)
k : D.J
c : ↑(GlueData.U D.toGlueData k)
x : ↑(GlueData.V D.toGlueData ({ fst := i, snd := a }.fst, { fst := j, snd := b }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x = { fst := i, snd := a }.snd
e₂ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
{ fst := j, snd := b }.snd
y : ↑(GlueData.V D.toGlueData ({ fst := j, snd := b }.fst, { fst := k, snd := c }.fst))
e₃ : ↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y = { fst := j, snd := b }.snd
e₄ :
↑(GlueData.f D.toGlueData { fst := k, snd := c }.fst { fst := j, snd := b }.fst)
(↑(GlueData.t D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y) =
{ fst := k, snd := c }.snd
⊢ Rel D { fst := i, snd := a } { fst := k, snd := c }
[PROOFSTEP]
exact Or.inr ⟨x, e₁, e₂⟩
[GOAL]
case mk.mk.mk.inr.intro.intro.inr.intro.intro
D : GlueData
i : D.J
a : ↑(GlueData.U D.toGlueData i)
j : D.J
b : ↑(GlueData.U D.toGlueData j)
k : D.J
c : ↑(GlueData.U D.toGlueData k)
x : ↑(GlueData.V D.toGlueData ({ fst := i, snd := a }.fst, { fst := j, snd := b }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x = { fst := i, snd := a }.snd
e₂ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
{ fst := j, snd := b }.snd
y : ↑(GlueData.V D.toGlueData ({ fst := j, snd := b }.fst, { fst := k, snd := c }.fst))
e₃ : ↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y = { fst := j, snd := b }.snd
e₄ :
↑(GlueData.f D.toGlueData { fst := k, snd := c }.fst { fst := j, snd := b }.fst)
(↑(GlueData.t D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y) =
{ fst := k, snd := c }.snd
⊢ Rel D { fst := i, snd := a } { fst := k, snd := c }
[PROOFSTEP]
let z := (pullbackIsoProdSubtype (D.f j i) (D.f j k)).inv ⟨⟨_, _⟩, e₂.trans e₃.symm⟩
[GOAL]
case mk.mk.mk.inr.intro.intro.inr.intro.intro
D : GlueData
i : D.J
a : ↑(GlueData.U D.toGlueData i)
j : D.J
b : ↑(GlueData.U D.toGlueData j)
k : D.J
c : ↑(GlueData.U D.toGlueData k)
x : ↑(GlueData.V D.toGlueData ({ fst := i, snd := a }.fst, { fst := j, snd := b }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x = { fst := i, snd := a }.snd
e₂ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
{ fst := j, snd := b }.snd
y : ↑(GlueData.V D.toGlueData ({ fst := j, snd := b }.fst, { fst := k, snd := c }.fst))
e₃ : ↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y = { fst := j, snd := b }.snd
e₄ :
↑(GlueData.f D.toGlueData { fst := k, snd := c }.fst { fst := j, snd := b }.fst)
(↑(GlueData.t D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y) =
{ fst := k, snd := c }.snd
z : (fun x => (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k)))
{ val := (↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y),
property :=
(_ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
↑(GlueData.f D.toGlueData j k)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y).snd) } :=
↑(pullbackIsoProdSubtype (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k)).inv
{ val := (↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y),
property :=
(_ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
↑(GlueData.f D.toGlueData j k)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y).snd) }
⊢ Rel D { fst := i, snd := a } { fst := k, snd := c }
[PROOFSTEP]
have eq₁ : (D.t j i) ((pullback.fst : _ /-(D.f j k)-/ ⟶ D.V (j, i)) z) = x := by simp
[GOAL]
D : GlueData
i : D.J
a : ↑(GlueData.U D.toGlueData i)
j : D.J
b : ↑(GlueData.U D.toGlueData j)
k : D.J
c : ↑(GlueData.U D.toGlueData k)
x : ↑(GlueData.V D.toGlueData ({ fst := i, snd := a }.fst, { fst := j, snd := b }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x = { fst := i, snd := a }.snd
e₂ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
{ fst := j, snd := b }.snd
y : ↑(GlueData.V D.toGlueData ({ fst := j, snd := b }.fst, { fst := k, snd := c }.fst))
e₃ : ↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y = { fst := j, snd := b }.snd
e₄ :
↑(GlueData.f D.toGlueData { fst := k, snd := c }.fst { fst := j, snd := b }.fst)
(↑(GlueData.t D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y) =
{ fst := k, snd := c }.snd
z : (fun x => (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k)))
{ val := (↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y),
property :=
(_ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
↑(GlueData.f D.toGlueData j k)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y).snd) } :=
↑(pullbackIsoProdSubtype (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k)).inv
{ val := (↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y),
property :=
(_ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
↑(GlueData.f D.toGlueData j k)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y).snd) }
⊢ ↑(GlueData.t D.toGlueData j i) (↑pullback.fst z) = x
[PROOFSTEP]
simp
[GOAL]
case mk.mk.mk.inr.intro.intro.inr.intro.intro
D : GlueData
i : D.J
a : ↑(GlueData.U D.toGlueData i)
j : D.J
b : ↑(GlueData.U D.toGlueData j)
k : D.J
c : ↑(GlueData.U D.toGlueData k)
x : ↑(GlueData.V D.toGlueData ({ fst := i, snd := a }.fst, { fst := j, snd := b }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x = { fst := i, snd := a }.snd
e₂ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
{ fst := j, snd := b }.snd
y : ↑(GlueData.V D.toGlueData ({ fst := j, snd := b }.fst, { fst := k, snd := c }.fst))
e₃ : ↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y = { fst := j, snd := b }.snd
e₄ :
↑(GlueData.f D.toGlueData { fst := k, snd := c }.fst { fst := j, snd := b }.fst)
(↑(GlueData.t D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y) =
{ fst := k, snd := c }.snd
z : (fun x => (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k)))
{ val := (↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y),
property :=
(_ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
↑(GlueData.f D.toGlueData j k)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y).snd) } :=
↑(pullbackIsoProdSubtype (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k)).inv
{ val := (↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y),
property :=
(_ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
↑(GlueData.f D.toGlueData j k)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y).snd) }
eq₁ : ↑(GlueData.t D.toGlueData j i) (↑pullback.fst z) = x
⊢ Rel D { fst := i, snd := a } { fst := k, snd := c }
[PROOFSTEP]
have eq₂ : (pullback.snd : _ ⟶ D.V _) z = y := pullbackIsoProdSubtype_inv_snd_apply _ _ _
[GOAL]
case mk.mk.mk.inr.intro.intro.inr.intro.intro
D : GlueData
i : D.J
a : ↑(GlueData.U D.toGlueData i)
j : D.J
b : ↑(GlueData.U D.toGlueData j)
k : D.J
c : ↑(GlueData.U D.toGlueData k)
x : ↑(GlueData.V D.toGlueData ({ fst := i, snd := a }.fst, { fst := j, snd := b }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x = { fst := i, snd := a }.snd
e₂ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
{ fst := j, snd := b }.snd
y : ↑(GlueData.V D.toGlueData ({ fst := j, snd := b }.fst, { fst := k, snd := c }.fst))
e₃ : ↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y = { fst := j, snd := b }.snd
e₄ :
↑(GlueData.f D.toGlueData { fst := k, snd := c }.fst { fst := j, snd := b }.fst)
(↑(GlueData.t D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y) =
{ fst := k, snd := c }.snd
z : (fun x => (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k)))
{ val := (↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y),
property :=
(_ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
↑(GlueData.f D.toGlueData j k)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y).snd) } :=
↑(pullbackIsoProdSubtype (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k)).inv
{ val := (↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y),
property :=
(_ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
↑(GlueData.f D.toGlueData j k)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x, y).snd) }
eq₁ : ↑(GlueData.t D.toGlueData j i) (↑pullback.fst z) = x
eq₂ : ↑pullback.snd z = y
⊢ Rel D { fst := i, snd := a } { fst := k, snd := c }
[PROOFSTEP]
clear_value z
[GOAL]
case mk.mk.mk.inr.intro.intro.inr.intro.intro
D : GlueData
i : D.J
a : ↑(GlueData.U D.toGlueData i)
j : D.J
b : ↑(GlueData.U D.toGlueData j)
k : D.J
c : ↑(GlueData.U D.toGlueData k)
x : ↑(GlueData.V D.toGlueData ({ fst := i, snd := a }.fst, { fst := j, snd := b }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x = { fst := i, snd := a }.snd
e₂ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
{ fst := j, snd := b }.snd
y : ↑(GlueData.V D.toGlueData ({ fst := j, snd := b }.fst, { fst := k, snd := c }.fst))
e₃ : ↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y = { fst := j, snd := b }.snd
e₄ :
↑(GlueData.f D.toGlueData { fst := k, snd := c }.fst { fst := j, snd := b }.fst)
(↑(GlueData.t D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y) =
{ fst := k, snd := c }.snd
z : (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k))
eq₁ : ↑(GlueData.t D.toGlueData j i) (↑pullback.fst z) = x
eq₂ : ↑pullback.snd z = y
⊢ Rel D { fst := i, snd := a } { fst := k, snd := c }
[PROOFSTEP]
right
[GOAL]
case mk.mk.mk.inr.intro.intro.inr.intro.intro.h
D : GlueData
i : D.J
a : ↑(GlueData.U D.toGlueData i)
j : D.J
b : ↑(GlueData.U D.toGlueData j)
k : D.J
c : ↑(GlueData.U D.toGlueData k)
x : ↑(GlueData.V D.toGlueData ({ fst := i, snd := a }.fst, { fst := j, snd := b }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x = { fst := i, snd := a }.snd
e₂ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
{ fst := j, snd := b }.snd
y : ↑(GlueData.V D.toGlueData ({ fst := j, snd := b }.fst, { fst := k, snd := c }.fst))
e₃ : ↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y = { fst := j, snd := b }.snd
e₄ :
↑(GlueData.f D.toGlueData { fst := k, snd := c }.fst { fst := j, snd := b }.fst)
(↑(GlueData.t D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y) =
{ fst := k, snd := c }.snd
z : (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k))
eq₁ : ↑(GlueData.t D.toGlueData j i) (↑pullback.fst z) = x
eq₂ : ↑pullback.snd z = y
⊢ ∃ x,
↑(GlueData.f D.toGlueData { fst := i, snd := a }.fst { fst := k, snd := c }.fst) x = { fst := i, snd := a }.snd ∧
↑(GlueData.f D.toGlueData { fst := k, snd := c }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := k, snd := c }.fst) x) =
{ fst := k, snd := c }.snd
[PROOFSTEP]
use(pullback.fst : _ ⟶ D.V (i, k)) (D.t' _ _ _ z)
[GOAL]
case h
D : GlueData
i : D.J
a : ↑(GlueData.U D.toGlueData i)
j : D.J
b : ↑(GlueData.U D.toGlueData j)
k : D.J
c : ↑(GlueData.U D.toGlueData k)
x : ↑(GlueData.V D.toGlueData ({ fst := i, snd := a }.fst, { fst := j, snd := b }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x = { fst := i, snd := a }.snd
e₂ :
↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := j, snd := b }.fst) x) =
{ fst := j, snd := b }.snd
y : ↑(GlueData.V D.toGlueData ({ fst := j, snd := b }.fst, { fst := k, snd := c }.fst))
e₃ : ↑(GlueData.f D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y = { fst := j, snd := b }.snd
e₄ :
↑(GlueData.f D.toGlueData { fst := k, snd := c }.fst { fst := j, snd := b }.fst)
(↑(GlueData.t D.toGlueData { fst := j, snd := b }.fst { fst := k, snd := c }.fst) y) =
{ fst := k, snd := c }.snd
z : (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k))
eq₁ : ↑(GlueData.t D.toGlueData j i) (↑pullback.fst z) = x
eq₂ : ↑pullback.snd z = y
⊢ ↑(GlueData.f D.toGlueData { fst := i, snd := a }.fst { fst := k, snd := c }.fst)
(↑pullback.fst (↑(GlueData.t' D.toGlueData j i k) z)) =
{ fst := i, snd := a }.snd ∧
↑(GlueData.f D.toGlueData { fst := k, snd := c }.fst { fst := i, snd := a }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := a }.fst { fst := k, snd := c }.fst)
(↑pullback.fst (↑(GlueData.t' D.toGlueData j i k) z))) =
{ fst := k, snd := c }.snd
[PROOFSTEP]
dsimp only at *
[GOAL]
case h
D : GlueData
i : D.J
a : ↑(GlueData.U D.toGlueData i)
j : D.J
b : ↑(GlueData.U D.toGlueData j)
k : D.J
c : ↑(GlueData.U D.toGlueData k)
x : ↑(GlueData.V D.toGlueData ({ fst := i, snd := a }.fst, { fst := j, snd := b }.fst))
e₁ : ↑(GlueData.f D.toGlueData i j) x = a
e₂ : ↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) x) = b
y : ↑(GlueData.V D.toGlueData ({ fst := j, snd := b }.fst, { fst := k, snd := c }.fst))
e₃ : ↑(GlueData.f D.toGlueData j k) y = b
e₄ : ↑(GlueData.f D.toGlueData k j) (↑(GlueData.t D.toGlueData j k) y) = c
z : (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k))
eq₁ : ↑(GlueData.t D.toGlueData j i) (↑pullback.fst z) = x
eq₂ : ↑pullback.snd z = y
⊢ ↑(GlueData.f D.toGlueData i k) (↑pullback.fst (↑(GlueData.t' D.toGlueData j i k) z)) = a ∧
↑(GlueData.f D.toGlueData k i)
(↑(GlueData.t D.toGlueData i k) (↑pullback.fst (↑(GlueData.t' D.toGlueData j i k) z))) =
c
[PROOFSTEP]
substs eq₁ eq₂ e₁ e₃ e₄
[GOAL]
case h
D : GlueData
i j k : D.J
z : (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k))
e₂ :
↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) (↑(GlueData.t D.toGlueData j i) (↑pullback.fst z))) =
↑(GlueData.f D.toGlueData j k) (↑pullback.snd z)
⊢ ↑(GlueData.f D.toGlueData i k) (↑pullback.fst (↑(GlueData.t' D.toGlueData j i k) z)) =
↑(GlueData.f D.toGlueData i j) (↑(GlueData.t D.toGlueData j i) (↑pullback.fst z)) ∧
↑(GlueData.f D.toGlueData k i)
(↑(GlueData.t D.toGlueData i k) (↑pullback.fst (↑(GlueData.t' D.toGlueData j i k) z))) =
↑(GlueData.f D.toGlueData k j) (↑(GlueData.t D.toGlueData j k) (↑pullback.snd z))
[PROOFSTEP]
have h₁ : D.t' j i k ≫ pullback.fst ≫ D.f i k = pullback.fst ≫ D.t j i ≫ D.f i j := by rw [← 𝖣.t_fac_assoc]; congr 1;
exact pullback.condition
[GOAL]
D : GlueData
i j k : D.J
z : (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k))
e₂ :
↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) (↑(GlueData.t D.toGlueData j i) (↑pullback.fst z))) =
↑(GlueData.f D.toGlueData j k) (↑pullback.snd z)
⊢ GlueData.t' D.toGlueData j i k ≫ pullback.fst ≫ GlueData.f D.toGlueData i k =
pullback.fst ≫ GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j
[PROOFSTEP]
rw [← 𝖣.t_fac_assoc]
[GOAL]
D : GlueData
i j k : D.J
z : (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k))
e₂ :
↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) (↑(GlueData.t D.toGlueData j i) (↑pullback.fst z))) =
↑(GlueData.f D.toGlueData j k) (↑pullback.snd z)
⊢ GlueData.t' D.toGlueData j i k ≫ pullback.fst ≫ GlueData.f D.toGlueData i k =
GlueData.t' D.toGlueData j i k ≫ pullback.snd ≫ GlueData.f D.toGlueData i j
[PROOFSTEP]
congr 1
[GOAL]
case e_a
D : GlueData
i j k : D.J
z : (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k))
e₂ :
↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) (↑(GlueData.t D.toGlueData j i) (↑pullback.fst z))) =
↑(GlueData.f D.toGlueData j k) (↑pullback.snd z)
⊢ pullback.fst ≫ GlueData.f D.toGlueData i k = pullback.snd ≫ GlueData.f D.toGlueData i j
[PROOFSTEP]
exact pullback.condition
[GOAL]
case h
D : GlueData
i j k : D.J
z : (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k))
e₂ :
↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) (↑(GlueData.t D.toGlueData j i) (↑pullback.fst z))) =
↑(GlueData.f D.toGlueData j k) (↑pullback.snd z)
h₁ :
GlueData.t' D.toGlueData j i k ≫ pullback.fst ≫ GlueData.f D.toGlueData i k =
pullback.fst ≫ GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j
⊢ ↑(GlueData.f D.toGlueData i k) (↑pullback.fst (↑(GlueData.t' D.toGlueData j i k) z)) =
↑(GlueData.f D.toGlueData i j) (↑(GlueData.t D.toGlueData j i) (↑pullback.fst z)) ∧
↑(GlueData.f D.toGlueData k i)
(↑(GlueData.t D.toGlueData i k) (↑pullback.fst (↑(GlueData.t' D.toGlueData j i k) z))) =
↑(GlueData.f D.toGlueData k j) (↑(GlueData.t D.toGlueData j k) (↑pullback.snd z))
[PROOFSTEP]
have h₂ : D.t' j i k ≫ pullback.fst ≫ D.t i k ≫ D.f k i = pullback.snd ≫ D.t j k ≫ D.f k j :=
by
rw [← 𝖣.t_fac_assoc]
apply @Epi.left_cancellation _ _ _ _ (D.t' k j i)
rw [𝖣.cocycle_assoc, 𝖣.t_fac_assoc, 𝖣.t_inv_assoc]
exact pullback.condition.symm
[GOAL]
D : GlueData
i j k : D.J
z : (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k))
e₂ :
↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) (↑(GlueData.t D.toGlueData j i) (↑pullback.fst z))) =
↑(GlueData.f D.toGlueData j k) (↑pullback.snd z)
h₁ :
GlueData.t' D.toGlueData j i k ≫ pullback.fst ≫ GlueData.f D.toGlueData i k =
pullback.fst ≫ GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j
⊢ GlueData.t' D.toGlueData j i k ≫ pullback.fst ≫ GlueData.t D.toGlueData i k ≫ GlueData.f D.toGlueData k i =
pullback.snd ≫ GlueData.t D.toGlueData j k ≫ GlueData.f D.toGlueData k j
[PROOFSTEP]
rw [← 𝖣.t_fac_assoc]
[GOAL]
D : GlueData
i j k : D.J
z : (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k))
e₂ :
↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) (↑(GlueData.t D.toGlueData j i) (↑pullback.fst z))) =
↑(GlueData.f D.toGlueData j k) (↑pullback.snd z)
h₁ :
GlueData.t' D.toGlueData j i k ≫ pullback.fst ≫ GlueData.f D.toGlueData i k =
pullback.fst ≫ GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j
⊢ GlueData.t' D.toGlueData j i k ≫ GlueData.t' D.toGlueData i k j ≫ pullback.snd ≫ GlueData.f D.toGlueData k i =
pullback.snd ≫ GlueData.t D.toGlueData j k ≫ GlueData.f D.toGlueData k j
[PROOFSTEP]
apply @Epi.left_cancellation _ _ _ _ (D.t' k j i)
[GOAL]
case a
D : GlueData
i j k : D.J
z : (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k))
e₂ :
↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) (↑(GlueData.t D.toGlueData j i) (↑pullback.fst z))) =
↑(GlueData.f D.toGlueData j k) (↑pullback.snd z)
h₁ :
GlueData.t' D.toGlueData j i k ≫ pullback.fst ≫ GlueData.f D.toGlueData i k =
pullback.fst ≫ GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j
⊢ GlueData.t' D.toGlueData k j i ≫
GlueData.t' D.toGlueData j i k ≫ GlueData.t' D.toGlueData i k j ≫ pullback.snd ≫ GlueData.f D.toGlueData k i =
GlueData.t' D.toGlueData k j i ≫ pullback.snd ≫ GlueData.t D.toGlueData j k ≫ GlueData.f D.toGlueData k j
[PROOFSTEP]
rw [𝖣.cocycle_assoc, 𝖣.t_fac_assoc, 𝖣.t_inv_assoc]
[GOAL]
case a
D : GlueData
i j k : D.J
z : (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k))
e₂ :
↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) (↑(GlueData.t D.toGlueData j i) (↑pullback.fst z))) =
↑(GlueData.f D.toGlueData j k) (↑pullback.snd z)
h₁ :
GlueData.t' D.toGlueData j i k ≫ pullback.fst ≫ GlueData.f D.toGlueData i k =
pullback.fst ≫ GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j
⊢ pullback.snd ≫ GlueData.f D.toGlueData k i = pullback.fst ≫ GlueData.f D.toGlueData k j
[PROOFSTEP]
exact pullback.condition.symm
[GOAL]
case h
D : GlueData
i j k : D.J
z : (forget TopCat).obj (pullback (GlueData.f D.toGlueData j i) (GlueData.f D.toGlueData j k))
e₂ :
↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) (↑(GlueData.t D.toGlueData j i) (↑pullback.fst z))) =
↑(GlueData.f D.toGlueData j k) (↑pullback.snd z)
h₁ :
GlueData.t' D.toGlueData j i k ≫ pullback.fst ≫ GlueData.f D.toGlueData i k =
pullback.fst ≫ GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j
h₂ :
GlueData.t' D.toGlueData j i k ≫ pullback.fst ≫ GlueData.t D.toGlueData i k ≫ GlueData.f D.toGlueData k i =
pullback.snd ≫ GlueData.t D.toGlueData j k ≫ GlueData.f D.toGlueData k j
⊢ ↑(GlueData.f D.toGlueData i k) (↑pullback.fst (↑(GlueData.t' D.toGlueData j i k) z)) =
↑(GlueData.f D.toGlueData i j) (↑(GlueData.t D.toGlueData j i) (↑pullback.fst z)) ∧
↑(GlueData.f D.toGlueData k i)
(↑(GlueData.t D.toGlueData i k) (↑pullback.fst (↑(GlueData.t' D.toGlueData j i k) z))) =
↑(GlueData.f D.toGlueData k j) (↑(GlueData.t D.toGlueData j k) (↑pullback.snd z))
[PROOFSTEP]
exact ⟨ContinuousMap.congr_fun h₁ z, ContinuousMap.congr_fun h₂ z⟩
[GOAL]
D : GlueData
x y : ↑(∐ D.U)
h : ↑(GlueData.π D.toGlueData) x = ↑(GlueData.π D.toGlueData) y
⊢ EqvGen
(Types.CoequalizerRel ↑(MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
↑(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
x y
[PROOFSTEP]
delta GlueData.π Multicoequalizer.sigmaπ at h
[GOAL]
D : GlueData
x y : ↑(∐ D.U)
h :
↑(coequalizer.π (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)) ≫
(Multicoequalizer.isoCoequalizer (GlueData.diagram D.toGlueData)).inv)
x =
↑(coequalizer.π (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)) ≫
(Multicoequalizer.isoCoequalizer (GlueData.diagram D.toGlueData)).inv)
y
⊢ EqvGen
(Types.CoequalizerRel ↑(MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
↑(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
x y
[PROOFSTEP]
replace h := (TopCat.mono_iff_injective (Multicoequalizer.isoCoequalizer 𝖣.diagram).inv).mp inferInstance h
[GOAL]
D : GlueData
x y : ↑(∐ D.U)
h :
(coequalizer.π (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))).1
x =
(coequalizer.π (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))).1
y
⊢ EqvGen
(Types.CoequalizerRel ↑(MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
↑(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
x y
[PROOFSTEP]
let diagram := parallelPair 𝖣.diagram.fstSigmaMap 𝖣.diagram.sndSigmaMap ⋙ forget _
[GOAL]
D : GlueData
x y : ↑(∐ D.U)
h :
(coequalizer.π (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))).1
x =
(coequalizer.π (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))).1
y
diagram : WalkingParallelPair ⥤ Type u :=
parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)) ⋙
forget TopCat
⊢ EqvGen
(Types.CoequalizerRel ↑(MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
↑(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
x y
[PROOFSTEP]
have : colimit.ι diagram one x = colimit.ι diagram one y :=
by
dsimp only [coequalizer.π, ContinuousMap.toFun_eq_coe] at h
rw [← ι_preservesColimitsIso_hom, forget_map_eq_coe, types_comp_apply, h]
simp
[GOAL]
D : GlueData
x y : ↑(∐ D.U)
h :
(coequalizer.π (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))).1
x =
(coequalizer.π (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))).1
y
diagram : WalkingParallelPair ⥤ Type u :=
parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)) ⋙
forget TopCat
⊢ colimit.ι diagram one x = colimit.ι diagram one y
[PROOFSTEP]
dsimp only [coequalizer.π, ContinuousMap.toFun_eq_coe] at h
[GOAL]
D : GlueData
x y : ↑(∐ D.U)
h :
↑(colimit.ι
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
one)
x =
↑(colimit.ι
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
one)
y
diagram : WalkingParallelPair ⥤ Type u :=
parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)) ⋙
forget TopCat
⊢ colimit.ι diagram one x = colimit.ι diagram one y
[PROOFSTEP]
rw [← ι_preservesColimitsIso_hom, forget_map_eq_coe, types_comp_apply, h]
[GOAL]
D : GlueData
x y : ↑(∐ D.U)
h :
↑(colimit.ι
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
one)
x =
↑(colimit.ι
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
one)
y
diagram : WalkingParallelPair ⥤ Type u :=
parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)) ⋙
forget TopCat
⊢ (preservesColimitIso (forget TopCat)
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))).hom
(↑(colimit.ι
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
one)
y) =
(↑(colimit.ι
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
one) ≫
(preservesColimitIso (forget TopCat)
(parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))).hom)
y
[PROOFSTEP]
simp
[GOAL]
D : GlueData
x y : ↑(∐ D.U)
h :
(coequalizer.π (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))).1
x =
(coequalizer.π (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))).1
y
diagram : WalkingParallelPair ⥤ Type u :=
parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)) ⋙
forget TopCat
this : colimit.ι diagram one x = colimit.ι diagram one y
⊢ EqvGen
(Types.CoequalizerRel ↑(MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
↑(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
x y
[PROOFSTEP]
have :
(colimit.ι diagram _ ≫ colim.map _ ≫ (colimit.isoColimitCocone _).hom) _ =
(colimit.ι diagram _ ≫ colim.map _ ≫ (colimit.isoColimitCocone _).hom) _ :=
(congr_arg
(colim.map (diagramIsoParallelPair diagram).hom ≫ (colimit.isoColimitCocone (Types.coequalizerColimit _ _)).hom)
this :
_)
-- Porting note: was
-- simp only [eqToHom_refl, types_comp_apply, colimit.ι_map_assoc,
-- diagramIsoParallelPair_hom_app, colimit.isoColimitCocone_ι_hom, types_id_apply] at this
-- See https://github.com/leanprover-community/mathlib4/issues/5026
[GOAL]
D : GlueData
x y : ↑(∐ D.U)
h :
(coequalizer.π (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))).1
x =
(coequalizer.π (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))).1
y
diagram : WalkingParallelPair ⥤ Type u :=
parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)) ⋙
forget TopCat
this✝ : colimit.ι diagram one x = colimit.ι diagram one y
this :
(colimit.ι diagram one ≫
colim.map (diagramIsoParallelPair diagram).hom ≫
(colimit.isoColimitCocone
(Types.coequalizerColimit (diagram.map WalkingParallelPairHom.left)
(diagram.map WalkingParallelPairHom.right))).hom)
x =
(colimit.ι diagram one ≫
colim.map (diagramIsoParallelPair diagram).hom ≫
(colimit.isoColimitCocone
(Types.coequalizerColimit (diagram.map WalkingParallelPairHom.left)
(diagram.map WalkingParallelPairHom.right))).hom)
y
⊢ EqvGen
(Types.CoequalizerRel ↑(MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
↑(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
x y
[PROOFSTEP]
rw [colimit.ι_map_assoc, diagramIsoParallelPair_hom_app, eqToHom_refl, colimit.isoColimitCocone_ι_hom, types_comp_apply,
types_id_apply, types_comp_apply, types_id_apply] at this
[GOAL]
D : GlueData
x y : ↑(∐ D.U)
h :
(coequalizer.π (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))).1
x =
(coequalizer.π (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))).1
y
diagram : WalkingParallelPair ⥤ Type u :=
parallelPair (MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)) ⋙
forget TopCat
this✝ : colimit.ι diagram one x = colimit.ι diagram one y
this :
NatTrans.app
(Types.coequalizerColimit (diagram.map WalkingParallelPairHom.left)
(diagram.map WalkingParallelPairHom.right)).cocone.ι
one x =
NatTrans.app
(Types.coequalizerColimit (diagram.map WalkingParallelPairHom.left)
(diagram.map WalkingParallelPairHom.right)).cocone.ι
one y
⊢ EqvGen
(Types.CoequalizerRel ↑(MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
↑(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)))
x y
[PROOFSTEP]
exact Quot.eq.1 this
[GOAL]
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
⊢ ↑(GlueData.ι D.toGlueData i) x = ↑(GlueData.ι D.toGlueData j) y ↔ Rel D { fst := i, snd := x } { fst := j, snd := y }
[PROOFSTEP]
constructor
[GOAL]
case mp
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
⊢ ↑(GlueData.ι D.toGlueData i) x = ↑(GlueData.ι D.toGlueData j) y → Rel D { fst := i, snd := x } { fst := j, snd := y }
[PROOFSTEP]
delta GlueData.ι
[GOAL]
case mp
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
⊢ ↑(Multicoequalizer.π (GlueData.diagram D.toGlueData) i) x =
↑(Multicoequalizer.π (GlueData.diagram D.toGlueData) j) y →
Rel D { fst := i, snd := x } { fst := j, snd := y }
[PROOFSTEP]
simp_rw [← Multicoequalizer.ι_sigmaπ]
[GOAL]
case mp
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
⊢ ↑(Sigma.ι (GlueData.diagram D.toGlueData).right i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y →
Rel D { fst := i, snd := x } { fst := j, snd := y }
[PROOFSTEP]
intro h
[GOAL]
case mp
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y
⊢ Rel D { fst := i, snd := x } { fst := j, snd := y }
[PROOFSTEP]
rw [← show _ = Sigma.mk i x from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
[GOAL]
case mp
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y
⊢ Rel D (↑((sigmaIsoSigma D.U).inv ≫ (sigmaIsoSigma D.U).hom) { fst := i, snd := x }) { fst := j, snd := y }
[PROOFSTEP]
rw [← show _ = Sigma.mk j y from ConcreteCategory.congr_hom (sigmaIsoSigma.{_, u} D.U).inv_hom_id _]
[GOAL]
case mp
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y
⊢ Rel D (↑((sigmaIsoSigma D.U).inv ≫ (sigmaIsoSigma D.U).hom) { fst := i, snd := x })
(↑((sigmaIsoSigma D.U).inv ≫ (sigmaIsoSigma D.U).hom) { fst := j, snd := y })
[PROOFSTEP]
change InvImage D.Rel (sigmaIsoSigma.{_, u} D.U).hom _ _
[GOAL]
case mp
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y
⊢ InvImage (Rel D) (↑(sigmaIsoSigma D.U).hom) (↑(sigmaIsoSigma D.U).inv { fst := i, snd := x })
(↑(sigmaIsoSigma D.U).inv { fst := j, snd := y })
[PROOFSTEP]
simp only [TopCat.sigmaIsoSigma_inv_apply]
[GOAL]
case mp
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y
⊢ InvImage (Rel D) (↑(sigmaIsoSigma D.U).hom) (↑(sigmaIsoSigma D.U).inv { fst := i, snd := x })
(↑(sigmaIsoSigma D.U).inv { fst := j, snd := y })
[PROOFSTEP]
rw [← (InvImage.equivalence _ _ D.rel_equiv).eqvGen_iff]
[GOAL]
case mp
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y
⊢ EqvGen (InvImage (Rel D) ↑(sigmaIsoSigma D.U).hom) (↑(sigmaIsoSigma D.U).inv { fst := i, snd := x })
(↑(sigmaIsoSigma D.U).inv { fst := j, snd := y })
[PROOFSTEP]
refine' EqvGen.mono _ (D.eqvGen_of_π_eq h : _)
[GOAL]
case mp
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y
⊢ ∀ (a b : (forget TopCat).obj (∐ D.U)),
Types.CoequalizerRel (↑(MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData)))
(↑(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))) a b →
InvImage (Rel D) (↑(sigmaIsoSigma D.U).hom) a b
[PROOFSTEP]
rintro _ _ ⟨x⟩
[GOAL]
case mp.Rel
D : GlueData
i j : D.J
x✝ : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
⊢ InvImage (Rel D) (↑(sigmaIsoSigma D.U).hom) (↑(MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData)) x)
(↑(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData)) x)
[PROOFSTEP]
rw [← show (sigmaIsoSigma.{u, u} _).inv _ = x from ConcreteCategory.congr_hom (sigmaIsoSigma.{u, u} _).hom_inv_id x]
[GOAL]
case mp.Rel
D : GlueData
i j : D.J
x✝ : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
⊢ InvImage (Rel D) (↑(sigmaIsoSigma D.U).hom)
(↑(MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(↑(sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv
(↑(sigmaIsoSigma (GlueData.diagram D.toGlueData).left).hom x)))
(↑(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))
(↑(sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv
(↑(sigmaIsoSigma (GlueData.diagram D.toGlueData).left).hom x)))
[PROOFSTEP]
generalize (sigmaIsoSigma.{u, u} D.V).hom x = x'
[GOAL]
case mp.Rel
D : GlueData
i j : D.J
x✝ : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
x' : (forget TopCat).obj (of ((i : D.J × D.J) × ↑(GlueData.V D.toGlueData i)))
⊢ InvImage (Rel D) (↑(sigmaIsoSigma D.U).hom)
(↑(MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(↑(sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv x'))
(↑(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))
(↑(sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv x'))
[PROOFSTEP]
obtain ⟨⟨i, j⟩, y⟩ := x'
[GOAL]
case mp.Rel.mk.mk
D : GlueData
i✝ j✝ : D.J
x✝ : ↑(GlueData.U D.toGlueData i✝)
y✝ : ↑(GlueData.U D.toGlueData j✝)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y✝
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
i j : D.J
y : ↑(GlueData.V D.toGlueData (i, j))
⊢ InvImage (Rel D) (↑(sigmaIsoSigma D.U).hom)
(↑(MultispanIndex.fstSigmaMap (GlueData.diagram D.toGlueData))
(↑(sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv { fst := (i, j), snd := y }))
(↑(MultispanIndex.sndSigmaMap (GlueData.diagram D.toGlueData))
(↑(sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv { fst := (i, j), snd := y }))
[PROOFSTEP]
unfold InvImage MultispanIndex.fstSigmaMap MultispanIndex.sndSigmaMap
[GOAL]
case mp.Rel.mk.mk
D : GlueData
i✝ j✝ : D.J
x✝ : ↑(GlueData.U D.toGlueData i✝)
y✝ : ↑(GlueData.U D.toGlueData j✝)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y✝
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
i j : D.J
y : ↑(GlueData.V D.toGlueData (i, j))
⊢ Rel D
(↑(sigmaIsoSigma D.U).hom
(↑(Sigma.desc fun b =>
MultispanIndex.fst (GlueData.diagram D.toGlueData) b ≫
Sigma.ι (GlueData.diagram D.toGlueData).right (MultispanIndex.fstFrom (GlueData.diagram D.toGlueData) b))
(↑(sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv { fst := (i, j), snd := y })))
(↑(sigmaIsoSigma D.U).hom
(↑(Sigma.desc fun b =>
MultispanIndex.snd (GlueData.diagram D.toGlueData) b ≫
Sigma.ι (GlueData.diagram D.toGlueData).right (MultispanIndex.sndFrom (GlueData.diagram D.toGlueData) b))
(↑(sigmaIsoSigma (GlueData.diagram D.toGlueData).left).inv { fst := (i, j), snd := y })))
[PROOFSTEP]
simp only [Opens.inclusion_apply, TopCat.comp_app, sigmaIsoSigma_inv_apply, Cofan.mk_ι_app]
[GOAL]
case mp.Rel.mk.mk
D : GlueData
i✝ j✝ : D.J
x✝ : ↑(GlueData.U D.toGlueData i✝)
y✝ : ↑(GlueData.U D.toGlueData j✝)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y✝
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
i j : D.J
y : ↑(GlueData.V D.toGlueData (i, j))
⊢ Rel D
(↑(sigmaIsoSigma D.U).hom
(↑(Sigma.desc fun b =>
MultispanIndex.fst (GlueData.diagram D.toGlueData) b ≫
Sigma.ι (GlueData.diagram D.toGlueData).right (MultispanIndex.fstFrom (GlueData.diagram D.toGlueData) b))
(↑(Sigma.ι (GlueData.diagram D.toGlueData).left (i, j)) y)))
(↑(sigmaIsoSigma D.U).hom
(↑(Sigma.desc fun b =>
MultispanIndex.snd (GlueData.diagram D.toGlueData) b ≫
Sigma.ι (GlueData.diagram D.toGlueData).right (MultispanIndex.sndFrom (GlueData.diagram D.toGlueData) b))
(↑(Sigma.ι (GlueData.diagram D.toGlueData).left (i, j)) y)))
[PROOFSTEP]
rw [← comp_apply, colimit.ι_desc, ← comp_apply, colimit.ι_desc]
[GOAL]
case mp.Rel.mk.mk
D : GlueData
i✝ j✝ : D.J
x✝ : ↑(GlueData.U D.toGlueData i✝)
y✝ : ↑(GlueData.U D.toGlueData j✝)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y✝
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
i j : D.J
y : ↑(GlueData.V D.toGlueData (i, j))
⊢ Rel D
(↑(sigmaIsoSigma D.U).hom
(↑(NatTrans.app
(Cofan.mk (∐ (GlueData.diagram D.toGlueData).right) fun b =>
MultispanIndex.fst (GlueData.diagram D.toGlueData) b ≫
Sigma.ι (GlueData.diagram D.toGlueData).right
(MultispanIndex.fstFrom (GlueData.diagram D.toGlueData) b)).ι
{ as := (i, j) })
y))
(↑(sigmaIsoSigma D.U).hom
(↑(NatTrans.app
(Cofan.mk (∐ (GlueData.diagram D.toGlueData).right) fun b =>
MultispanIndex.snd (GlueData.diagram D.toGlueData) b ≫
Sigma.ι (GlueData.diagram D.toGlueData).right
(MultispanIndex.sndFrom (GlueData.diagram D.toGlueData) b)).ι
{ as := (i, j) })
y))
[PROOFSTEP]
erw [sigmaIsoSigma_hom_ι_apply, sigmaIsoSigma_hom_ι_apply]
[GOAL]
case mp.Rel.mk.mk
D : GlueData
i✝ j✝ : D.J
x✝ : ↑(GlueData.U D.toGlueData i✝)
y✝ : ↑(GlueData.U D.toGlueData j✝)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y✝
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
i j : D.J
y : ↑(GlueData.V D.toGlueData (i, j))
⊢ Rel D
{ fst := MultispanIndex.fstFrom (GlueData.diagram D.toGlueData) { as := (i, j) }.as,
snd := ↑(MultispanIndex.fst (GlueData.diagram D.toGlueData) { as := (i, j) }.as) y }
{ fst := MultispanIndex.sndFrom (GlueData.diagram D.toGlueData) { as := (i, j) }.as,
snd := ↑(MultispanIndex.snd (GlueData.diagram D.toGlueData) { as := (i, j) }.as) y }
[PROOFSTEP]
exact Or.inr ⟨y, by dsimp [GlueData.diagram]; simp only [true_and]; rfl⟩
[GOAL]
D : GlueData
i✝ j✝ : D.J
x✝ : ↑(GlueData.U D.toGlueData i✝)
y✝ : ↑(GlueData.U D.toGlueData j✝)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y✝
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
i j : D.J
y : ↑(GlueData.V D.toGlueData (i, j))
⊢ ↑(GlueData.f D.toGlueData
{ fst := MultispanIndex.fstFrom (GlueData.diagram D.toGlueData) { as := (i, j) }.as,
snd := ↑(MultispanIndex.fst (GlueData.diagram D.toGlueData) { as := (i, j) }.as) y }.fst
{ fst := MultispanIndex.sndFrom (GlueData.diagram D.toGlueData) { as := (i, j) }.as,
snd := ↑(MultispanIndex.snd (GlueData.diagram D.toGlueData) { as := (i, j) }.as) y }.fst)
y =
{ fst := MultispanIndex.fstFrom (GlueData.diagram D.toGlueData) { as := (i, j) }.as,
snd := ↑(MultispanIndex.fst (GlueData.diagram D.toGlueData) { as := (i, j) }.as) y }.snd ∧
↑(GlueData.f D.toGlueData
{ fst := MultispanIndex.sndFrom (GlueData.diagram D.toGlueData) { as := (i, j) }.as,
snd := ↑(MultispanIndex.snd (GlueData.diagram D.toGlueData) { as := (i, j) }.as) y }.fst
{ fst := MultispanIndex.fstFrom (GlueData.diagram D.toGlueData) { as := (i, j) }.as,
snd := ↑(MultispanIndex.fst (GlueData.diagram D.toGlueData) { as := (i, j) }.as) y }.fst)
(↑(GlueData.t D.toGlueData
{ fst := MultispanIndex.fstFrom (GlueData.diagram D.toGlueData) { as := (i, j) }.as,
snd := ↑(MultispanIndex.fst (GlueData.diagram D.toGlueData) { as := (i, j) }.as) y }.fst
{ fst := MultispanIndex.sndFrom (GlueData.diagram D.toGlueData) { as := (i, j) }.as,
snd := ↑(MultispanIndex.snd (GlueData.diagram D.toGlueData) { as := (i, j) }.as) y }.fst)
y) =
{ fst := MultispanIndex.sndFrom (GlueData.diagram D.toGlueData) { as := (i, j) }.as,
snd := ↑(MultispanIndex.snd (GlueData.diagram D.toGlueData) { as := (i, j) }.as) y }.snd
[PROOFSTEP]
dsimp [GlueData.diagram]
[GOAL]
D : GlueData
i✝ j✝ : D.J
x✝ : ↑(GlueData.U D.toGlueData i✝)
y✝ : ↑(GlueData.U D.toGlueData j✝)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y✝
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
i j : D.J
y : ↑(GlueData.V D.toGlueData (i, j))
⊢ ↑(GlueData.f D.toGlueData i j) y = ↑(GlueData.f D.toGlueData i j) y ∧
↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) y) =
↑(GlueData.t D.toGlueData i j ≫ GlueData.f D.toGlueData j i) y
[PROOFSTEP]
simp only [true_and]
[GOAL]
D : GlueData
i✝ j✝ : D.J
x✝ : ↑(GlueData.U D.toGlueData i✝)
y✝ : ↑(GlueData.U D.toGlueData j✝)
h :
↑(Sigma.ι (GlueData.diagram D.toGlueData).right i✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) x✝ =
↑(Sigma.ι (GlueData.diagram D.toGlueData).right j✝ ≫ Multicoequalizer.sigmaπ (GlueData.diagram D.toGlueData)) y✝
x : ↑(∐ (GlueData.diagram D.toGlueData).left)
i j : D.J
y : ↑(GlueData.V D.toGlueData (i, j))
⊢ ↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) y) =
↑(GlueData.t D.toGlueData i j ≫ GlueData.f D.toGlueData j i) y
[PROOFSTEP]
rfl
[GOAL]
case mpr
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
⊢ Rel D { fst := i, snd := x } { fst := j, snd := y } → ↑(GlueData.ι D.toGlueData i) x = ↑(GlueData.ι D.toGlueData j) y
[PROOFSTEP]
rintro (⟨⟨⟩⟩ | ⟨z, e₁, e₂⟩)
[GOAL]
case mpr.inl.refl
D : GlueData
i : D.J
x : ↑(GlueData.U D.toGlueData i)
⊢ ↑(GlueData.ι D.toGlueData i) x = ↑(GlueData.ι D.toGlueData i) x
case mpr.inr.intro.intro
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
z : ↑(GlueData.V D.toGlueData ({ fst := i, snd := x }.fst, { fst := j, snd := y }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := x }.fst { fst := j, snd := y }.fst) z = { fst := i, snd := x }.snd
e₂ :
↑(GlueData.f D.toGlueData { fst := j, snd := y }.fst { fst := i, snd := x }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := x }.fst { fst := j, snd := y }.fst) z) =
{ fst := j, snd := y }.snd
⊢ ↑(GlueData.ι D.toGlueData i) x = ↑(GlueData.ι D.toGlueData j) y
[PROOFSTEP]
rfl
[GOAL]
case mpr.inr.intro.intro
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
z : ↑(GlueData.V D.toGlueData ({ fst := i, snd := x }.fst, { fst := j, snd := y }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := x }.fst { fst := j, snd := y }.fst) z = { fst := i, snd := x }.snd
e₂ :
↑(GlueData.f D.toGlueData { fst := j, snd := y }.fst { fst := i, snd := x }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := x }.fst { fst := j, snd := y }.fst) z) =
{ fst := j, snd := y }.snd
⊢ ↑(GlueData.ι D.toGlueData i) x = ↑(GlueData.ι D.toGlueData j) y
[PROOFSTEP]
dsimp only at *
-- porting note: there were `subst e₁` and `subst e₂`, instead of the `rw`
[GOAL]
case mpr.inr.intro.intro
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
z : ↑(GlueData.V D.toGlueData ({ fst := i, snd := x }.fst, { fst := j, snd := y }.fst))
e₁ : ↑(GlueData.f D.toGlueData i j) z = x
e₂ : ↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) z) = y
⊢ ↑(GlueData.ι D.toGlueData i) x = ↑(GlueData.ι D.toGlueData j) y
[PROOFSTEP]
rw [← e₁, ← e₂] at *
[GOAL]
case mpr.inr.intro.intro
D : GlueData
i j : D.J
x : ↑(GlueData.U D.toGlueData i)
y : ↑(GlueData.U D.toGlueData j)
z : ↑(GlueData.V D.toGlueData ({ fst := i, snd := x }.fst, { fst := j, snd := y }.fst))
e₁ : ↑(GlueData.f D.toGlueData i j) z = ↑(GlueData.f D.toGlueData i j) z
e₂ :
↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) z) =
↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) z)
⊢ ↑(GlueData.ι D.toGlueData i) (↑(GlueData.f D.toGlueData i j) z) =
↑(GlueData.ι D.toGlueData j) (↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) z))
[PROOFSTEP]
simp
[GOAL]
D : GlueData
i : D.J
⊢ Function.Injective ↑(GlueData.ι D.toGlueData i)
[PROOFSTEP]
intro x y h
[GOAL]
D : GlueData
i : D.J
x y : (forget TopCat).obj (GlueData.U D.toGlueData i)
h : ↑(GlueData.ι D.toGlueData i) x = ↑(GlueData.ι D.toGlueData i) y
⊢ x = y
[PROOFSTEP]
rcases(D.ι_eq_iff_rel _ _ _ _).mp h with (⟨⟨⟩⟩ | ⟨_, e₁, e₂⟩)
[GOAL]
case inl.refl
D : GlueData
i : D.J
x : (forget TopCat).obj (GlueData.U D.toGlueData i)
h : ↑(GlueData.ι D.toGlueData i) x = ↑(GlueData.ι D.toGlueData i) x
⊢ x = x
[PROOFSTEP]
rfl
[GOAL]
case inr.intro.intro
D : GlueData
i : D.J
x y : (forget TopCat).obj (GlueData.U D.toGlueData i)
h : ↑(GlueData.ι D.toGlueData i) x = ↑(GlueData.ι D.toGlueData i) y
w✝ : ↑(GlueData.V D.toGlueData ({ fst := i, snd := x }.fst, { fst := i, snd := y }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := x }.fst { fst := i, snd := y }.fst) w✝ = { fst := i, snd := x }.snd
e₂ :
↑(GlueData.f D.toGlueData { fst := i, snd := y }.fst { fst := i, snd := x }.fst)
(↑(GlueData.t D.toGlueData { fst := i, snd := x }.fst { fst := i, snd := y }.fst) w✝) =
{ fst := i, snd := y }.snd
⊢ x = y
[PROOFSTEP]
dsimp only at *
-- porting note: there were `cases e₁` and `cases e₂`, instead of the `rw`
[GOAL]
case inr.intro.intro
D : GlueData
i : D.J
x y : (forget TopCat).obj (GlueData.U D.toGlueData i)
h : ↑(GlueData.ι D.toGlueData i) x = ↑(GlueData.ι D.toGlueData i) y
w✝ : ↑(GlueData.V D.toGlueData ({ fst := i, snd := x }.fst, { fst := i, snd := y }.fst))
e₁ : ↑(GlueData.f D.toGlueData i i) w✝ = x
e₂ : ↑(GlueData.f D.toGlueData i i) (↑(GlueData.t D.toGlueData i i) w✝) = y
⊢ x = y
[PROOFSTEP]
rw [← e₁, ← e₂]
[GOAL]
case inr.intro.intro
D : GlueData
i : D.J
x y : (forget TopCat).obj (GlueData.U D.toGlueData i)
h : ↑(GlueData.ι D.toGlueData i) x = ↑(GlueData.ι D.toGlueData i) y
w✝ : ↑(GlueData.V D.toGlueData ({ fst := i, snd := x }.fst, { fst := i, snd := y }.fst))
e₁ : ↑(GlueData.f D.toGlueData i i) w✝ = x
e₂ : ↑(GlueData.f D.toGlueData i i) (↑(GlueData.t D.toGlueData i i) w✝) = y
⊢ ↑(GlueData.f D.toGlueData i i) w✝ = ↑(GlueData.f D.toGlueData i i) (↑(GlueData.t D.toGlueData i i) w✝)
[PROOFSTEP]
simp
[GOAL]
D : GlueData
i j : D.J
⊢ Set.range ↑(GlueData.ι D.toGlueData i) ∩ Set.range ↑(GlueData.ι D.toGlueData j) =
Set.range ↑(GlueData.f D.toGlueData i j ≫ GlueData.ι D.toGlueData i)
[PROOFSTEP]
ext x
[GOAL]
case h
D : GlueData
i j : D.J
x : (forget TopCat).obj (GlueData.glued D.toGlueData)
⊢ x ∈ Set.range ↑(GlueData.ι D.toGlueData i) ∩ Set.range ↑(GlueData.ι D.toGlueData j) ↔
x ∈ Set.range ↑(GlueData.f D.toGlueData i j ≫ GlueData.ι D.toGlueData i)
[PROOFSTEP]
constructor
[GOAL]
case h.mp
D : GlueData
i j : D.J
x : (forget TopCat).obj (GlueData.glued D.toGlueData)
⊢ x ∈ Set.range ↑(GlueData.ι D.toGlueData i) ∩ Set.range ↑(GlueData.ι D.toGlueData j) →
x ∈ Set.range ↑(GlueData.f D.toGlueData i j ≫ GlueData.ι D.toGlueData i)
[PROOFSTEP]
rintro ⟨⟨x₁, eq₁⟩, ⟨x₂, eq₂⟩⟩
[GOAL]
case h.mp.intro.intro.intro
D : GlueData
i j : D.J
x : (forget TopCat).obj (GlueData.glued D.toGlueData)
x₁ : (forget TopCat).obj (GlueData.U D.toGlueData i)
eq₁ : ↑(GlueData.ι D.toGlueData i) x₁ = x
x₂ : (forget TopCat).obj (GlueData.U D.toGlueData j)
eq₂ : ↑(GlueData.ι D.toGlueData j) x₂ = x
⊢ x ∈ Set.range ↑(GlueData.f D.toGlueData i j ≫ GlueData.ι D.toGlueData i)
[PROOFSTEP]
obtain ⟨⟨⟩⟩ | ⟨y, e₁, -⟩ := (D.ι_eq_iff_rel _ _ _ _).mp (eq₁.trans eq₂.symm)
[GOAL]
case h.mp.intro.intro.intro.inl.refl
D : GlueData
i : D.J
x : (forget TopCat).obj (GlueData.glued D.toGlueData)
x₁ : (forget TopCat).obj (GlueData.U D.toGlueData i)
eq₁ eq₂ : ↑(GlueData.ι D.toGlueData i) x₁ = x
⊢ x ∈ Set.range ↑(GlueData.f D.toGlueData i i ≫ GlueData.ι D.toGlueData i)
[PROOFSTEP]
exact
⟨inv (D.f i i) x₁, by
-- Porting note: was `simp [eq₁]`
-- See https://github.com/leanprover-community/mathlib4/issues/5026
rw [TopCat.comp_app]
erw [CategoryTheory.IsIso.inv_hom_id_apply]
rw [eq₁]⟩
[GOAL]
D : GlueData
i : D.J
x : (forget TopCat).obj (GlueData.glued D.toGlueData)
x₁ : (forget TopCat).obj (GlueData.U D.toGlueData i)
eq₁ eq₂ : ↑(GlueData.ι D.toGlueData i) x₁ = x
⊢ ↑(GlueData.f D.toGlueData i i ≫ GlueData.ι D.toGlueData i) (↑(inv (GlueData.f D.toGlueData i i)) x₁) = x
[PROOFSTEP]
rw [TopCat.comp_app]
[GOAL]
D : GlueData
i : D.J
x : (forget TopCat).obj (GlueData.glued D.toGlueData)
x₁ : (forget TopCat).obj (GlueData.U D.toGlueData i)
eq₁ eq₂ : ↑(GlueData.ι D.toGlueData i) x₁ = x
⊢ ↑(GlueData.ι D.toGlueData i) (↑(GlueData.f D.toGlueData i i) (↑(inv (GlueData.f D.toGlueData i i)) x₁)) = x
[PROOFSTEP]
erw [CategoryTheory.IsIso.inv_hom_id_apply]
[GOAL]
D : GlueData
i : D.J
x : (forget TopCat).obj (GlueData.glued D.toGlueData)
x₁ : (forget TopCat).obj (GlueData.U D.toGlueData i)
eq₁ eq₂ : ↑(GlueData.ι D.toGlueData i) x₁ = x
⊢ ↑(GlueData.ι D.toGlueData i) x₁ = x
[PROOFSTEP]
rw [eq₁]
[GOAL]
case h.mp.intro.intro.intro.inr.intro.intro
D : GlueData
i j : D.J
x : (forget TopCat).obj (GlueData.glued D.toGlueData)
x₁ : (forget TopCat).obj (GlueData.U D.toGlueData i)
eq₁ : ↑(GlueData.ι D.toGlueData i) x₁ = x
x₂ : (forget TopCat).obj (GlueData.U D.toGlueData j)
eq₂ : ↑(GlueData.ι D.toGlueData j) x₂ = x
y : ↑(GlueData.V D.toGlueData ({ fst := i, snd := x₁ }.fst, { fst := j, snd := x₂ }.fst))
e₁ : ↑(GlueData.f D.toGlueData { fst := i, snd := x₁ }.fst { fst := j, snd := x₂ }.fst) y = { fst := i, snd := x₁ }.snd
⊢ x ∈ Set.range ↑(GlueData.f D.toGlueData i j ≫ GlueData.ι D.toGlueData i)
[PROOFSTEP]
dsimp only at *
[GOAL]
case h.mp.intro.intro.intro.inr.intro.intro
D : GlueData
i j : D.J
x : (forget TopCat).obj (GlueData.glued D.toGlueData)
x₁ : (forget TopCat).obj (GlueData.U D.toGlueData i)
eq₁ : ↑(GlueData.ι D.toGlueData i) x₁ = x
x₂ : (forget TopCat).obj (GlueData.U D.toGlueData j)
eq₂ : ↑(GlueData.ι D.toGlueData j) x₂ = x
y : ↑(GlueData.V D.toGlueData ({ fst := i, snd := x₁ }.fst, { fst := j, snd := x₂ }.fst))
e₁ : ↑(GlueData.f D.toGlueData i j) y = x₁
⊢ x ∈ Set.range ↑(GlueData.f D.toGlueData i j ≫ GlueData.ι D.toGlueData i)
[PROOFSTEP]
substs eq₁
[GOAL]
case h.mp.intro.intro.intro.inr.intro.intro
D : GlueData
i j : D.J
x₁ : (forget TopCat).obj (GlueData.U D.toGlueData i)
x₂ : (forget TopCat).obj (GlueData.U D.toGlueData j)
y : ↑(GlueData.V D.toGlueData ({ fst := i, snd := x₁ }.fst, { fst := j, snd := x₂ }.fst))
e₁ : ↑(GlueData.f D.toGlueData i j) y = x₁
eq₂ : ↑(GlueData.ι D.toGlueData j) x₂ = ↑(GlueData.ι D.toGlueData i) x₁
⊢ ↑(GlueData.ι D.toGlueData i) x₁ ∈ Set.range ↑(GlueData.f D.toGlueData i j ≫ GlueData.ι D.toGlueData i)
[PROOFSTEP]
exact ⟨y, by simp [e₁]⟩
[GOAL]
D : GlueData
i j : D.J
x₁ : (forget TopCat).obj (GlueData.U D.toGlueData i)
x₂ : (forget TopCat).obj (GlueData.U D.toGlueData j)
y : ↑(GlueData.V D.toGlueData ({ fst := i, snd := x₁ }.fst, { fst := j, snd := x₂ }.fst))
e₁ : ↑(GlueData.f D.toGlueData i j) y = x₁
eq₂ : ↑(GlueData.ι D.toGlueData j) x₂ = ↑(GlueData.ι D.toGlueData i) x₁
⊢ ↑(GlueData.f D.toGlueData i j ≫ GlueData.ι D.toGlueData i) y = ↑(GlueData.ι D.toGlueData i) x₁
[PROOFSTEP]
simp [e₁]
[GOAL]
case h.mpr
D : GlueData
i j : D.J
x : (forget TopCat).obj (GlueData.glued D.toGlueData)
⊢ x ∈ Set.range ↑(GlueData.f D.toGlueData i j ≫ GlueData.ι D.toGlueData i) →
x ∈ Set.range ↑(GlueData.ι D.toGlueData i) ∩ Set.range ↑(GlueData.ι D.toGlueData j)
[PROOFSTEP]
rintro ⟨x, hx⟩
[GOAL]
case h.mpr.intro
D : GlueData
i j : D.J
x✝ : (forget TopCat).obj (GlueData.glued D.toGlueData)
x : (forget TopCat).obj (GlueData.V D.toGlueData (i, j))
hx : ↑(GlueData.f D.toGlueData i j ≫ GlueData.ι D.toGlueData i) x = x✝
⊢ x✝ ∈ Set.range ↑(GlueData.ι D.toGlueData i) ∩ Set.range ↑(GlueData.ι D.toGlueData j)
[PROOFSTEP]
exact ⟨⟨D.f i j x, hx⟩, ⟨D.f j i (D.t _ _ x), by simp [← hx]⟩⟩
[GOAL]
D : GlueData
i j : D.J
x✝ : (forget TopCat).obj (GlueData.glued D.toGlueData)
x : (forget TopCat).obj (GlueData.V D.toGlueData (i, j))
hx : ↑(GlueData.f D.toGlueData i j ≫ GlueData.ι D.toGlueData i) x = x✝
⊢ ↑(GlueData.ι D.toGlueData j) (↑(GlueData.f D.toGlueData j i) (↑(GlueData.t D.toGlueData i j) x)) = x✝
[PROOFSTEP]
simp [← hx]
[GOAL]
D : GlueData
i j : D.J
⊢ ↑(GlueData.ι D.toGlueData j) ⁻¹' Set.range ↑(GlueData.ι D.toGlueData i) = Set.range ↑(GlueData.f D.toGlueData j i)
[PROOFSTEP]
rw [← Set.preimage_image_eq (Set.range (D.f j i)) (D.ι_injective j), ← Set.image_univ, ← Set.image_univ, ←
Set.image_comp, ← coe_comp, Set.image_univ, Set.image_univ, ← image_inter, Set.preimage_range_inter]
[GOAL]
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
⊢ ↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U) =
↑(GlueData.f D.toGlueData j i) '' (↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' U)
[PROOFSTEP]
have : D.f _ _ ⁻¹' (𝖣.ι j ⁻¹' (𝖣.ι i '' U)) = (D.t j i ≫ D.f _ _) ⁻¹' U :=
by
ext x
conv_rhs => rw [← Set.preimage_image_eq U (D.ι_injective _)]
generalize 𝖣.ι i '' U = U'
simp
[GOAL]
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
⊢ ↑(GlueData.f D.toGlueData j i) ⁻¹' (↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U)) =
↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' U
[PROOFSTEP]
ext x
[GOAL]
case h
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
x : (forget TopCat).obj (GlueData.V D.toGlueData (j, i))
⊢ x ∈ ↑(GlueData.f D.toGlueData j i) ⁻¹' (↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U)) ↔
x ∈ ↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' U
[PROOFSTEP]
conv_rhs => rw [← Set.preimage_image_eq U (D.ι_injective _)]
[GOAL]
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
x : (forget TopCat).obj (GlueData.V D.toGlueData (j, i))
| x ∈ ↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' U
[PROOFSTEP]
rw [← Set.preimage_image_eq U (D.ι_injective _)]
[GOAL]
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
x : (forget TopCat).obj (GlueData.V D.toGlueData (j, i))
| x ∈ ↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' U
[PROOFSTEP]
rw [← Set.preimage_image_eq U (D.ι_injective _)]
[GOAL]
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
x : (forget TopCat).obj (GlueData.V D.toGlueData (j, i))
| x ∈ ↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' U
[PROOFSTEP]
rw [← Set.preimage_image_eq U (D.ι_injective _)]
[GOAL]
case h
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
x : (forget TopCat).obj (GlueData.V D.toGlueData (j, i))
⊢ x ∈ ↑(GlueData.f D.toGlueData j i) ⁻¹' (↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U)) ↔
x ∈
↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹'
(↑(GlueData.ι D.toGlueData i) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U))
[PROOFSTEP]
generalize 𝖣.ι i '' U = U'
[GOAL]
case h
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
x : (forget TopCat).obj (GlueData.V D.toGlueData (j, i))
U' : Set ((forget TopCat).obj (GlueData.glued D.toGlueData))
⊢ x ∈ ↑(GlueData.f D.toGlueData j i) ⁻¹' (↑(GlueData.ι D.toGlueData j) ⁻¹' U') ↔
x ∈ ↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' (↑(GlueData.ι D.toGlueData i) ⁻¹' U')
[PROOFSTEP]
simp
[GOAL]
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
this :
↑(GlueData.f D.toGlueData j i) ⁻¹' (↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U)) =
↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' U
⊢ ↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U) =
↑(GlueData.f D.toGlueData j i) '' (↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' U)
[PROOFSTEP]
rw [← this, Set.image_preimage_eq_inter_range]
[GOAL]
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
this :
↑(GlueData.f D.toGlueData j i) ⁻¹' (↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U)) =
↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' U
⊢ ↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U) =
↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U) ∩ Set.range ↑(GlueData.f D.toGlueData j i)
[PROOFSTEP]
symm
[GOAL]
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
this :
↑(GlueData.f D.toGlueData j i) ⁻¹' (↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U)) =
↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' U
⊢ ↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U) ∩ Set.range ↑(GlueData.f D.toGlueData j i) =
↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U)
[PROOFSTEP]
apply Set.inter_eq_self_of_subset_left
[GOAL]
case a
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
this :
↑(GlueData.f D.toGlueData j i) ⁻¹' (↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U)) =
↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' U
⊢ ↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U) ⊆ Set.range ↑(GlueData.f D.toGlueData j i)
[PROOFSTEP]
rw [← D.preimage_range i j]
[GOAL]
case a
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
this :
↑(GlueData.f D.toGlueData j i) ⁻¹' (↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U)) =
↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' U
⊢ ↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U) ⊆
↑(GlueData.ι D.toGlueData j) ⁻¹' Set.range ↑(GlueData.ι D.toGlueData i)
[PROOFSTEP]
exact Set.preimage_mono (Set.image_subset_range _ _)
[GOAL]
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
⊢ ↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' U) =
↑(GlueData.t D.toGlueData i j ≫ GlueData.f D.toGlueData j i) '' (↑(GlueData.f D.toGlueData i j) ⁻¹' U)
[PROOFSTEP]
convert D.preimage_image_eq_image i j U using 1
[GOAL]
case h.e'_3
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
⊢ ↑(GlueData.t D.toGlueData i j ≫ GlueData.f D.toGlueData j i) '' (↑(GlueData.f D.toGlueData i j) ⁻¹' U) =
↑(GlueData.f D.toGlueData j i) '' (↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' U)
[PROOFSTEP]
rw [coe_comp, coe_comp]
-- porting note: `show` was not needed, since `rw [← Set.image_image]` worked.
[GOAL]
case h.e'_3
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
⊢ ↑(GlueData.f D.toGlueData j i) ∘ ↑(GlueData.t D.toGlueData i j) '' (↑(GlueData.f D.toGlueData i j) ⁻¹' U) =
↑(GlueData.f D.toGlueData j i) '' (↑(GlueData.f D.toGlueData i j) ∘ ↑(GlueData.t D.toGlueData j i) ⁻¹' U)
[PROOFSTEP]
show (fun x => ((forget TopCat).map _ ((forget TopCat).map _ x))) '' _ = _
[GOAL]
case h.e'_3
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
⊢ (fun x => (forget TopCat).map (GlueData.f D.toGlueData j i) ((forget TopCat).map (GlueData.t D.toGlueData i j) x)) ''
(↑(GlueData.f D.toGlueData i j) ⁻¹' U) =
↑(GlueData.f D.toGlueData j i) '' (↑(GlueData.f D.toGlueData i j) ∘ ↑(GlueData.t D.toGlueData j i) ⁻¹' U)
[PROOFSTEP]
rw [← Set.image_image]
-- porting note: `congr 1` was here, instead of `congr_arg`, however, it did nothing.
[GOAL]
case h.e'_3
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
⊢ (forget TopCat).map (GlueData.f D.toGlueData j i) ''
((fun x => (forget TopCat).map (GlueData.t D.toGlueData i j) x) '' (↑(GlueData.f D.toGlueData i j) ⁻¹' U)) =
↑(GlueData.f D.toGlueData j i) '' (↑(GlueData.f D.toGlueData i j) ∘ ↑(GlueData.t D.toGlueData j i) ⁻¹' U)
[PROOFSTEP]
refine congr_arg ?_ ?_
[GOAL]
case h.e'_3
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
⊢ (fun x => (forget TopCat).map (GlueData.t D.toGlueData i j) x) '' (↑(GlueData.f D.toGlueData i j) ⁻¹' U) =
↑(GlueData.f D.toGlueData i j) ∘ ↑(GlueData.t D.toGlueData j i) ⁻¹' U
[PROOFSTEP]
rw [← Set.eq_preimage_iff_image_eq, Set.preimage_preimage]
[GOAL]
case h.e'_3
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
⊢ ↑(GlueData.f D.toGlueData i j) ⁻¹' U =
(fun x =>
(↑(GlueData.f D.toGlueData i j) ∘ ↑(GlueData.t D.toGlueData j i))
((forget TopCat).map (GlueData.t D.toGlueData i j) x)) ⁻¹'
U
case h.e'_3.hf
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
⊢ Function.Bijective fun x => (forget TopCat).map (GlueData.t D.toGlueData i j) x
[PROOFSTEP]
change _ = (D.t i j ≫ D.t j i ≫ _) ⁻¹' _
[GOAL]
case h.e'_3
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
⊢ ↑(GlueData.f D.toGlueData i j) ⁻¹' U =
↑(GlueData.t D.toGlueData i j ≫ GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' U
case h.e'_3.hf
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
⊢ Function.Bijective fun x => (forget TopCat).map (GlueData.t D.toGlueData i j) x
[PROOFSTEP]
rw [𝖣.t_inv_assoc]
[GOAL]
case h.e'_3.hf
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
⊢ Function.Bijective fun x => (forget TopCat).map (GlueData.t D.toGlueData i j) x
[PROOFSTEP]
rw [← isIso_iff_bijective]
[GOAL]
case h.e'_3.hf
D : GlueData
i j : D.J
U : Set ↑(GlueData.U D.toGlueData i)
⊢ IsIso fun x => (forget TopCat).map (GlueData.t D.toGlueData i j) x
[PROOFSTEP]
apply (forget TopCat).map_isIso
[GOAL]
D : GlueData
i : D.J
U : Opens ↑(GlueData.U D.toGlueData i)
⊢ IsOpen (↑(GlueData.ι D.toGlueData i) '' ↑U)
[PROOFSTEP]
rw [isOpen_iff]
[GOAL]
D : GlueData
i : D.J
U : Opens ↑(GlueData.U D.toGlueData i)
⊢ ∀ (i_1 : D.J), IsOpen (↑(GlueData.ι D.toGlueData i_1) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' ↑U))
[PROOFSTEP]
intro j
[GOAL]
D : GlueData
i : D.J
U : Opens ↑(GlueData.U D.toGlueData i)
j : D.J
⊢ IsOpen (↑(GlueData.ι D.toGlueData j) ⁻¹' (↑(GlueData.ι D.toGlueData i) '' ↑U))
[PROOFSTEP]
rw [preimage_image_eq_image]
[GOAL]
D : GlueData
i : D.J
U : Opens ↑(GlueData.U D.toGlueData i)
j : D.J
⊢ IsOpen (↑(GlueData.f D.toGlueData j i) '' (↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' ↑U))
[PROOFSTEP]
apply (D.f_open _ _).isOpenMap
[GOAL]
case a
D : GlueData
i : D.J
U : Opens ↑(GlueData.U D.toGlueData i)
j : D.J
⊢ IsOpen (↑(GlueData.t D.toGlueData j i ≫ GlueData.f D.toGlueData i j) ⁻¹' ↑U)
[PROOFSTEP]
apply (D.t j i ≫ D.f i j).continuous_toFun.isOpen_preimage
[GOAL]
case a.a
D : GlueData
i : D.J
U : Opens ↑(GlueData.U D.toGlueData i)
j : D.J
⊢ IsOpen ↑U
[PROOFSTEP]
exact U.isOpen
[GOAL]
D : GlueData
h : MkCore
i j : h.J
x : { x // x ∈ V h j i }
⊢ ↑(t h i j) (↑(t h j i) x) = x
[PROOFSTEP]
have := h.cocycle j i j x ?_
[GOAL]
case refine_2
D : GlueData
h : MkCore
i j : h.J
x : { x // x ∈ V h j i }
this :
↑(↑(t h i j) { val := ↑(↑(t h j i) x), property := (_ : ↑(↑(t h j i) x) ∈ V h i j) }) =
↑(↑(t h j j) { val := ↑x, property := ?refine_1 })
⊢ ↑(t h i j) (↑(t h j i) x) = x
case refine_1 D : GlueData h : MkCore i j : h.J x : { x // x ∈ V h j i } ⊢ ↑x ∈ V h j j
[PROOFSTEP]
rw [h.t_id] at this
[GOAL]
case refine_2
D : GlueData
h : MkCore
i j : h.J
x : { x // x ∈ V h j i }
this :
↑(↑(t h i j) { val := ↑(↑(t h j i) x), property := (_ : ↑(↑(t h j i) x) ∈ V h i j) }) =
↑(id { val := ↑x, property := ?refine_1 })
⊢ ↑(t h i j) (↑(t h j i) x) = x
case refine_1
D : GlueData
h : MkCore
i j : h.J
x : { x // x ∈ V h j i }
⊢ ↑x ∈ V h j j
case refine_1 D : GlueData h : MkCore i j : h.J x : { x // x ∈ V h j i } ⊢ ↑x ∈ V h j j
[PROOFSTEP]
convert Subtype.eq this
[GOAL]
case refine_1
D : GlueData
h : MkCore
i j : h.J
x : { x // x ∈ V h j i }
⊢ ↑x ∈ V h j j
case refine_1
D : GlueData
h : MkCore
i j : h.J
x : { x // x ∈ V h j i }
⊢ ↑x ∈ V h j j
case refine_1 D : GlueData h : MkCore i j : h.J x : { x // x ∈ V h j i } ⊢ ↑x ∈ V h j j
[PROOFSTEP]
rw [h.V_id]
[GOAL]
case refine_1
D : GlueData
h : MkCore
i j : h.J
x : { x // x ∈ V h j i }
⊢ ↑x ∈ ⊤
[PROOFSTEP]
trivial
[GOAL]
D : GlueData
h : MkCore
i j : h.J
⊢ IsIso (MkCore.t h i j)
[PROOFSTEP]
use h.t j i
[GOAL]
case h
D : GlueData
h : MkCore
i j : h.J
⊢ MkCore.t h i j ≫ MkCore.t h j i = 𝟙 ((Opens.toTopCat (MkCore.U h i)).obj (MkCore.V h i j)) ∧
MkCore.t h j i ≫ MkCore.t h i j = 𝟙 ((Opens.toTopCat (MkCore.U h j)).obj (MkCore.V h j i))
[PROOFSTEP]
constructor
[GOAL]
case h.left
D : GlueData
h : MkCore
i j : h.J
⊢ MkCore.t h i j ≫ MkCore.t h j i = 𝟙 ((Opens.toTopCat (MkCore.U h i)).obj (MkCore.V h i j))
[PROOFSTEP]
ext1
[GOAL]
case h.right
D : GlueData
h : MkCore
i j : h.J
⊢ MkCore.t h j i ≫ MkCore.t h i j = 𝟙 ((Opens.toTopCat (MkCore.U h j)).obj (MkCore.V h j i))
[PROOFSTEP]
ext1
[GOAL]
case h.left.w
D : GlueData
h : MkCore
i j : h.J
x✝ : (forget TopCat).obj ((Opens.toTopCat (MkCore.U h i)).obj (MkCore.V h i j))
⊢ ↑(MkCore.t h i j ≫ MkCore.t h j i) x✝ = ↑(𝟙 ((Opens.toTopCat (MkCore.U h i)).obj (MkCore.V h i j))) x✝
case h.right.w
D : GlueData
h : MkCore
i j : h.J
x✝ : (forget TopCat).obj ((Opens.toTopCat (MkCore.U h j)).obj (MkCore.V h j i))
⊢ ↑(MkCore.t h j i ≫ MkCore.t h i j) x✝ = ↑(𝟙 ((Opens.toTopCat (MkCore.U h j)).obj (MkCore.V h j i))) x✝
[PROOFSTEP]
exacts [h.t_inv _ _ _, h.t_inv _ _ _]
[GOAL]
D : GlueData
h : MkCore
i j k : h.J
⊢ pullback (Opens.inclusion (V h i j)) (Opens.inclusion (V h i k)) ⟶
pullback (Opens.inclusion (V h j k)) (Opens.inclusion (V h j i))
[PROOFSTEP]
refine' (pullbackIsoProdSubtype _ _).hom ≫ ⟨_, _⟩ ≫ (pullbackIsoProdSubtype _ _).inv
[GOAL]
case refine'_1
D : GlueData
h : MkCore
i j k : h.J
⊢ ↑(of { p // ↑(Opens.inclusion (V h i j)) p.fst = ↑(Opens.inclusion (V h i k)) p.snd }) →
↑(of { p // ↑(Opens.inclusion (V h j k)) p.fst = ↑(Opens.inclusion (V h j i)) p.snd })
[PROOFSTEP]
intro x
[GOAL]
case refine'_1
D : GlueData
h : MkCore
i j k : h.J
x : ↑(of { p // ↑(Opens.inclusion (V h i j)) p.fst = ↑(Opens.inclusion (V h i k)) p.snd })
⊢ ↑(of { p // ↑(Opens.inclusion (V h j k)) p.fst = ↑(Opens.inclusion (V h j i)) p.snd })
[PROOFSTEP]
refine' ⟨⟨⟨(h.t i j x.1.1).1, _⟩, h.t i j x.1.1⟩, rfl⟩
[GOAL]
case refine'_1
D : GlueData
h : MkCore
i j k : h.J
x : ↑(of { p // ↑(Opens.inclusion (V h i j)) p.fst = ↑(Opens.inclusion (V h i k)) p.snd })
⊢ ↑(↑(t h i j) (↑x).fst) ∈ V h j k
[PROOFSTEP]
rcases x with ⟨⟨⟨x, hx⟩, ⟨x', hx'⟩⟩, rfl : x = x'⟩
[GOAL]
case refine'_1.mk.mk.mk.mk
D : GlueData
h : MkCore
i j k : h.J
x : ↑(U h i)
hx : x ∈ V h i j
hx' : x ∈ V h i k
⊢ ↑(↑(t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }), property := (_ : x = x) }).fst) ∈
V h j k
[PROOFSTEP]
exact h.t_inter _ ⟨x, hx⟩ hx'
[GOAL]
case refine'_2
D : GlueData
h : MkCore
i j k : h.J
⊢ Continuous fun x =>
{
val :=
({ val := ↑(↑(t h i j) (↑x).fst), property := (_ : ↑(↑(t h i j) (↑x).fst) ∈ V h j k) }, ↑(t h i j) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (V h j k))
({ val := ↑(↑(t h i j) (↑x).fst), property := (_ : ↑(↑(t h i j) (↑x).fst) ∈ V h j k) },
↑(t h i j) (↑x).fst).fst =
↑(Opens.inclusion (V h j k))
({ val := ↑(↑(t h i j) (↑x).fst), property := (_ : ↑(↑(t h i j) (↑x).fst) ∈ V h j k) },
↑(t h i j) (↑x).fst).fst) }
[PROOFSTEP]
have : Continuous (h.t i j) := map_continuous (self := ContinuousMap.toContinuousMapClass) _
[GOAL]
case refine'_2
D : GlueData
h : MkCore
i j k : h.J
this : Continuous ↑(t h i j)
⊢ Continuous fun x =>
{
val :=
({ val := ↑(↑(t h i j) (↑x).fst), property := (_ : ↑(↑(t h i j) (↑x).fst) ∈ V h j k) }, ↑(t h i j) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (V h j k))
({ val := ↑(↑(t h i j) (↑x).fst), property := (_ : ↑(↑(t h i j) (↑x).fst) ∈ V h j k) },
↑(t h i j) (↑x).fst).fst =
↑(Opens.inclusion (V h j k))
({ val := ↑(↑(t h i j) (↑x).fst), property := (_ : ↑(↑(t h i j) (↑x).fst) ∈ V h j k) },
↑(t h i j) (↑x).fst).fst) }
[PROOFSTEP]
exact ((Continuous.subtype_mk (by continuity) _).prod_mk (by continuity)).subtype_mk _
[GOAL]
D : GlueData
h : MkCore
i j k : h.J
this : Continuous ↑(t h i j)
⊢ Continuous fun x => ↑(↑(t h i j) (↑x).fst)
[PROOFSTEP]
continuity
[GOAL]
D : GlueData
h : MkCore
i j k : h.J
this : Continuous ↑(t h i j)
⊢ Continuous fun x => ↑(t h i j) (↑x).fst
[PROOFSTEP]
continuity
[GOAL]
D : GlueData
h : MkCore
i : h.J
⊢ IsIso ((fun i j => Opens.inclusion (MkCore.V h i j)) i i)
[PROOFSTEP]
dsimp only
[GOAL]
D : GlueData
h : MkCore
i : h.J
⊢ IsIso (Opens.inclusion (MkCore.V h i i))
[PROOFSTEP]
exact (h.V_id i).symm ▸ IsIso.of_iso (Opens.inclusionTopIso (h.U i))
[GOAL]
D : GlueData
h : MkCore
i : h.J
⊢ MkCore.t h i i = 𝟙 ((fun i => (Opens.toTopCat (MkCore.U h i.fst)).obj (MkCore.V h i.fst i.snd)) (i, i))
[PROOFSTEP]
ext
[GOAL]
case w
D : GlueData
h : MkCore
i : h.J
x✝ : (forget TopCat).obj ((Opens.toTopCat (MkCore.U h i)).obj (MkCore.V h i i))
⊢ ↑(MkCore.t h i i) x✝ = ↑(𝟙 ((fun i => (Opens.toTopCat (MkCore.U h i.fst)).obj (MkCore.V h i.fst i.snd)) (i, i))) x✝
[PROOFSTEP]
rw [h.t_id]
[GOAL]
case w
D : GlueData
h : MkCore
i : h.J
x✝ : (forget TopCat).obj ((Opens.toTopCat (MkCore.U h i)).obj (MkCore.V h i i))
⊢ id x✝ = ↑(𝟙 ((fun i => (Opens.toTopCat (MkCore.U h i.fst)).obj (MkCore.V h i.fst i.snd)) (i, i))) x✝
[PROOFSTEP]
rfl
[GOAL]
D : GlueData
h : MkCore
i j k : h.J
⊢ MkCore.t' h i j k ≫ pullback.snd = pullback.fst ≫ MkCore.t h i j
[PROOFSTEP]
delta MkCore.t'
[GOAL]
D : GlueData
h : MkCore
i j k : h.J
⊢ ((pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h i j)) (Opens.inclusion (MkCore.V h i k))).hom ≫
(ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst) }) ≫
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h j k)) (Opens.inclusion (MkCore.V h j i))).inv) ≫
pullback.snd =
pullback.fst ≫ MkCore.t h i j
[PROOFSTEP]
rw [Category.assoc, Category.assoc, pullbackIsoProdSubtype_inv_snd, ← Iso.eq_inv_comp,
pullbackIsoProdSubtype_inv_fst_assoc]
[GOAL]
D : GlueData
h : MkCore
i j k : h.J
⊢ (ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h i j) (↑x).fst), property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst) }) ≫
pullbackSnd (Opens.inclusion (MkCore.V h j k)) (Opens.inclusion (MkCore.V h j i)) =
pullbackFst (Opens.inclusion (MkCore.V h i j)) (Opens.inclusion (MkCore.V h i k)) ≫ MkCore.t h i j
[PROOFSTEP]
ext ⟨⟨⟨x, hx⟩, ⟨x', hx'⟩⟩, rfl : x = x'⟩
[GOAL]
case w.mk.mk.mk.mk
D : GlueData
h : MkCore
i j k : h.J
x : ↑(MkCore.U h i)
hx : x ∈ MkCore.V h i j
hx' : x ∈ MkCore.V h i k
⊢ ↑((ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst) }) ≫
pullbackSnd (Opens.inclusion (MkCore.V h j k)) (Opens.inclusion (MkCore.V h j i)))
{ val := ({ val := x, property := hx }, { val := x, property := hx' }), property := (_ : x = x) } =
↑(pullbackFst (Opens.inclusion (MkCore.V h i j)) (Opens.inclusion (MkCore.V h i k)) ≫ MkCore.t h i j)
{ val := ({ val := x, property := hx }, { val := x, property := hx' }), property := (_ : x = x) }
[PROOFSTEP]
rfl
[GOAL]
D : GlueData
h : MkCore
i j k : h.J
⊢ MkCore.t' h i j k ≫ MkCore.t' h j k i ≫ MkCore.t' h k i j =
𝟙 (pullback ((fun i j => Opens.inclusion (MkCore.V h i j)) i j) ((fun i j => Opens.inclusion (MkCore.V h i j)) i k))
[PROOFSTEP]
delta MkCore.t'
[GOAL]
D : GlueData
h : MkCore
i j k : h.J
⊢ ((pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h i j)) (Opens.inclusion (MkCore.V h i k))).hom ≫
(ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst) }) ≫
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h j k)) (Opens.inclusion (MkCore.V h j i))).inv) ≫
((pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h j k)) (Opens.inclusion (MkCore.V h j i))).hom ≫
(ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst) }) ≫
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h k i)) (Opens.inclusion (MkCore.V h k j))).inv) ≫
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h k i)) (Opens.inclusion (MkCore.V h k j))).hom ≫
(ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h i j))
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h i j))
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst).fst) }) ≫
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h i j)) (Opens.inclusion (MkCore.V h i k))).inv =
𝟙 (pullback ((fun i j => Opens.inclusion (MkCore.V h i j)) i j) ((fun i j => Opens.inclusion (MkCore.V h i j)) i k))
[PROOFSTEP]
simp_rw [← Category.assoc]
[GOAL]
D : GlueData
h : MkCore
i j k : h.J
⊢ ((((((((pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h i j)) (Opens.inclusion (MkCore.V h i k))).hom ≫
ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst) }) ≫
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h j k)) (Opens.inclusion (MkCore.V h j i))).inv) ≫
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h j k)) (Opens.inclusion (MkCore.V h j i))).hom) ≫
ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst) }) ≫
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h k i)) (Opens.inclusion (MkCore.V h k j))).inv) ≫
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h k i)) (Opens.inclusion (MkCore.V h k j))).hom) ≫
ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h i j))
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h i j))
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst).fst) }) ≫
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h i j)) (Opens.inclusion (MkCore.V h i k))).inv =
𝟙 (pullback (Opens.inclusion (MkCore.V h i j)) (Opens.inclusion (MkCore.V h i k)))
[PROOFSTEP]
rw [Iso.comp_inv_eq]
[GOAL]
D : GlueData
h : MkCore
i j k : h.J
⊢ ((((((((pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h i j)) (Opens.inclusion (MkCore.V h i k))).hom ≫
ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst) }) ≫
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h j k)) (Opens.inclusion (MkCore.V h j i))).inv) ≫
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h j k)) (Opens.inclusion (MkCore.V h j i))).hom) ≫
ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst) }) ≫
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h k i)) (Opens.inclusion (MkCore.V h k j))).inv) ≫
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h k i)) (Opens.inclusion (MkCore.V h k j))).hom) ≫
ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h k i) (↑x).fst), property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h i j))
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h i j))
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst).fst) }) =
𝟙 (pullback (Opens.inclusion (MkCore.V h i j)) (Opens.inclusion (MkCore.V h i k))) ≫
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h i j)) (Opens.inclusion (MkCore.V h i k))).hom
[PROOFSTEP]
simp only [Iso.inv_hom_id_assoc, Category.assoc, Category.id_comp]
[GOAL]
D : GlueData
h : MkCore
i j k : h.J
⊢ ((pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h i j)) (Opens.inclusion (MkCore.V h i k))).hom ≫
(ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst) }) ≫
(ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst) }) ≫
ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h i j))
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h i j))
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst).fst) }) =
(pullbackIsoProdSubtype (Opens.inclusion (MkCore.V h i j)) (Opens.inclusion (MkCore.V h i k))).hom
[PROOFSTEP]
rw [← Iso.eq_inv_comp, Iso.inv_hom_id]
[GOAL]
D : GlueData
h : MkCore
i j k : h.J
⊢ ((ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h i j) (↑x).fst), property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst) }) ≫
(ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst) }) ≫
ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h i j))
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h i j))
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst).fst) }) =
𝟙 (of { p // ↑(Opens.inclusion (MkCore.V h i j)) p.fst = ↑(Opens.inclusion (MkCore.V h i k)) p.snd })
[PROOFSTEP]
ext1 ⟨⟨⟨x, hx⟩, ⟨x', hx'⟩⟩, rfl : x = x'⟩
[GOAL]
case w.mk.mk.mk.mk
D : GlueData
h : MkCore
i j k : h.J
x : ↑(MkCore.U h i)
hx : x ∈ MkCore.V h i j
hx' : x ∈ MkCore.V h i k
⊢ ↑((ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h j k))
({ val := ↑(↑(MkCore.t h i j) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h i j) (↑x).fst) ∈ MkCore.V h j k) },
↑(MkCore.t h i j) (↑x).fst).fst) }) ≫
(ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst) }) ≫
ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h i j))
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h i j))
({ val := ↑(↑(MkCore.t h k i) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h k i) (↑x).fst) ∈ MkCore.V h i j) },
↑(MkCore.t h k i) (↑x).fst).fst) })
{ val := ({ val := x, property := hx }, { val := x, property := hx' }), property := (_ : x = x) } =
↑(𝟙 (of { p // ↑(Opens.inclusion (MkCore.V h i j)) p.fst = ↑(Opens.inclusion (MkCore.V h i k)) p.snd }))
{ val := ({ val := x, property := hx }, { val := x, property := hx' }), property := (_ : x = x) }
[PROOFSTEP]
rw [comp_app, ContinuousMap.coe_mk, comp_app, id_app, ContinuousMap.coe_mk, Subtype.mk_eq_mk, Prod.mk.inj_iff,
Subtype.mk_eq_mk, Subtype.ext_iff, and_self_iff]
[GOAL]
case w.mk.mk.mk.mk
D : GlueData
h : MkCore
i j k : h.J
x : ↑(MkCore.U h i)
hx : x ∈ MkCore.V h i j
hx' : x ∈ MkCore.V h i k
⊢ ↑(↑(MkCore.t h k i)
(↑(↑(ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst) })
{
val :=
({
val :=
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst),
property :=
(_ :
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst) ∈
MkCore.V h j k) },
↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h j k))
({
val :=
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst),
property :=
(_ :
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst) ∈
MkCore.V h j k) },
↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst).fst =
↑(Opens.inclusion (MkCore.V h j k))
({
val :=
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst),
property :=
(_ :
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst) ∈
MkCore.V h j k) },
↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst).fst) })).fst) =
x
[PROOFSTEP]
convert congr_arg Subtype.val (h.t_inv k i ⟨x, hx'⟩) using 3
[GOAL]
case h.e'_2.h.e'_3.h.e'_6
D : GlueData
h : MkCore
i j k : h.J
x : ↑(MkCore.U h i)
hx : x ∈ MkCore.V h i j
hx' : x ∈ MkCore.V h i k
⊢ (↑(↑(ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst) })
{
val :=
({
val :=
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst),
property :=
(_ :
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst) ∈
MkCore.V h j k) },
↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h j k))
({
val :=
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst),
property :=
(_ :
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst) ∈
MkCore.V h j k) },
↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst).fst =
↑(Opens.inclusion (MkCore.V h j k))
({
val :=
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst),
property :=
(_ :
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst) ∈
MkCore.V h j k) },
↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst).fst) })).fst =
↑(MkCore.t h i k) { val := x, property := hx' }
[PROOFSTEP]
refine Subtype.ext ?_
[GOAL]
case h.e'_2.h.e'_3.h.e'_6
D : GlueData
h : MkCore
i j k : h.J
x : ↑(MkCore.U h i)
hx : x ∈ MkCore.V h i j
hx' : x ∈ MkCore.V h i k
⊢ ↑(↑(↑(ContinuousMap.mk fun x =>
{
val :=
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst =
↑(Opens.inclusion (MkCore.V h k i))
({ val := ↑(↑(MkCore.t h j k) (↑x).fst),
property := (_ : ↑(↑(MkCore.t h j k) (↑x).fst) ∈ MkCore.V h k i) },
↑(MkCore.t h j k) (↑x).fst).fst) })
{
val :=
({
val :=
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst),
property :=
(_ :
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst) ∈
MkCore.V h j k) },
↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst),
property :=
(_ :
↑(Opens.inclusion (MkCore.V h j k))
({
val :=
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst),
property :=
(_ :
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst) ∈
MkCore.V h j k) },
↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst).fst =
↑(Opens.inclusion (MkCore.V h j k))
({
val :=
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst),
property :=
(_ :
↑(↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst) ∈
MkCore.V h j k) },
↑(MkCore.t h i j)
(↑{ val := ({ val := x, property := hx }, { val := x, property := hx' }),
property := (_ : x = x) }).fst).fst) })).fst =
↑(↑(MkCore.t h i k) { val := x, property := hx' })
[PROOFSTEP]
exact h.cocycle i j k ⟨x, hx⟩ hx'
[GOAL]
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i j : J
⊢ Continuous fun x =>
{ val := { val := ↑↑x, property := (_ : ↑x ∈ (fun i j => (Opens.map (Opens.inclusion (U i))).obj (U j)) i j) },
property := (_ : ↑↑x ∈ U i) }
[PROOFSTEP]
refine Continuous.subtype_mk ?_ ?_
[GOAL]
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i j : J
⊢ Continuous fun x =>
{ val := ↑↑x, property := (_ : ↑x ∈ (fun i j => (Opens.map (Opens.inclusion (U i))).obj (U j)) i j) }
[PROOFSTEP]
refine Continuous.subtype_mk ?_ ?_
[GOAL]
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i j : J
⊢ Continuous fun x => ↑↑x
[PROOFSTEP]
continuity
[GOAL]
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i : J
⊢ (fun i j => (Opens.map (Opens.inclusion (U i))).obj (U j)) i i = ⊤
[PROOFSTEP]
ext
-- porting note: no longer needed `cases U i`!
[GOAL]
case h.h
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i : J
x✝ : ↑((Opens.toTopCat (of α)).obj (U i))
⊢ x✝ ∈ ↑((fun i j => (Opens.map (Opens.inclusion (U i))).obj (U j)) i i) ↔ x✝ ∈ ↑⊤
[PROOFSTEP]
simp
[GOAL]
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i : J
⊢ ↑((fun i j =>
ContinuousMap.mk fun x =>
{
val :=
{ val := ↑↑x, property := (_ : ↑x ∈ (fun i j => (Opens.map (Opens.inclusion (U i))).obj (U j)) i j) },
property := (_ : ↑↑x ∈ U i) })
i i) =
id
[PROOFSTEP]
ext
[GOAL]
case h
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i : J
x✝ :
(forget TopCat).obj
((Opens.toTopCat ((fun i => (Opens.toTopCat (of α)).obj (U i)) i)).obj
((fun i j => (Opens.map (Opens.inclusion (U i))).obj (U j)) i i))
⊢ ↑((fun i j =>
ContinuousMap.mk fun x =>
{
val :=
{ val := ↑↑x, property := (_ : ↑x ∈ (fun i j => (Opens.map (Opens.inclusion (U i))).obj (U j)) i j) },
property := (_ : ↑↑x ∈ U i) })
i i)
x✝ =
id x✝
[PROOFSTEP]
rfl
[GOAL]
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
⊢ ∀ (a : (GlueData.diagram (ofOpenSubsets U).toGlueData).L),
MultispanIndex.fst (GlueData.diagram (ofOpenSubsets U).toGlueData) a ≫
(fun x => Opens.inclusion (U x)) (MultispanIndex.fstFrom (GlueData.diagram (ofOpenSubsets U).toGlueData) a) =
MultispanIndex.snd (GlueData.diagram (ofOpenSubsets U).toGlueData) a ≫
(fun x => Opens.inclusion (U x)) (MultispanIndex.sndFrom (GlueData.diagram (ofOpenSubsets U).toGlueData) a)
[PROOFSTEP]
rintro ⟨i, j⟩
[GOAL]
case mk
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i j : (ofOpenSubsets U).toGlueData.J
⊢ MultispanIndex.fst (GlueData.diagram (ofOpenSubsets U).toGlueData) (i, j) ≫
(fun x => Opens.inclusion (U x)) (MultispanIndex.fstFrom (GlueData.diagram (ofOpenSubsets U).toGlueData) (i, j)) =
MultispanIndex.snd (GlueData.diagram (ofOpenSubsets U).toGlueData) (i, j) ≫
(fun x => Opens.inclusion (U x)) (MultispanIndex.sndFrom (GlueData.diagram (ofOpenSubsets U).toGlueData) (i, j))
[PROOFSTEP]
ext x
[GOAL]
case mk.w
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i j : (ofOpenSubsets U).toGlueData.J
x : (forget TopCat).obj (MultispanIndex.left (GlueData.diagram (ofOpenSubsets U).toGlueData) (i, j))
⊢ ↑(MultispanIndex.fst (GlueData.diagram (ofOpenSubsets U).toGlueData) (i, j) ≫
(fun x => Opens.inclusion (U x))
(MultispanIndex.fstFrom (GlueData.diagram (ofOpenSubsets U).toGlueData) (i, j)))
x =
↑(MultispanIndex.snd (GlueData.diagram (ofOpenSubsets U).toGlueData) (i, j) ≫
(fun x => Opens.inclusion (U x))
(MultispanIndex.sndFrom (GlueData.diagram (ofOpenSubsets U).toGlueData) (i, j)))
x
[PROOFSTEP]
rfl
[GOAL]
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
⊢ Function.Injective ↑(fromOpenSubsetsGlue U)
[PROOFSTEP]
intro x y e
[GOAL]
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
x y : (forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData)
e : ↑(fromOpenSubsetsGlue U) x = ↑(fromOpenSubsetsGlue U) y
⊢ x = y
[PROOFSTEP]
obtain ⟨i, ⟨x, hx⟩, rfl⟩ := (ofOpenSubsets U).ι_jointly_surjective x
[GOAL]
case intro.intro.mk
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
y : (forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData)
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx : x ∈ U i
e :
↑(fromOpenSubsetsGlue U) (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx }) =
↑(fromOpenSubsetsGlue U) y
⊢ ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx } = y
[PROOFSTEP]
obtain ⟨j, ⟨y, hy⟩, rfl⟩ := (ofOpenSubsets U).ι_jointly_surjective y
[GOAL]
case intro.intro.mk.intro.intro.mk
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx : x ∈ U i
j : (ofOpenSubsets U).toGlueData.J
y : ↑(of α)
hy : y ∈ U j
e :
↑(fromOpenSubsetsGlue U) (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx }) =
↑(fromOpenSubsetsGlue U) (↑(GlueData.ι (ofOpenSubsets U).toGlueData j) { val := y, property := hy })
⊢ ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx } =
↑(GlueData.ι (ofOpenSubsets U).toGlueData j) { val := y, property := hy }
[PROOFSTEP]
erw [ι_fromOpenSubsetsGlue_apply, ι_fromOpenSubsetsGlue_apply] at e
[GOAL]
case intro.intro.mk.intro.intro.mk
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx : x ∈ U i
j : (ofOpenSubsets U).toGlueData.J
y : ↑(of α)
hy : y ∈ U j
e : ↑(Opens.inclusion (U i)) { val := x, property := hx } = ↑(Opens.inclusion (U j)) { val := y, property := hy }
⊢ ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx } =
↑(GlueData.ι (ofOpenSubsets U).toGlueData j) { val := y, property := hy }
[PROOFSTEP]
change x = y at e
[GOAL]
case intro.intro.mk.intro.intro.mk
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx : x ∈ U i
j : (ofOpenSubsets U).toGlueData.J
y : ↑(of α)
hy : y ∈ U j
e : x = y
⊢ ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx } =
↑(GlueData.ι (ofOpenSubsets U).toGlueData j) { val := y, property := hy }
[PROOFSTEP]
subst e
[GOAL]
case intro.intro.mk.intro.intro.mk
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx : x ∈ U i
j : (ofOpenSubsets U).toGlueData.J
hy : x ∈ U j
⊢ ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx } =
↑(GlueData.ι (ofOpenSubsets U).toGlueData j) { val := x, property := hy }
[PROOFSTEP]
rw [(ofOpenSubsets U).ι_eq_iff_rel]
[GOAL]
case intro.intro.mk.intro.intro.mk
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx : x ∈ U i
j : (ofOpenSubsets U).toGlueData.J
hy : x ∈ U j
⊢ Rel (ofOpenSubsets U) { fst := i, snd := { val := x, property := hx } }
{ fst := j, snd := { val := x, property := hy } }
[PROOFSTEP]
right
[GOAL]
case intro.intro.mk.intro.intro.mk.h
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx : x ∈ U i
j : (ofOpenSubsets U).toGlueData.J
hy : x ∈ U j
⊢ ∃ x_1,
↑(GlueData.f (ofOpenSubsets U).toGlueData { fst := i, snd := { val := x, property := hx } }.fst
{ fst := j, snd := { val := x, property := hy } }.fst)
x_1 =
{ fst := i, snd := { val := x, property := hx } }.snd ∧
↑(GlueData.f (ofOpenSubsets U).toGlueData { fst := j, snd := { val := x, property := hy } }.fst
{ fst := i, snd := { val := x, property := hx } }.fst)
(↑(GlueData.t (ofOpenSubsets U).toGlueData { fst := i, snd := { val := x, property := hx } }.fst
{ fst := j, snd := { val := x, property := hy } }.fst)
x_1) =
{ fst := j, snd := { val := x, property := hy } }.snd
[PROOFSTEP]
exact ⟨⟨⟨x, hx⟩, hy⟩, rfl, rfl⟩
[GOAL]
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
⊢ IsOpenMap ↑(fromOpenSubsetsGlue U)
[PROOFSTEP]
intro s hs
[GOAL]
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : IsOpen s
⊢ IsOpen (↑(fromOpenSubsetsGlue U) '' s)
[PROOFSTEP]
rw [(ofOpenSubsets U).isOpen_iff] at hs
[GOAL]
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : ∀ (i : (ofOpenSubsets U).toGlueData.J), IsOpen (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s)
⊢ IsOpen (↑(fromOpenSubsetsGlue U) '' s)
[PROOFSTEP]
rw [isOpen_iff_forall_mem_open]
[GOAL]
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : ∀ (i : (ofOpenSubsets U).toGlueData.J), IsOpen (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s)
⊢ ∀ (x : (forget TopCat).obj (of α)),
x ∈ ↑(fromOpenSubsetsGlue U) '' s → ∃ t, t ⊆ ↑(fromOpenSubsetsGlue U) '' s ∧ IsOpen t ∧ x ∈ t
[PROOFSTEP]
rintro _ ⟨x, hx, rfl⟩
[GOAL]
case intro.intro
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : ∀ (i : (ofOpenSubsets U).toGlueData.J), IsOpen (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s)
x : (forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData)
hx : x ∈ s
⊢ ∃ t, t ⊆ ↑(fromOpenSubsetsGlue U) '' s ∧ IsOpen t ∧ ↑(fromOpenSubsetsGlue U) x ∈ t
[PROOFSTEP]
obtain ⟨i, ⟨x, hx'⟩, rfl⟩ := (ofOpenSubsets U).ι_jointly_surjective x
[GOAL]
case intro.intro.intro.intro.mk
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : ∀ (i : (ofOpenSubsets U).toGlueData.J), IsOpen (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s)
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx' : x ∈ U i
hx : ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' } ∈ s
⊢ ∃ t,
t ⊆ ↑(fromOpenSubsetsGlue U) '' s ∧
IsOpen t ∧
↑(fromOpenSubsetsGlue U) (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' }) ∈ t
[PROOFSTEP]
use fromOpenSubsetsGlue U '' s ∩ Set.range (@Opens.inclusion (TopCat.of α) (U i))
[GOAL]
case h
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : ∀ (i : (ofOpenSubsets U).toGlueData.J), IsOpen (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s)
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx' : x ∈ U i
hx : ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' } ∈ s
⊢ ↑(fromOpenSubsetsGlue U) '' s ∩ Set.range ↑(Opens.inclusion (U i)) ⊆ ↑(fromOpenSubsetsGlue U) '' s ∧
IsOpen (↑(fromOpenSubsetsGlue U) '' s ∩ Set.range ↑(Opens.inclusion (U i))) ∧
↑(fromOpenSubsetsGlue U) (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' }) ∈
↑(fromOpenSubsetsGlue U) '' s ∩ Set.range ↑(Opens.inclusion (U i))
[PROOFSTEP]
use Set.inter_subset_left _ _
[GOAL]
case right
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : ∀ (i : (ofOpenSubsets U).toGlueData.J), IsOpen (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s)
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx' : x ∈ U i
hx : ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' } ∈ s
⊢ IsOpen (↑(fromOpenSubsetsGlue U) '' s ∩ Set.range ↑(Opens.inclusion (U i))) ∧
↑(fromOpenSubsetsGlue U) (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' }) ∈
↑(fromOpenSubsetsGlue U) '' s ∩ Set.range ↑(Opens.inclusion (U i))
[PROOFSTEP]
constructor
[GOAL]
case right.left
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : ∀ (i : (ofOpenSubsets U).toGlueData.J), IsOpen (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s)
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx' : x ∈ U i
hx : ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' } ∈ s
⊢ IsOpen (↑(fromOpenSubsetsGlue U) '' s ∩ Set.range ↑(Opens.inclusion (U i)))
[PROOFSTEP]
erw [← Set.image_preimage_eq_inter_range]
[GOAL]
case right.left
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : ∀ (i : (ofOpenSubsets U).toGlueData.J), IsOpen (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s)
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx' : x ∈ U i
hx : ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' } ∈ s
⊢ IsOpen (↑(Opens.inclusion (U i)) '' (↑(Opens.inclusion (U i)) ⁻¹' (↑(fromOpenSubsetsGlue U) '' s)))
[PROOFSTEP]
apply (Opens.openEmbedding (X := TopCat.of α) (U i)).isOpenMap
[GOAL]
case right.left.a
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : ∀ (i : (ofOpenSubsets U).toGlueData.J), IsOpen (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s)
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx' : x ∈ U i
hx : ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' } ∈ s
⊢ IsOpen (↑(Opens.inclusion (U i)) ⁻¹' (↑(fromOpenSubsetsGlue U) '' s))
[PROOFSTEP]
convert hs i using 1
[GOAL]
case h.e'_3.h
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : ∀ (i : (ofOpenSubsets U).toGlueData.J), IsOpen (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s)
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx' : x ∈ U i
hx : ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' } ∈ s
e_1✝ :
(forget TopCat).obj ((Opens.toTopCat (of α)).obj (U i)) =
(forget TopCat).obj (GlueData.U (ofOpenSubsets U).toGlueData i)
⊢ ↑(Opens.inclusion (U i)) ⁻¹' (↑(fromOpenSubsetsGlue U) '' s) = ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s
[PROOFSTEP]
erw [← ι_fromOpenSubsetsGlue, coe_comp, Set.preimage_comp]
-- porting note: `congr 1` did nothing, so I replaced it with `apply congr_arg`
[GOAL]
case h.e'_3.h
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : ∀ (i : (ofOpenSubsets U).toGlueData.J), IsOpen (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s)
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx' : x ∈ U i
hx : ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' } ∈ s
e_1✝ :
(forget TopCat).obj ((Opens.toTopCat (of α)).obj (U i)) =
(forget TopCat).obj (GlueData.U (ofOpenSubsets U).toGlueData i)
⊢ ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' (↑(fromOpenSubsetsGlue U) ⁻¹' (↑(fromOpenSubsetsGlue U) '' s)) =
↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s
[PROOFSTEP]
apply congr_arg
[GOAL]
case h.e'_3.h.h
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : ∀ (i : (ofOpenSubsets U).toGlueData.J), IsOpen (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s)
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx' : x ∈ U i
hx : ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' } ∈ s
e_1✝ :
(forget TopCat).obj ((Opens.toTopCat (of α)).obj (U i)) =
(forget TopCat).obj (GlueData.U (ofOpenSubsets U).toGlueData i)
⊢ ↑(fromOpenSubsetsGlue U) ⁻¹' (↑(fromOpenSubsetsGlue U) '' s) = s
[PROOFSTEP]
refine' Set.preimage_image_eq _ (fromOpenSubsetsGlue_injective U)
[GOAL]
case right.right
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : ∀ (i : (ofOpenSubsets U).toGlueData.J), IsOpen (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s)
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx' : x ∈ U i
hx : ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' } ∈ s
⊢ ↑(fromOpenSubsetsGlue U) (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' }) ∈
↑(fromOpenSubsetsGlue U) '' s ∩ Set.range ↑(Opens.inclusion (U i))
[PROOFSTEP]
refine'
⟨Set.mem_image_of_mem _ hx, _⟩
-- porting note: another `rw ↦ erw`
-- See above.
[GOAL]
case right.right
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : ∀ (i : (ofOpenSubsets U).toGlueData.J), IsOpen (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s)
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx' : x ∈ U i
hx : ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' } ∈ s
⊢ ↑(fromOpenSubsetsGlue U) (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' }) ∈
Set.range ↑(Opens.inclusion (U i))
[PROOFSTEP]
erw [ι_fromOpenSubsetsGlue_apply]
[GOAL]
case right.right
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
s : Set ((forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData))
hs : ∀ (i : (ofOpenSubsets U).toGlueData.J), IsOpen (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) ⁻¹' s)
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx' : x ∈ U i
hx : ↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' } ∈ s
⊢ ↑(Opens.inclusion (U i)) { val := x, property := hx' } ∈ Set.range ↑(Opens.inclusion (U i))
[PROOFSTEP]
exact Set.mem_range_self _
[GOAL]
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
⊢ Set.range ↑(fromOpenSubsetsGlue U) = ⋃ (i : J), ↑(U i)
[PROOFSTEP]
ext
[GOAL]
case h
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
x✝ : (forget TopCat).obj (of α)
⊢ x✝ ∈ Set.range ↑(fromOpenSubsetsGlue U) ↔ x✝ ∈ ⋃ (i : J), ↑(U i)
[PROOFSTEP]
constructor
[GOAL]
case h.mp
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
x✝ : (forget TopCat).obj (of α)
⊢ x✝ ∈ Set.range ↑(fromOpenSubsetsGlue U) → x✝ ∈ ⋃ (i : J), ↑(U i)
[PROOFSTEP]
rintro ⟨x, rfl⟩
[GOAL]
case h.mp.intro
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
x : (forget TopCat).obj (GlueData.glued (ofOpenSubsets U).toGlueData)
⊢ ↑(fromOpenSubsetsGlue U) x ∈ ⋃ (i : J), ↑(U i)
[PROOFSTEP]
obtain ⟨i, ⟨x, hx'⟩, rfl⟩ := (ofOpenSubsets U).ι_jointly_surjective x
[GOAL]
case h.mp.intro.intro.intro.mk
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx' : x ∈ U i
⊢ ↑(fromOpenSubsetsGlue U) (↑(GlueData.ι (ofOpenSubsets U).toGlueData i) { val := x, property := hx' }) ∈
⋃ (i : J), ↑(U i)
[PROOFSTEP]
erw [ι_fromOpenSubsetsGlue_apply]
[GOAL]
case h.mp.intro.intro.intro.mk
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
i : (ofOpenSubsets U).toGlueData.J
x : ↑(of α)
hx' : x ∈ U i
⊢ ↑(Opens.inclusion (U i)) { val := x, property := hx' } ∈ ⋃ (i : J), ↑(U i)
[PROOFSTEP]
exact Set.subset_iUnion _ i hx'
[GOAL]
case h.mpr
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
x✝ : (forget TopCat).obj (of α)
⊢ x✝ ∈ ⋃ (i : J), ↑(U i) → x✝ ∈ Set.range ↑(fromOpenSubsetsGlue U)
[PROOFSTEP]
rintro ⟨_, ⟨i, rfl⟩, hx⟩
[GOAL]
case h.mpr.intro.intro.intro
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
x✝ : (forget TopCat).obj (of α)
i : J
hx : x✝ ∈ (fun i => ↑(U i)) i
⊢ x✝ ∈ Set.range ↑(fromOpenSubsetsGlue U)
[PROOFSTEP]
rename_i x
[GOAL]
case h.mpr.intro.intro.intro
D : GlueData
α : Type u
inst✝ : TopologicalSpace α
J : Type u
U : J → Opens α
x : (forget TopCat).obj (of α)
i : J
hx : x ∈ (fun i => ↑(U i)) i
⊢ x ∈ Set.range ↑(fromOpenSubsetsGlue U)
[PROOFSTEP]
refine' ⟨(ofOpenSubsets U).toGlueData.ι i ⟨x, hx⟩, ι_fromOpenSubsetsGlue_apply _ _ _⟩
|
# 3. faza: Vizualizacija podatkov
library(ggplot2)
library(dplyr)
#10 držav z največjih številom umorjenih na 100000 prebivalcev
naslov.umorjeni <- "10 držav z najvišjo stopnjo umorjenih"
Encoding(naslov.umorjeni) <- "UTF-8"
graf.umorjeni.max <- ggplot(umorjeni2 %>% top_n(10, umorjeni) %>%
mutate(Drzava = reorder(Drzava, -umorjeni))) +
aes(x = Drzava, y = umorjeni, fill = Drzava) + geom_col() +
xlab("drzava") + ylab("stopnja") +
theme(axis.text.x = element_blank()) +
ggtitle(naslov.umorjeni)
#theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1)) +
graf.umorjeni.max <- ggplot(umorjeni2 %>% top_n(10, umorjeni) %>%
mutate(Drzava = reorder(Drzava, -umorjeni))) +
aes(x = Drzava, y = umorjeni, fill = Drzava) + geom_col() +
xlab("drzava") + ylab("stopnja") +
theme(axis.text.x = element_blank()) +
ggtitle(naslov.umorjeni)
#10 držav z najmanjšim številom umorjenih na 100000 prebivalcev
graf.umorjeni.min <- ggplot(umorjeni2[order(umorjeni2$umorjeni, decreasing=FALSE), ] %>% .[1:10, ]) +
aes(x = reorder(Drzava, umorjeni), y = umorjeni, fill = Drzava) + geom_col() +
xlab("Drzava") + ylab("Stopnja") +
theme(axis.text.x = element_blank()) +
ggtitle("10 drzav z najnizjo stopnjo umorjenih")
#theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1)) +
#10 držav z največjih številom zaprtih na 100000 prebivalcev
graf.zaprti.max <- ggplot(zaprti2[order(zaprti2$zaprti, decreasing=TRUE), ] %>% .[1:10, ]) +
aes(x = reorder(Drzava, -zaprti), y = zaprti, fill = Drzava) + geom_col() +
xlab("Drzava") + ylab("Stopnja") +
theme(axis.text.x = element_blank()) +
ggtitle("10 drzav z najvisjo stopnjo zaprtih")
#theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1)) +
#10 držav z najmanjšim številom zaprtih na 100000 prebivalcev
graf.zaprti.min <- ggplot(zaprti2[order(zaprti2$zaprti, decreasing=FALSE), ] %>% .[1:10, ]) +
aes(x = reorder(Drzava, zaprti), y = zaprti, fill = Drzava) + geom_col() +
xlab("Drzava") + ylab("Stopnja") +
theme(axis.text.x = element_blank()) +
ggtitle("10 drzav z najnizjo stopnjo zaprtih")
#theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1)) +
#povezava med številom umorjenih in zaprtih po svetu
graf.umorjeni.zaprti <- ggplot(data = zaprti_in_umorjeni)+
geom_point(aes(x = umorjeni, y = zaprti), stat = 'identity')+
geom_text(data = zaprti_in_umorjeni %>% filter(zaprti > 430 | umorjeni > 30),size = 3,
aes(x = umorjeni, y = zaprti, label=Drzava),vjust = 2, nudge_y = 0.5, check_overlap = TRUE)+
#geom_smooth(aes(x = umorjeni , y = zaprti), method = lm, na.rm = TRUE, color = "violet")+
ggtitle("Povezava med stopnjo umorjenih in zaprtih")+
xlab("stopnja umorjenih") + ylab("stopnja zaprtih")
#gibanje stevila brezposelnih in obsojenih v Sloveniji v obdobju 2006-2015
povprecna.stopnja <- brezposelnost_in_obsojeni %>% group_by(leto,meritev) %>% summarise(stopnja = round(mean(stopnja, na.rm=TRUE),digits = 2))
graf.gibanje <- ggplot(povprecna.stopnja) +
aes(x = leto, y = stopnja, colour = meritev) + geom_line()+
ggtitle("Gibanje kriminalitete in brezposelnosti v Sloveniji")
#povezava med številom brezposelnih in obsojenih v slovenskih občinah
graf.obsojeni.brezposelni <- ggplot(data = brezposelnost_in_obsojeni2 %>% filter(leto == 2016))+
geom_point(aes(x = brezposelni , y = obsojeni), na.rm = TRUE, stat = 'identity')+
geom_smooth(aes(x = brezposelni , y = obsojeni), method = lm, na.rm = TRUE, color = "lightseagreen")+
geom_text(data = brezposelnost_in_obsojeni2 %>% filter(leto == 2016 & (obsojeni > 6 | brezposelni > 20)),
aes(x = brezposelni, y = obsojeni, label=obcina),vjust = 3, nudge_y = 0.5, check_overlap = TRUE,na.rm = TRUE)+
ggtitle("Povezava med stopnjo brezposelnih in obsojenih v Sloveniji")+
ylab("stopnja obsojenih") + xlab("stopnja brezposelnih")
#gibanje števila kaznivih dejanj v Sloveniji
kazniva.dejanja <- c("KAZNIVA DEJANJA ZOPER URADNO DOLŽNOST IN JAVNA POOBLASTILA",
"KAZNIVA DEJANJA ZOPER OKOLJE, PROSTOR IN NARAVNE DOBRINE","KAZNIVA DEJANJA ZOPER ČAST IN DOBRO IME",
"KAZNIVA DEJANJA ZOPER SPLOŠNO VARNOST LJUDI IN PREMOŽENJA", "KAZNIVA DEJANJA ZOPER PRAVOSODJE")
Encoding(kazniva.dejanja) <- "UTF-8"
graf.kazniva <- ggplot(data = obsojeni_arhiv %>% group_by(kaznivo.dejanje,leto) %>% summarise(stevilo.obsojenih = sum(stevilo.obsojenih)) %>%
filter(leto > 2008) %>% filter (!kaznivo.dejanje %in% kazniva.dejanja))+
aes(x = leto, y = stevilo.obsojenih, colour = kaznivo.dejanje) + geom_line()+
ggtitle("Gibanje kaznivih dejanj v Sloveniji") + guides(fill=guide_legend(title="kaznivo dejanje")) +
ylab("stevilo obsojenih")
skupno <- obsojeni_arhiv %>% group_by(kaznivo.dejanje,leto) %>% summarise(stevilo.obsojenih = sum(stevilo.obsojenih))
#brez kaznivih dejanj proti premoženju
zoper.premozenje <- c("KAZNIVA DEJANJA ZOPER PREMOŽENJE")
kazniva.skupaj = c(kazniva.dejanja, zoper.premozenje)
Encoding(zoper.premozenje) <- "UTF-8"
Encoding(kazniva.skupaj) <- "UTF-8"
graf.kazniva2 <- ggplot(data = aggregate(stevilo.obsojenih ~ kaznivo.dejanje+leto,obsojeni_arhiv,sum) %>%
filter(leto > 2008) %>% filter (!kaznivo.dejanje %in% kazniva.skupaj))+
aes(x = leto, y = stevilo.obsojenih, colour = kaznivo.dejanje) + geom_line()+
ggtitle("Gibanje kaznivih dejanj v Sloveniji") +
ylab("stevilo obsojenih")
#graf sankcij glede na spol
graf.sankcije <- ggplot(data = aggregate(stevilo.obsojenih ~ sankcija+leto+spol,obsojeni_arhiv,sum) %>% filter (leto == 2011),
aes(x=sankcija, y=stevilo.obsojenih, fill = spol)) +
geom_bar(position="stack", stat="identity", colour="black")+
labs(title ="Stevilo obsojenih glede na sankcijo in spol")+
ylab("Stevilo obsojenih") + xlab("Sankcija")
naslov2 <- "Število obsojenih glede na spol"
Encoding(naslov2) <- "UTF-8"
#graf obsojenih glede na spol skozi leta
graf.spol <- ggplot(data = aggregate(stevilo.obsojenih ~ spol+leto,obsojeni_arhiv,sum) %>% filter (leto > 2008),
aes(x=leto, y=stevilo.obsojenih, fill = spol)) +
geom_bar(position="stack", stat="identity", colour="black")+
labs(title = naslov2)+
ylab("stevilo obsojenih")+xlab("leto")
#tortni diagram deležev sankcij
#kazni <- aggregate(stevilo.obsojenih ~ sankcija,obsojeni_arhiv,sum)
#torta.kazni <- pie(kazni$stevilo.obsojenih, labels = kazni$sankcija, main = "Povprecen delez sankcij")
naslov3 <- "Povprečen delež sankcij"
Encoding(naslov3) <- "UTF-8"
graf.delez.sankcij <- ggplot(data = aggregate(stevilo.obsojenih ~ sankcija,obsojeni_arhiv,sum),
aes(x="", y=stevilo.obsojenih, fill = sankcija)) +
geom_bar(width = 1, stat="identity", colour="black") + coord_polar("y", start=0)+
xlab("") + ylab("") + ggtitle(naslov3) + theme(axis.text.x=element_blank(), panel.grid=element_blank())
#theme_minimal()
# Uvozimo zemljevid zemljevid sveta
zemljevid <- uvozi.zemljevid("http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_countries.zip",
"ne_50m_admin_0_countries") %>% pretvori.zemljevid()
colnames(zemljevid)[11] <- 'drzava'
zemljevid$drzava <- as.character(zemljevid$drzava)
zemljevid$drzava[zemljevid$drzava == "Republic of Serbia"] <- "Serbia"
zemljevid$drzava[zemljevid$drzava == "Cabo Verde"] <- "Cape Verde"
zemljevid$drzava[zemljevid$drzava == "Czechia"] <- "Czech Republic"
zemljevid$drzava[zemljevid$drzava == "The Bahamas"] <- "Bahamas"
zemljevid$drzava[zemljevid$drzava == "United Republic of Tanzania"] <- "Tanzania"
zemljevid$drzava[zemljevid$drzava == "United States of America"] <- "United States"
zemljevid.umorjeni <- ggplot() +
geom_polygon(data = umorjeni2 %>% right_join(zemljevid, by = c("Drzava" = "drzava")),
aes(x = long, y = lat, group = group, fill = umorjeni), alpha = 0.8, color = "black")+
scale_fill_gradient2(low = "yellow", mid = "red", high = "brown", midpoint = 80) +
xlab("") + ylab("") + ggtitle("Stopnja umorjenih po svetu")+
guides(fill=guide_legend(title="Stopnja"))
zemljevid.zaprti <- ggplot() +
geom_polygon(data = zaprti2 %>% right_join(zemljevid, by = c("Drzava" = "drzava")),
aes(x = long, y = lat, group = group, fill = zaprti), color = "black")+
scale_fill_gradient2(low = "lightcyan", mid = "turquoise4",
high = "darkslategray", midpoint = 600, na.value = "gray") +
xlab("") + ylab("") + ggtitle("Stopnja zaprtih po svetu") +
guides(fill=guide_legend(title="Stopnja"))
#uvozimo zemljevid slovenskih občin
obcine <- uvozi.zemljevid("http://baza.fmf.uni-lj.si/OB.zip",
"OB/OB", encoding = "Windows-1250") %>% pretvori.zemljevid()
obcine$OB_UIME <- as.character(obcine$OB_UIME)
#zemljevid stopnje obsojenih
naslov.obcine <-"Stopnja obsojenih po slovenskih občinah"
Encoding(naslov.obcine) <- "UTF-8"
zemljevid.obsojeni <- ggplot() +
geom_polygon(data = left_join(obcine, obsojeni_po_obcinah2 %>% filter(leto == "2016"), by = c("OB_UIME" = "obcina")),
aes(x = long, y = lat, group = group, fill = obsojeni), color = "black")+
scale_fill_gradient2(low = "blanchedalmond", mid = "lightpink3",
high = "violetred", midpoint = 6 , na.value = "gray") +
xlab("") + ylab("") + ggtitle(naslov.obcine)
#ob <- unique(obcine$OB_UIME)
#OB <- unique(obsojeni_po_obcinah2$obcina) #podatki za 212 občin
|
# Looker API 4.0 (Beta) Reference
#
# Welcome to the future! API 4.0 co-exists with APIs 3.1 and 3.0. (3.0 should no longer be used.) The \"beta\" tag means updates for API 4.0 may include breaking changes, but as always we will work to minimize them. ### Authorization The classic method of API authorization uses Looker **API3** credentials for authorization and access control. Looker admins can create API3 credentials on Looker's **Admin/Users** page. API 4.0 adds additional ways to authenticate API requests, including OAuth and CORS requests. For details, see [Looker API Authorization](https://looker.com/docs/r/api/authorization). ### API Explorer The API Explorer is a Looker-provided utility with many new and unique features for learning and using the Looker API and SDKs. It is a replacement for the 'api-docs' page currently provided on Looker instances. For details, see the [API Explorer documentation](https://looker.com/docs/r/api/explorer). ### Looker Language SDKs The Looker API is a RESTful system that should be usable by any programming language capable of making HTTPS requests. SDKs for a variety of programming languages are also provided to streamline using the API. Looker has an OpenSource [sdk-codegen project](https://github.com/looker-open-source/sdk-codegen) that provides several language SDKs. Language SDKs generated by `sdk-codegen` have an Authentication manager that can automatically authenticate API requests when needed. For details on available Looker SDKs, see [Looker API Client SDKs](https://looker.com/docs/r/api/client_sdks). ### API Versioning Future releases of Looker expand the latest API version release-by-release to securely expose more and more of the core power of the Looker platform to API client applications. API endpoints marked as \"beta\" may receive breaking changes without warning (but we will try to avoid doing that). Stable (non-beta) API endpoints should not receive breaking changes in future releases. For details, see [Looker API Versioning](https://looker.com/docs/r/api/versioning). ### In This Release API 4.0 version was introduced so we can make adjustments to API functions, parameters, and response types to fix bugs and inconsistencies. These changes fall outside the bounds of non-breaking additive changes we can make to our stable API 3.1. One benefit of these type adjustments in API 4.0 is dramatically better support for strongly typed languages like TypeScript, Kotlin, Swift, Go, C#, and more. While API 3.1 is still the de-facto Looker API (\"current\", \"stable\", \"default\", etc), the bulk of our development activity has shifted to API 4.0, where all new features are added. The API Explorer can be used to [interactively compare](https://looker.com/docs/r/api/explorer#comparing_api_versions) the differences between API 3.1 and 4.0. ### API and SDK Support Policies Looker API versions and language SDKs have varying support levels. Please read the API and SDK [support policies](https://looker.com/docs/r/api/support-policy) for more information.
#
# OpenAPI spec version: 4.0.21.18
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#' EmbedSsoParams Class
#'
#' @field target_url
#' @field session_length
#' @field force_logout_login
#' @field external_user_id
#' @field first_name
#' @field last_name
#' @field user_timezone
#' @field permissions
#' @field models
#' @field group_ids
#' @field external_group_id
#' @field user_attributes
#' @field secret_id
#'
#' @importFrom R6 R6Class
#' @importFrom jsonlite parse_json toJSON
#' @export
EmbedSsoParams <- R6::R6Class(
'EmbedSsoParams',
public = list(
`target_url` = NULL,
`session_length` = NULL,
`force_logout_login` = NULL,
`external_user_id` = NULL,
`first_name` = NULL,
`last_name` = NULL,
`user_timezone` = NULL,
`permissions` = NULL,
`models` = NULL,
`group_ids` = NULL,
`external_group_id` = NULL,
`user_attributes` = NULL,
`secret_id` = NULL,
initialize = function(`target_url`, `session_length`, `force_logout_login`, `external_user_id`, `first_name`, `last_name`, `user_timezone`, `permissions`, `models`, `group_ids`, `external_group_id`, `user_attributes`, `secret_id`){
if (!missing(`target_url`)) {
stopifnot(is.character(`target_url`), length(`target_url`) == 1)
self$`target_url` <- `target_url`
}
if (!missing(`session_length`)) {
stopifnot(is.numeric(`session_length`), length(`session_length`) == 1)
self$`session_length` <- `session_length`
}
if (!missing(`force_logout_login`)) {
self$`force_logout_login` <- `force_logout_login`
}
if (!missing(`external_user_id`)) {
stopifnot(is.character(`external_user_id`), length(`external_user_id`) == 1)
self$`external_user_id` <- `external_user_id`
}
if (!missing(`first_name`)) {
stopifnot(is.character(`first_name`), length(`first_name`) == 1)
self$`first_name` <- `first_name`
}
if (!missing(`last_name`)) {
stopifnot(is.character(`last_name`), length(`last_name`) == 1)
self$`last_name` <- `last_name`
}
if (!missing(`user_timezone`)) {
stopifnot(is.character(`user_timezone`), length(`user_timezone`) == 1)
self$`user_timezone` <- `user_timezone`
}
if (!missing(`permissions`)) {
stopifnot(is.list(`permissions`), length(`permissions`) != 0)
lapply(`permissions`, function(x) stopifnot(is.character(x)))
self$`permissions` <- `permissions`
}
if (!missing(`models`)) {
stopifnot(is.list(`models`), length(`models`) != 0)
lapply(`models`, function(x) stopifnot(is.character(x)))
self$`models` <- `models`
}
if (!missing(`group_ids`)) {
stopifnot(is.list(`group_ids`), length(`group_ids`) != 0)
lapply(`group_ids`, function(x) stopifnot(is.character(x)))
self$`group_ids` <- `group_ids`
}
if (!missing(`external_group_id`)) {
stopifnot(is.character(`external_group_id`), length(`external_group_id`) == 1)
self$`external_group_id` <- `external_group_id`
}
if (!missing(`user_attributes`)) {
stopifnot(R6::is.R6(`user_attributes`))
self$`user_attributes` <- `user_attributes`
}
if (!missing(`secret_id`)) {
stopifnot(is.numeric(`secret_id`), length(`secret_id`) == 1)
self$`secret_id` <- `secret_id`
}
},
toJSON = function() {
EmbedSsoParamsObject <- list()
if (!is.null(self$`target_url`)) {
EmbedSsoParamsObject[['target_url']] <- self$`target_url`
}
if (!is.null(self$`session_length`)) {
EmbedSsoParamsObject[['session_length']] <- self$`session_length`
}
if (!is.null(self$`force_logout_login`)) {
EmbedSsoParamsObject[['force_logout_login']] <- self$`force_logout_login`
}
if (!is.null(self$`external_user_id`)) {
EmbedSsoParamsObject[['external_user_id']] <- self$`external_user_id`
}
if (!is.null(self$`first_name`)) {
EmbedSsoParamsObject[['first_name']] <- self$`first_name`
}
if (!is.null(self$`last_name`)) {
EmbedSsoParamsObject[['last_name']] <- self$`last_name`
}
if (!is.null(self$`user_timezone`)) {
EmbedSsoParamsObject[['user_timezone']] <- self$`user_timezone`
}
if (!is.null(self$`permissions`)) {
EmbedSsoParamsObject[['permissions']] <- self$`permissions`
}
if (!is.null(self$`models`)) {
EmbedSsoParamsObject[['models']] <- self$`models`
}
if (!is.null(self$`group_ids`)) {
EmbedSsoParamsObject[['group_ids']] <- self$`group_ids`
}
if (!is.null(self$`external_group_id`)) {
EmbedSsoParamsObject[['external_group_id']] <- self$`external_group_id`
}
if (!is.null(self$`user_attributes`)) {
EmbedSsoParamsObject[['user_attributes']] <- self$`user_attributes`$toJSON()
}
if (!is.null(self$`secret_id`)) {
EmbedSsoParamsObject[['secret_id']] <- self$`secret_id`
}
EmbedSsoParamsObject
},
fromJSONObject = function(EmbedSsoParamsJsonObject) {
EmbedSsoParamsObject <- EmbedSsoParamsJsonObject #jsonlite::fromJSON(EmbedSsoParamsJson, simplifyVector = FALSE)
if (!is.null(EmbedSsoParamsObject$`target_url`)) {
self$`target_url` <- EmbedSsoParamsObject$`target_url`
}
if (!is.null(EmbedSsoParamsObject$`session_length`)) {
self$`session_length` <- EmbedSsoParamsObject$`session_length`
}
if (!is.null(EmbedSsoParamsObject$`force_logout_login`)) {
self$`force_logout_login` <- EmbedSsoParamsObject$`force_logout_login`
}
if (!is.null(EmbedSsoParamsObject$`external_user_id`)) {
self$`external_user_id` <- EmbedSsoParamsObject$`external_user_id`
}
if (!is.null(EmbedSsoParamsObject$`first_name`)) {
self$`first_name` <- EmbedSsoParamsObject$`first_name`
}
if (!is.null(EmbedSsoParamsObject$`last_name`)) {
self$`last_name` <- EmbedSsoParamsObject$`last_name`
}
if (!is.null(EmbedSsoParamsObject$`user_timezone`)) {
self$`user_timezone` <- EmbedSsoParamsObject$`user_timezone`
}
if (!is.null(EmbedSsoParamsObject$`permissions`)) {
self$`permissions` <- EmbedSsoParamsObject$`permissions`
}
if (!is.null(EmbedSsoParamsObject$`models`)) {
self$`models` <- EmbedSsoParamsObject$`models`
}
if (!is.null(EmbedSsoParamsObject$`group_ids`)) {
self$`group_ids` <- EmbedSsoParamsObject$`group_ids`
}
if (!is.null(EmbedSsoParamsObject$`external_group_id`)) {
self$`external_group_id` <- EmbedSsoParamsObject$`external_group_id`
}
if (!is.null(EmbedSsoParamsObject$`user_attributes`)) {
user_attributesObject <- TODO_OBJECT_MAPPING$new()
user_attributesObject$fromJSON(jsonlite::toJSON(EmbedSsoParamsObject$user_attributes, auto_unbox = TRUE))
self$`user_attributes` <- user_attributesObject
}
if (!is.null(EmbedSsoParamsObject$`secret_id`)) {
self$`secret_id` <- EmbedSsoParamsObject$`secret_id`
}
},
fromJSON = function(EmbedSsoParamsJson) {
EmbedSsoParamsObject <- jsonlite::fromJSON(EmbedSsoParamsJson, simplifyVector = FALSE)
self$fromJSONObject(EmbedSsoParamsObject)
},
toJSONString = function() {
sprintf(
'{
"target_url": %s,
"session_length": %d,
"force_logout_login": %s,
"external_user_id": %s,
"first_name": %s,
"last_name": %s,
"user_timezone": %s,
"permissions": [%s],
"models": [%s],
"group_ids": [%s],
"external_group_id": %s,
"user_attributes": %s,
"secret_id": %d
}',
self$`target_url`,
self$`session_length`,
self$`force_logout_login`,
self$`external_user_id`,
self$`first_name`,
self$`last_name`,
self$`user_timezone`,
lapply(self$`permissions`, function(x) paste(paste0('"', x, '"'), sep=",")),
lapply(self$`models`, function(x) paste(paste0('"', x, '"'), sep=",")),
lapply(self$`group_ids`, function(x) paste(paste0('"', x, '"'), sep=",")),
self$`external_group_id`,
self$`user_attributes`$toJSON(),
self$`secret_id`
)
},
fromJSONString = function(EmbedSsoParamsJson) {
EmbedSsoParamsObject <- jsonlite::fromJSON(EmbedSsoParamsJson, simplifyVector = FALSE)
self$`target_url` <- EmbedSsoParamsObject$`target_url`
self$`session_length` <- EmbedSsoParamsObject$`session_length`
self$`force_logout_login` <- EmbedSsoParamsObject$`force_logout_login`
self$`external_user_id` <- EmbedSsoParamsObject$`external_user_id`
self$`first_name` <- EmbedSsoParamsObject$`first_name`
self$`last_name` <- EmbedSsoParamsObject$`last_name`
self$`user_timezone` <- EmbedSsoParamsObject$`user_timezone`
self$`permissions` <- EmbedSsoParamsObject$`permissions`
self$`models` <- EmbedSsoParamsObject$`models`
self$`group_ids` <- EmbedSsoParamsObject$`group_ids`
self$`external_group_id` <- EmbedSsoParamsObject$`external_group_id`
TODO_OBJECT_MAPPINGObject <- TODO_OBJECT_MAPPING$new()
self$`user_attributes` <- TODO_OBJECT_MAPPINGObject$fromJSON(jsonlite::toJSON(EmbedSsoParamsObject$user_attributes, auto_unbox = TRUE))
self$`secret_id` <- EmbedSsoParamsObject$`secret_id`
}
)
)
|
#include <boost/optional.hpp>
#include <boost/program_options.hpp>
#include <iostream>
#include <limits>
#include "src/parser.h"
boost::optional<boost::program_options::variables_map> input(
int argc,
char** argv
) {
boost::program_options::options_description optionDescription(
"Supported options"
);
optionDescription.add_options()
(
"input",
boost::program_options::value<std::vector<std::string>>(),
"terms to be evaluated"
)
(
"tree",
boost::program_options::value<bool>()->implicit_value(true),
"return the binary expression tree instead of evaluating"
)
;
boost::program_options::variables_map variables;
try {
boost::program_options::store(
boost::program_options::parse_command_line(
argc, argv, optionDescription
),
variables
);
boost::program_options::notify(variables);
}
catch ( const std::exception& exception ) {
std::cerr << exception.what() << std::endl;
std::cout << optionDescription << std::endl;
return boost::optional<boost::program_options::variables_map>();
}
return boost::make_optional(variables);
}
bool process(const boost::program_options::variables_map& variables) {
const bool replMode{ variables.count("input") == 0 };
const bool treeMode{ variables.count("tree") ? variables["tree"].as<bool>()
: false };
if ( replMode ) {
std::cout.precision(
std::numeric_limits<double>::digits10
);
std::string term;
while ( std::cin >> term ) {
try {
if ( treeMode) {
std::cout << SimpleParser::print(term);
} else {
std::cout << SimpleParser::calculate(term);
}
std::cout << std::endl;
}
catch ( std::exception &exception ) {
std::cerr << exception.what() << std::endl;
}
}
return true;
} else {
const std::vector<std::string> inputTerms{
variables["input"].as<std::vector<std::string>>()
};
try {
std::for_each(
inputTerms.cbegin(),
inputTerms.cend(),
[treeMode](const std::string& term) {
if ( treeMode) {
std::cout << SimpleParser::print(term);
} else {
std::cout << term
<< " = "
<< SimpleParser::calculate(term);
}
std::cout << std::endl;
}
);
}
catch ( std::exception &exception ) {
std::cerr << exception.what() << std::endl;
return false;
}
return true;
}
}
int main(int argc, char** argv) {
if ( auto variables = input(argc, argv) ) {
if ( process(*variables) ) {
return 0;
} else {
return 1;
}
} else {
return 1;
}
} |
The quotient of two polynomials is equal to the first component of the pseudo-division of the first polynomial by the second. |
/-
Copyright (c) 2015 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
Elegant pairing function.
-/
import data.nat.sqrt data.nat.div
open prod decidable
namespace nat
definition mkpair (a b : nat) : nat :=
if a < b then b*b + a else a*a + a + b
definition unpair (n : nat) : nat × nat :=
let s := sqrt n in
if n - s*s < s then (n - s*s, s) else (s, n - s*s - s)
theorem mkpair_unpair (n : nat) : mkpair (pr1 (unpair n)) (pr2 (unpair n)) = n :=
let s := sqrt n in
by_cases
(suppose n - s*s < s,
begin
esimp [unpair],
rewrite [if_pos this],
esimp [mkpair],
rewrite [if_pos this, add_sub_of_le (sqrt_lower n)]
end)
(suppose h₁ : ¬ n - s*s < s,
have s ≤ n - s*s, from le_of_not_gt h₁,
have s + s*s ≤ n - s*s + s*s, from add_le_add_right this (s*s),
have s*s + s ≤ n, by rewrite [nat.sub_add_cancel (sqrt_lower n) at this,
add.comm at this]; assumption,
have n ≤ s*s + s + s, from sqrt_upper n,
have n - s*s ≤ s + s, from calc
n - s*s ≤ (s*s + s + s) - s*s : nat.sub_le_sub_right this (s*s)
... = (s*s + (s+s)) - s*s : by rewrite add.assoc
... = s + s : by rewrite nat.add_sub_cancel_left,
have n - s*s - s ≤ s, from calc
n - s*s - s ≤ (s + s) - s : nat.sub_le_sub_right this s
... = s : by rewrite nat.add_sub_cancel_left,
have h₂ : ¬ s < n - s*s - s, from not_lt_of_ge this,
begin
esimp [unpair],
rewrite [if_neg h₁], esimp,
esimp [mkpair],
rewrite [if_neg h₂, nat.sub_sub, add_sub_of_le `s*s + s ≤ n`],
end)
theorem unpair_mkpair (a b : nat) : unpair (mkpair a b) = (a, b) :=
by_cases
(suppose a < b,
have a ≤ b + b, from calc
a ≤ b : le_of_lt this
... ≤ b+b : !le_add_right,
begin
esimp [mkpair],
rewrite [if_pos `a < b`],
esimp [unpair],
rewrite [sqrt_offset_eq `a ≤ b + b`, nat.add_sub_cancel_left, if_pos `a < b`]
end)
(suppose ¬ a < b,
have b ≤ a, from le_of_not_gt this,
have a + b ≤ a + a, from add_le_add_left this a,
have a + b ≥ a, from !le_add_right,
have ¬ a + b < a, from not_lt_of_ge this,
begin
esimp [mkpair],
rewrite [if_neg `¬ a < b`],
esimp [unpair],
rewrite [add.assoc (a * a) a b, sqrt_offset_eq `a + b ≤ a + a`, *nat.add_sub_cancel_left,
if_neg `¬ a + b < a`]
end)
open prod.ops
theorem unpair_lt_aux {n : nat} : n ≥ 1 → (unpair n).1 < n :=
suppose n ≥ 1,
or.elim (eq_or_lt_of_le this)
(suppose 1 = n, by subst n; exact dec_trivial)
(suppose n > 1,
let s := sqrt n in
by_cases
(suppose h : n - s*s < s,
have n > 0, from lt_of_succ_lt `n > 1`,
have sqrt n > 0, from sqrt_pos_of_pos this,
have sqrt n * sqrt n > 0, from mul_pos this this,
begin unfold unpair, rewrite [if_pos h], esimp, exact sub_lt `n > 0` `sqrt n * sqrt n > 0` end)
(suppose ¬ n - s*s < s, begin unfold unpair, rewrite [if_neg this], esimp, apply sqrt_lt `n > 1` end))
theorem unpair_lt : ∀ (n : nat), (unpair n).1 < succ n
| 0 := dec_trivial
| (succ n) :=
have (unpair (succ n)).1 < succ n, from unpair_lt_aux dec_trivial,
lt.step this
end nat
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Originally created by James McDonagh at the University of Manchester 2015, in the Popelier group !
! Components of the module are acknowledged to Dr Tanja van Mourik University of St Andrews !
! Licensed under MIT License !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Originally created by James.
! Version 1.1
! CHANGE LOG
! Version 1 : Functions for calculating strutcural parameters
! Version 1.1: Modular format and incorporation in the Hermes program.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
module module_functions
use module_constants
implicit none
contains
function bond_vector(v1,v2)
!Dummy arguements
real, dimension(3) :: v1,v2
!Function argument
real, dimension(3) :: bond_vector
!local
integer :: i
do i=1,3
bond_vector(i)=v2(i)-v1(i)
end do
end function bond_vector
!************************************************************************
function dist(x1, y1, z1, x2, y2, z2) ! Calculates the distance between two coordinates given as separate values
implicit none ! Function originally created by Rob Coates Univeristy of Manchester 2015
real, dimension(3) :: vector
real :: distance2, dist, x1, y1, z1, x2, y2, z2
integer :: i
i = 0
distance2 = 0
dist = 0
vector = 0
vector(1) = x1 - x2
vector(2) = y1 - y2
vector(3) = z1 - z2
do i = 1,3,1
distance2 = distance2 + (vector(i)**2.0)
end do
dist = sqrt(distance2)
end function dist
!************************************************************************
Function norm(v)
!dummy arguments
real, dimension (3) :: v
!function result
real :: norm
norm=sqrt(v(1)*v(1) + v(2)*v(2) + v(3)*v(3))
! Print*, "norm is = ", norm ! JMcD DIAGNOSTIC PRINT
end Function norm
!************************************************************************
function normalise(vector,normal)
!Dummy arguments
real, dimension(3) :: vector
real :: normal
!fucntion argument
real, dimension(3) ::normalise
!local
integer :: inc
do inc=1,3,1
normalise(inc)=vector(inc)/normal
end do
end function normalise
!************************************************************************
function vector_cross(bvec1,bvec2)
!Dummy arguments
real, dimension(3) :: bvec1, bvec2
!Function argument
real, dimension(3) :: vector_cross
vector_cross(1)=(bvec1(2)*bvec2(3)-bvec1(3)*bvec2(2))
vector_cross(2)=(bvec1(3)*bvec2(1)-bvec1(1)*bvec2(3))
vector_cross(3)=(bvec1(1)*bvec2(2)-bvec1(2)*bvec2(1))
end function vector_cross
!************************************************************************
function vector_dot(v1,v2)
!Dummy arguments
real, dimension(3) :: v1, v2
!function argument
real :: vector_dot
vector_dot=v1(1)*v2(1)+v1(2)*v2(2)+v1(3)*v2(3)
end function vector_dot
!************************************************************************
function perdist(x1, y1, z1, x2, y2, z2, boxlen) ! Calculates the distance between two coordinates in periodic Boundary conditions
implicit none ! Function originally created by Rob Coates University of Manchester 2015
real, dimension(3) :: vector
real :: distance2, distance, x1, y1, z1, x2, y2, z2, boxlen, perdist, halfboxlen
integer :: i
i = 0
distance2 = 0
distance = 0
vector = 0
vector(1) = x1 - x2
vector(2) = y1 - y2
vector(3) = z1 - z2
halfboxlen = boxlen*0.5
do i = 1,3,1 ! R.C. takes into account periodic boundry conditions
if (vector(i).gt.halfboxlen) then
vector(i) = vector(i) - boxlen
! else if(vector(i).lt.-halfboxlen) then
! vector(i) = vector(i) + boxlen
else
cycle
end if
end do
do i = 1,3,1
distance2 = distance2 + (vector(i)**2.0)
end do
distance = sqrt(distance2)
perdist = distance
end function perdist
!************************************************************************
function distancemicro(x1, y1, z1, x2, y2, z2, bl) ! Calculates the distance between two coordinates
implicit none
real, dimension(3) :: vector
real :: distance2, distancemicro, x1, y1, z1, x2, y2, z2, bl
integer :: i
i = 0
distance2 = 0
distancemicro = 0
vector = 0
vector(1) = x1 - x2
vector(2) = y1 - y2
vector(3) = z1 - z2
do i = 1,3,1 !takes into account periodic boundry conditions
if (vector(i).GT.(bl*0.5)) then
vector(i) = vector(i) - bl
else
cycle
end if
end do
do i = 1,3,1
distance2 = distance2 + (vector(i)**2.0)
end do
distancemicro = sqrt(distance2)
end function distancemicro
!************************************************************************
function distmicro(x1, y1, z1, x2, y2, z2) ! Calculates the distance between two coordinates
implicit none
real, dimension(3) :: vector
real :: distance2, distmicro, x1, y1, z1, x2, y2, z2
integer :: i
i = 0
distance2 = 0
distmicro = 0
vector = 0
vector(1) = x1 - x2
vector(2) = y1 - y2
vector(3) = z1 - z2
do i = 1,3,1
distance2 = distance2 + (vector(i)**2.0)
end do
distmicro = sqrt(distance2)
end function distmicro
!************************************************************************
end module module_functions
|
{-
Mathematical Foundations of Programming (G54FOP)
Nicolai Kraus
Lecture 6, 15 Feb 2018
-}
module lec6FOP where
{- We import everything we have done last week.
"open" means we can use all definitions directly -}
open import lec3FOP
{- Hint: middle mouse click or alt-.
[press alt/meta, then .]
jumps to the definition that the cursor is on -}
-- Reduce in one step
-- (these are the simplification rules)
data _→1_ : Expr → Expr → Set where
izz : iz z →1 t
izs : {e : Expr} → iz (s e) →1 f
ift : {e₂ e₃ : Expr} → (if t then e₂ else e₃) →1 e₂
iff : {e₂ e₃ : Expr} → (if f then e₂ else e₃) →1 e₃
ps : {e : Expr} → p (s e) →1 e
pz : p z →1 z
-- include structural rules
data _↝_ : Expr → Expr → Set where -- type: \leadsto
from→1 : {e₁ e₂ : Expr} → (e₁ →1 e₂) → (e₁ ↝ e₂)
inside-s : {e₁ e₂ : Expr} → (e₁ ↝ e₂) → (s e₁ ↝ s e₂)
inside-p : {e₁ e₂ : Expr} → (e₁ ↝ e₂) → (p e₁ ↝ p e₂)
inside-iz : ∀ {e₁} {e₂} → (e₁ ↝ e₂) → (iz e₁ ↝ iz e₂)
inside-ite1 : ∀ {e₁ e₁' e₂ e₃} → (e₁ ↝ e₁')
→ (if e₁ then e₂ else e₃) ↝ (if e₁' then e₂ else e₃)
inside-ite2 : ∀ {e₁ e₂ e₂' e₃} → (e₂ ↝ e₂')
→ (if e₁ then e₂ else e₃) ↝ (if e₁ then e₂' else e₃)
inside-ite3 : ∀ {e₁ e₂ e₃ e₃'} → (e₃ ↝ e₃')
→ (if e₁ then e₂ else e₃) ↝ (if e₁ then e₂ else e₃')
data _↝*_ : Expr → Expr → Set where
start : ∀ {e} → e ↝* e
step : ∀ {e₁ e₂ e₃} → (e₁ ↝ e₂) → (e₂ ↝* e₃)
→ (e₁ ↝* e₃)
-- compose two reduction sequences
compose : {e₁ e₂ e₃ : Expr} → (e₁ ↝* e₂)
→ (e₂ ↝* e₃)
→ (e₁ ↝* e₃)
compose start s₂ = s₂
compose (step x s₁) s₂ = step x (compose s₁ s₂)
open import Data.Empty renaming (⊥ to ∅) -- \emptyset
-- define what it means to be a normal form
is-normal : Expr → Set
is-normal e = (e₁ : Expr) → (e →1 e₁) → ∅
{- Exercises:
1. (easy) Show that the expression "t" is
in normal form. This means: fill the whole
(replace the question mark) in
t-nf : is-normal t
t-nf = ?
2. (medium) Show that, if "e" is a normal form,
then so is "s e".
3. (hard) Show that "is-normal" is a
decidable predicate on Expr.
This means writing a function
which takes an expression and tells us
whether the expression is a normal form
or not. The naive version would be
Expr → Bool
but we can do much better: we can take an
expression "e" and either return a *proof*
that "e" is a normal form, or return an
example of how it can be reduced.
Such an example would consist of an expression
"reduct" and a proof of "e ↝ reduct"; we
will learn later how this can be expressed,
but a good way of implementing it is as follows:
-}
record can-red (e : Expr) : Set where
field
reduct : Expr
redstep : e ↝ reduct
{- Ex 3, continued: We can import Data.Sum to get the
definition of ⊎ (type: \u+), a disjoint sum (it's
Either in Haskell). Check out how ⊎ is defined in
the library, it's really simple! -}
open import Data.Sum
{- Ex3, continued: Now, fill in the ? in the following
function; probably, you will want more auxiliary
lemma. Caveat: I have not done this myself.
decide-nf : (e : Expr) → (is-normal e) ⊎ can-red e
decide-nf e = {!!}
-}
|
namespace andOrCom
theorem and_com {p q : Prop} : p ∧ q ↔ q ∧ p :=
iff.intro
(λ h : p ∧ q, and.intro h.right h.left)
(λ h : q ∧ p, and.intro h.right h.left)
#check and_com
lemma or_lem_1 {p q : Prop} : p ∨ q → q ∨ p :=
λ h : p ∨ q,
h.elim (λ hp : p, or.inr hp) (λ hq : q, or.inl hq)
lemma or_lem_2 {p q : Prop} : q ∨ p → p ∨ q :=
λ h : q ∨ p,
h.elim (λ hq : q, or.inr hq) (λ hp : p, or.inl hp)
theorem or_com {p q : Prop} : p ∨ q ↔ q ∨ p :=
iff.intro
or_lem_1
or_lem_2
#check or_com
end andOrCom
namespace andOrAssoc
lemma aal1 {p q r : Prop} : (p ∧ q) ∧ r → p ∧ (q ∧ r) :=
λ h : (p ∧ q) ∧ r,
have hp : p, from (h.left).left,
have hq : q, from (h.left).right,
have hr : r, from h.right,
⟨hp, hq, hr⟩
lemma aal2 {p q r : Prop} : p ∧ (q ∧ r) → (p ∧ q) ∧ r :=
λ h : p ∧ (q ∧ r),
have hp : p, from h.left,
have hq : q, from (h.right).left,
have hr : r, from (h.right).right,
⟨⟨hp, hq⟩, hr⟩
theorem and_assoc {p q r : Prop} : (p ∧ q) ∧ r ↔ p ∧ (q ∧ r) :=
iff.intro
aal1
aal2
lemma oal1 {p q r : Prop} : (p ∨ q) ∨ r → p ∨ (q ∨ r) :=
λ h : (p ∨ q) ∨ r,
h.elim
(assume hpq : p ∨ q,
hpq.elim
(assume hp : p,
show p ∨ q ∨ r, from or.inl hp)
(assume hq : q,
show p ∨ q ∨ r, from or.inr $ or.inl hq))
(assume hr : r,
show p ∨ q ∨ r, from or.inr $ or.inr hr)
lemma oal2 {p q r : Prop} : p ∨ (q ∨ r) → (p ∨ q) ∨ r :=
λ h : p ∨ (q ∨ r),
h.elim
(assume hp : p,
show (p ∨ q) ∨ r, from or.inl $ or.inl hp)
(assume hqr : q ∨ r,
hqr.elim
(assume hq : q,
show (p ∨ q) ∨ r, from or.inl $ or.inr hq)
(assume hr : r,
show (p ∨ q) ∨ r, from or.inr hr))
theorem or_assoc {p q r : Prop} : (p ∨ q) ∨ r ↔ p ∨ (q ∨ r) :=
iff.intro
oal1
oal2
end andOrAssoc
namespace andOrDistrib
lemma aod1 {p q r : Prop} : p ∧ (q ∨ r) → (p ∧ q) ∨ (p ∧ r) :=
λ h : p ∧ (q ∨ r),
have hp : p, from h.left,
have hqr : (q ∨ r), from h.right,
hqr.elim
(assume hq : q,
show (p ∧ q) ∨ (p ∧ r), from or.inl ⟨hp, hq⟩)
(assume hr : r,
show (p ∧ q) ∨ (p ∧ r), from or.inr ⟨hp, hr⟩)
lemma aod2 {p q r : Prop} : (p ∧ q) ∨ (p ∧ r) → p ∧ (q ∨ r) :=
λ h : (p ∧ q) ∨ (p ∧ r),
h.elim
(assume hpq : p ∧ q,
have hp : p, from hpq.left,
have hq : q, from hpq.right,
and.intro
(show p, from hp)
(show q ∨ r, from or.inl hq))
(assume hpr : p ∧ r,
have hp : p, from hpr.left,
have hr : r, from hpr.right,
and.intro
(show p, from hp)
(show q ∨ r, from or.inr hr))
theorem and_or_distrib {p q r : Prop} : p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r) :=
iff.intro
aod1
aod2
lemma oad1 {p q r : Prop} : p ∨ (q ∧ r) → (p ∨ q) ∧ (p ∨ r) :=
λ h : p ∨ (q ∧ r),
h.elim
(assume hp : p,
and.intro
(show p ∨ q,from or.inl hp)
(show p ∨ r, from or.inl hp))
(assume hqr : q ∧ r,
have hq : q, from hqr.left,
have hr : r, from hqr.right,
and.intro
(show p ∨ q, from or.inr hq)
(show p ∨ r, from or.inr hr))
lemma oad2 {p q r : Prop} : (p ∨ q) ∧ (p ∨ r) → p ∨ (q ∧ r) :=
λ h : (p ∨ q) ∧ (p ∨ r),
have hpq : p ∨ q, from h.left,
have hpr : p ∨ r, from h.right,
sorry
theorem or_and_distrib {p q r : Prop} : p ∨ (q ∧ r) ↔ (p ∨ q) ∧ (p ∨ r) :=
iff.intro
(oad1)
(oad2)
#check or_and_distrib
end andOrDistrib
|
program main
use static_hello
implicit none
call static_say_hello()
end program
|
From FOL Require Import FullSyntax Arithmetics.
From FOL.Proofmode Require Import Theories ProofMode.
From FOL.Incompleteness Require Import utils fol_utils qdec.
Require Import Lia.
Require Import String.
Open Scope string_scope.
Require Import Setoid.
Require Import Undecidability.Shared.Libs.DLW.Vec.vec.
Require Import String.
Open Scope string_scope.
Section bin_qdec.
Existing Instance PA_preds_signature.
Existing Instance PA_funcs_signature.
Existing Instance interp_nat.
Section lemmas.
Context `{pei : peirce}.
Lemma Q_add_assoc1 x y z t : Qeq ⊢ num t == (x ⊕ y) ⊕ z → num t == x ⊕ (y ⊕ z).
Proof.
induction t as [|t IH] in x |-*; fstart; fintros "H".
- fassert ax_cases as "C"; first ctx.
fdestruct ("C" x) as "[Hx|[x' Hx']]".
+ frewrite "H". frewrite "Hx".
frewrite (ax_add_zero y). frewrite (ax_add_zero (y ⊕ z)).
fapply ax_refl.
+ fexfalso. fapply (ax_zero_succ ((x' ⊕ y) ⊕ z)).
frewrite <-(ax_add_rec z (x' ⊕ y)).
frewrite <-(ax_add_rec y x').
frewrite <-"Hx'". fapply "H".
- fassert ax_cases as "C"; first ctx.
fdestruct ("C" x) as "[Hx|[x' Hx']]".
+ frewrite "H". frewrite "Hx".
frewrite (ax_add_zero y). frewrite (ax_add_zero (y ⊕ z)).
fapply ax_refl.
+ frewrite "Hx'". frewrite (ax_add_rec (y ⊕ z) x').
specialize (IH x').
fapply ax_succ_congr. fapply IH.
fapply ax_succ_inj.
frewrite <-(ax_add_rec z (x' ⊕ y)).
frewrite <-(ax_add_rec y x').
frewrite <-"Hx'". fapply "H".
Qed.
Lemma Q_add_assoc2 x y z t : Qeq ⊢ num t == (x ⊕ y) ⊕ z → num t == y ⊕ (x ⊕ z).
Proof.
induction t as [|t IH] in x |-*; fstart; fintros "H".
- fassert ax_cases as "C"; first ctx.
fdestruct ("C" x) as "[Hx|[x' Hx']]".
+ frewrite "H". frewrite "Hx".
frewrite (ax_add_zero y). frewrite (ax_add_zero z).
fapply ax_refl.
+ fexfalso. fapply (ax_zero_succ ((x' ⊕ y) ⊕ z)).
frewrite <-(ax_add_rec z (x' ⊕ y)).
frewrite <-(ax_add_rec y x').
frewrite <-"Hx'". fapply "H".
- fassert ax_cases as "C"; first ctx.
fdestruct ("C" x) as "[Hx|[x' Hx']]".
+ frewrite "H". frewrite "Hx".
frewrite (ax_add_zero y). frewrite (ax_add_zero z).
fapply ax_refl.
+ frewrite "Hx'". frewrite (ax_add_rec z x').
pose proof (add_rec_swap2 t y (x' ⊕ z)). cbn in H.
fapply ax_sym. fapply H. fapply ax_sym.
fapply IH.
fapply ax_succ_inj.
frewrite <-(ax_add_rec z (x' ⊕ y)).
frewrite <-(ax_add_rec y x').
frewrite <-"Hx'". fapply "H".
Qed.
Lemma bin_bounded_forall_iff t φ : bounded_t 0 t ->
Qeq ⊢ (∀∀ ($1 ⊕ $0 ⧀= t) → φ) ↔
(∀ ($0 ⧀= t) → ∀ ($0 ⧀= t) → ($1 ⊕ $0 ⧀= t) → φ).
Proof.
intros Hb. destruct (closed_term_is_num Hb) as [t' Ht'].
cbn. unfold "↑".
fstart.
fassert (t == num t') as "Ht" by fapply Ht'.
fsplit.
- fintros "H" x "Hx".
fintros y "Hy" "Hxy".
fapply "H". repeat rewrite (bounded_t_0_subst _ Hb). ctx.
- fintros "H" x y. fintros "[z Hz]".
fapply "H".
+ fexists (y ⊕ z).
rewrite !(bounded_t_0_subst _ Hb).
frewrite "Ht". fapply Q_add_assoc1.
feapply ax_trans.
* feapply ax_sym. fapply "Ht".
* fapply "Hz".
+ fexists (x ⊕ z).
rewrite !(bounded_t_0_subst _ Hb).
frewrite Ht'. fapply Q_add_assoc2.
feapply ax_trans.
* feapply ax_sym. fapply "Ht".
* fapply "Hz".
+ fexists z. ctx.
Qed.
End lemmas.
Lemma Qdec_bin_bounded_forall t φ :
Qdec φ -> Qdec (∀∀ $1 ⊕ $0 ⧀= t`[↑]`[↑] → φ).
Proof.
intros Hφ.
eapply (@Qdec_iff' (∀ ($0 ⧀= t`[↑]) → ∀ ($0 ⧀= t`[↑]`[↑]) → ($1 ⊕ $0 ⧀= t`[↑]`[↑]) → φ)).
- intros ρ Hb.
cbn. rewrite !up_term.
unfold "↑".
assert (bounded_t 0 t`[ρ]) as Ht.
{ destruct (find_bounded_t t) as [k Hk].
eapply subst_bounded_max_t; last eassumption. auto. }
pose proof (@bin_bounded_forall_iff intu t`[ρ] φ Ht).
pose proof (subst_Weak ρ H) as H'. change (List.map _ _) with Qeq in H'.
apply frewrite_equiv_switch.
cbn in H'.
rewrite !(bounded_t_0_subst _ Ht). rewrite !(bounded_t_0_subst _ Ht) in H'.
apply H'.
- do 2 apply Qdec_bounded_forall.
apply Qdec_impl.
+ apply Qdec_le.
+ assumption.
Qed.
End bin_qdec.
|
/-
Copyright (c) 2019 Riccardo Brasca. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Riccardo Brasca, Paul Lezeau, Junyan Xu
-/
import data.polynomial.field_division
import ring_theory.adjoin_root
import field_theory.minpoly.field
import ring_theory.polynomial.gauss_lemma
/-!
# Minimal polynomials over a GCD monoid
This file specializes the theory of minpoly to the case of an algebra over a GCD monoid.
## Main results
* `is_integrally_closed_eq_field_fractions`: For integrally closed domains, the minimal polynomial
over the ring is the same as the minimal polynomial over the fraction field.
* `is_integrally_closed_dvd` : For integrally closed domains, the minimal polynomial divides any
primitive polynomial that has the integral element as root.
* `is_integrally_closed_unique` : The minimal polynomial of an element `x` is uniquely
characterized by its defining property: if there is another monic polynomial of minimal degree
that has `x` as a root, then this polynomial is equal to the minimal polynomial of `x`.
-/
open_locale classical polynomial
open polynomial set function minpoly
namespace minpoly
variables {R S : Type*} [comm_ring R] [comm_ring S] [is_domain R] [algebra R S]
section
variables (K L : Type*) [field K] [algebra R K] [is_fraction_ring R K] [field L] [algebra R L]
[algebra S L] [algebra K L] [is_scalar_tower R K L] [is_scalar_tower R S L]
variables [is_integrally_closed R]
/-- For integrally closed domains, the minimal polynomial over the ring is the same as the minimal
polynomial over the fraction field. See `minpoly.is_integrally_closed_eq_field_fractions'` if
`S` is already a `K`-algebra. -/
theorem is_integrally_closed_eq_field_fractions [is_domain S] {s : S} (hs : is_integral R s) :
minpoly K (algebra_map S L s) = (minpoly R s).map (algebra_map R K) :=
begin
refine (eq_of_irreducible_of_monic _ _ _).symm,
{ exact (polynomial.monic.irreducible_iff_irreducible_map_fraction_map
(monic hs)).1 (irreducible hs) },
{ rw [aeval_map_algebra_map, aeval_algebra_map_apply, aeval, map_zero] },
{ exact (monic hs).map _ }
end
/-- For integrally closed domains, the minimal polynomial over the ring is the same as the minimal
polynomial over the fraction field. Compared to `minpoly.is_integrally_closed_eq_field_fractions`,
this version is useful if the element is in a ring that is already a `K`-algebra. -/
theorem is_integrally_closed_eq_field_fractions' [is_domain S] [algebra K S] [is_scalar_tower R K S]
{s : S} (hs : is_integral R s) : minpoly K s = (minpoly R s).map (algebra_map R K) :=
begin
let L := fraction_ring S,
rw [← is_integrally_closed_eq_field_fractions K L hs],
refine minpoly.eq_of_algebra_map_eq (is_fraction_ring.injective S L)
(is_integral_of_is_scalar_tower hs) rfl
end
end
variables [is_domain S] [no_zero_smul_divisors R S]
variable [is_integrally_closed R]
/-- For integrally closed rings, the minimal polynomial divides any polynomial that has the
integral element as root. See also `minpoly.dvd` which relaxes the assumptions on `S`
in exchange for stronger assumptions on `R`. -/
theorem is_integrally_closed_dvd [nontrivial R] {s : S} (hs : is_integral R s) {p : R[X]}
(hp : polynomial.aeval s p = 0) : minpoly R s ∣ p :=
begin
let K := fraction_ring R,
let L := fraction_ring S,
have : minpoly K (algebra_map S L s) ∣ map (algebra_map R K) (p %ₘ (minpoly R s)),
{ rw [map_mod_by_monic _ (minpoly.monic hs), mod_by_monic_eq_sub_mul_div],
refine dvd_sub (minpoly.dvd K (algebra_map S L s) _) _,
rw [← map_aeval_eq_aeval_map, hp, map_zero],
rw [← is_scalar_tower.algebra_map_eq, ← is_scalar_tower.algebra_map_eq],
apply dvd_mul_of_dvd_left,
rw is_integrally_closed_eq_field_fractions K L hs,
exact monic.map _ (minpoly.monic hs) },
rw [is_integrally_closed_eq_field_fractions _ _ hs, map_dvd_map (algebra_map R K)
(is_fraction_ring.injective R K) (minpoly.monic hs)] at this,
rw [← dvd_iff_mod_by_monic_eq_zero (minpoly.monic hs)],
refine polynomial.eq_zero_of_dvd_of_degree_lt this
(degree_mod_by_monic_lt p $ minpoly.monic hs),
all_goals { apply_instance }
end
lemma ker_eval {s : S} (hs : is_integral R s) :
((polynomial.aeval s).to_ring_hom : R[X] →+* S).ker = ideal.span ({minpoly R s} : set R[X] ):=
by ext p ; simp_rw [ring_hom.mem_ker, alg_hom.to_ring_hom_eq_coe, alg_hom.coe_to_ring_hom,
is_integrally_closed_dvd_iff hs, ← ideal.mem_span_singleton]
/-- If an element `x` is a root of a nonzero polynomial `p`, then the degree of `p` is at least the
degree of the minimal polynomial of `x`. See also `minpoly.degree_le_of_ne_zero` which relaxes the
assumptions on `S` in exchange for stronger assumptions on `R`. -/
lemma is_integrally_closed.degree_le_of_ne_zero {s : S} (hs : is_integral R s) {p : R[X]}
(hp0 : p ≠ 0) (hp : polynomial.aeval s p = 0) : degree (minpoly R s) ≤ degree p :=
begin
rw [degree_eq_nat_degree (minpoly.ne_zero hs), degree_eq_nat_degree hp0],
norm_cast,
exact nat_degree_le_of_dvd ((is_integrally_closed_dvd_iff hs _).mp hp) hp0
end
/-- The minimal polynomial of an element `x` is uniquely characterized by its defining property:
if there is another monic polynomial of minimal degree that has `x` as a root, then this polynomial
is equal to the minimal polynomial of `x`. See also `minpoly.unique` which relaxes the
assumptions on `S` in exchange for stronger assumptions on `R`. -/
lemma is_integrally_closed.minpoly.unique {s : S} {P : R[X]} (hmo : P.monic)
(hP : polynomial.aeval s P = 0)
(Pmin : ∀ Q : R[X], Q.monic → polynomial.aeval s Q = 0 → degree P ≤ degree Q) :
P = minpoly R s :=
begin
have hs : is_integral R s := ⟨P, hmo, hP⟩,
symmetry, apply eq_of_sub_eq_zero,
by_contra hnz,
have := is_integrally_closed.degree_le_of_ne_zero hs hnz (by simp [hP]),
contrapose! this,
refine degree_sub_lt _ (ne_zero hs) _,
{ exact le_antisymm (min R s hmo hP)
(Pmin (minpoly R s) (monic hs) (aeval R s)) },
{ rw [(monic hs).leading_coeff, hmo.leading_coeff] }
end
theorem prime_of_is_integrally_closed {x : S} (hx : is_integral R x) :
_root_.prime (minpoly R x) :=
begin
refine ⟨(minpoly.monic hx).ne_zero, ⟨by by_contra h_contra ;
exact (ne_of_lt (minpoly.degree_pos hx)) (degree_eq_zero_of_is_unit h_contra).symm,
λ a b h, or_iff_not_imp_left.mpr (λ h', _)⟩⟩,
rw ← minpoly.is_integrally_closed_dvd_iff hx at ⊢ h' h,
rw aeval_mul at h,
exact eq_zero_of_ne_zero_of_mul_left_eq_zero h' h,
end
section adjoin_root
noncomputable theory
open algebra polynomial adjoin_root
variables {R} {x : S}
lemma to_adjoin.injective (hx : is_integral R x) :
function.injective (minpoly.to_adjoin R x) :=
begin
refine (injective_iff_map_eq_zero _).2 (λ P₁ hP₁, _),
obtain ⟨P, hP⟩ := mk_surjective (minpoly.monic hx) P₁,
by_cases hPzero : P = 0,
{ simpa [hPzero] using hP.symm },
rw [← hP, minpoly.to_adjoin_apply', lift_hom_mk, ← subalgebra.coe_eq_zero,
aeval_subalgebra_coe, set_like.coe_mk, is_integrally_closed_dvd_iff hx] at hP₁,
obtain ⟨Q, hQ⟩ := hP₁,
rw [← hP, hQ, ring_hom.map_mul, mk_self, zero_mul],
end
/-- The algebra isomorphism `adjoin_root (minpoly R x) ≃ₐ[R] adjoin R x` -/
@[simps] def equiv_adjoin (hx : is_integral R x) :
adjoin_root (minpoly R x) ≃ₐ[R] adjoin R ({x} : set S) :=
alg_equiv.of_bijective (minpoly.to_adjoin R x)
⟨minpoly.to_adjoin.injective hx, minpoly.to_adjoin.surjective R x⟩
/-- The `power_basis` of `adjoin R {x}` given by `x`. See `algebra.adjoin.power_basis` for a version
over a field. -/
@[simps] def _root_.algebra.adjoin.power_basis' (hx : is_integral R x) :
power_basis R (algebra.adjoin R ({x} : set S)) :=
power_basis.map (adjoin_root.power_basis' (minpoly.monic hx)) (minpoly.equiv_adjoin hx)
/-- The power basis given by `x` if `B.gen ∈ adjoin R {x}`. -/
@[simps] noncomputable def _root_.power_basis.of_gen_mem_adjoin' (B : power_basis R S)
(hint : is_integral R x) (hx : B.gen ∈ adjoin R ({x} : set S)) :
power_basis R S :=
(algebra.adjoin.power_basis' hint).map $
(subalgebra.equiv_of_eq _ _ $ power_basis.adjoin_eq_top_of_gen_mem_adjoin hx).trans
subalgebra.top_equiv
end adjoin_root
end minpoly
|
module MJ.Examples.While where
open import MJ.Examples.Integer
open import Prelude
open import MJ.Types
open import MJ.Classtable.Code Σ
open import MJ.Syntax Σ
open import MJ.Syntax.Program Σ
open import MJ.Semantics Σ Lib
open import MJ.Semantics.Values Σ
open import Data.List.Any
open import Data.List.Membership.Propositional
open import Data.Star
open import Data.Bool as Bools hiding (_≤?_)
open import Relation.Nullary.Decidable
-- a simple program that computes 10 using a while loop
p₁ : Prog int
p₁ = Lib ,
let
x = (here refl)
in body
(
loc int
◅ asgn x (num 1)
◅ while iop (λ x y → Bools.if ⌊ suc x ≤? y ⌋ then 0 else 1) (var x) (num 10) run (
asgn x (iop (λ x y → x + y) (var x) (num 1))
)
-- test simplest if-then-else and early return from statement
◅ if (num 0) then (ret (var x)) else (ret (num 0))
◅ ε
)
(num 0)
test1 : p₁ ⇓⟨ 100 ⟩ (λ {W} (v : Val W int) → v ≡ num 10)
test1 = refl
|
lemma open_greaterThanLessThan [continuous_intros, simp]: "open {a <..< b}" |
#!/usr/bin/env python
# encoding: utf-8
"""
@file: modified_cam_clay_model.py
@time: 2019/11/9 21:36
@email: [email protected]
@application:
1.根据修正剑桥模型计算应力应变
2.常规三轴(drained & undrained)
"""
import numpy as np
from matplotlib import pyplot as plt
import os
import math
from MCCUtil import ModifiedCamClay, loadingPathReader
# initiation
# material properties
'''
l: the slope of the e-lnp line
k: the slope of the unload e-lnp line
N: the y coordinate of the natural consolidation line (e-lnp)
M: the q/p ratio at the critical state
poisn: the poisn ratio
'''
# [l, k, M, poisn, N] = [0.2, 0.04, 0.95, 0.15, 2.5]
[l, k, M, poisn, N] = [0.077, 0.04, 1.2, 0.3, 1.788]
# initial state
pc = 200 # consolidation pressure 前期固结压力
p0 = 201. # confining pressure 围压
# --------------------------------------------------
# Debug && baseline
# loadMode = 'drained' # 'drained' 'undrained'
# driver = ModifiedCamClay(N=N, lambda_e=l, pc=pc,
# kappa_e=k, p0=p0, poisn=poisn, loadMode=loadMode, M=M, dimensionNum=2)
# driver.forward()
# --------------------------------------------------
# Application
loadPathList = loadingPathReader()
loadMode = 'random'
for i, path in enumerate(loadPathList):
driver = ModifiedCamClay(N=N, lambda_e=l, pc=pc,
kappa_e=k, p0=p0, poisn=poisn, loadMode=loadMode, M=M, dimensionNum=2)
driver.forward(numIndex=i, path=path) |
import tutorial_world.level11_cases2_or --hide
open set IncidencePlane --hide
variables {Ω : Type} [IncidencePlane Ω] --hide
/-
# Tutorial World
## Level 12: the `cases` tactic (III) (boss level).
Suppose now that your hypothesis says there is some element `x` satisfying a certain
property `P`. That is, you have `h : ∃ x, P x`. Then `cases h with z hz` will
replace `h` with `z : x` and `hz : P z`. That is, from the fact that you assume that
some `z` exists (`z : x`), it will give you another hypothesis in which `z` satisfies the
property `P` (`hz : P z`).
Let's try to understand this with a real life example! Say that we have the hypothesis
`h: ∃ GALAXY, SOLAR_SYSTEM GALAXY`. That is, **there exists a GALAXY such that "SOLAR_SYSTEM" is an element of "GALAXY"**.
Then, `cases h with MILKY_WAY hMILKY_WAY` will break `h` into two goals:
`MILKY_WAY : GALAXY`, which is read as **the "MILKY_WAY" is a term of the type "GALAXY"**, and
`hMILKY_WAY : SOLAR_SYSTEM MILKY_WAY, which is read as **the hypothesis hMILKY_WAY assumes that "SOLAR_SYSTEM"
is an element of the "MILKY_WAY"**. Is it better for you now? [**Tip:** Whenever you don't
understand an abstract concept, try to apply a real life example to it.]
Now, let's try to solve this level! From now on, it will be better if we start by reading the lemma
as many times as we need to understand it. Then, do a drawing of the situation. In this way, we can
think of a clearer path to close the goal. Once you feel ready, delete the `sorry` and take a look
to the hypothesis h1 and h2. As you may be thinking, we can apply the `cases` tactic to them. Following
the guiding thread of the real life example, we need to think about a specific line for each of them.
In geometry, lines are usually represented by the letters `r` and `s`. Then, type `cases h1 with r hr,`,
click on enter, and write `cases h2 with s hs,`. If you look at the local context, you'll see that we've
assumed that `r` and `s`are lines in the plane Ω.
Right after, it comes the genius idea. After reading the lemmma and trying to do a draw that represents
the situation, you should be wondering if we could create a hypothesis to state that the lines we've just
added to the local context are the same (`r = s`). Do you remember how we could add a hypothesis? Exactly,
the `have` tactic will do it for us! Now, type `have H : r = s,` (don't forget the comma).
Subsequently, we will have to prove two goals. First, try to look for a theorem statement that might help us
to close the `⊢ r = s` goal. Can you see that `equal_lines_of_contain_two_points` ends with exactly the `r = s`
statement? Then, try to look if we have all the previous implications of this statement in the local context of
this level. If so, why don't we use the `exact` tactic? [**Pro tip:** Whenever we have a hypothesis of the form
`h : P ∧ Q ∧ R`, we write `h.1` to refer to `P` and we type `h.2` to refer to `Q ∧ R`. If we want to refer to just
`Q`, we need to write `h.2.1`. Analogously, if we want to refer to just `R`, then we type `h.2.2`. With that being said,
you can solve the first goal!
When it comes to the second goal, you should remember what tactic comes handy for solving goals of the form
`⊢ ∃ x, P x`. Once you have it mind, try to use it with the hypotheses `r` or `s`. From there, some `split`'s, `exact`'s
and a `rewrite` will close the goal.
-/
/- Hint : Click here for a hint, in case you get stuck.
The tactic that comes handy for solving goals of the form `⊢ ∃ x, P x` is the `use` tactic. Type `use r,` and note how the goal
changes. Now, `split` will break the proof into different goals. Try to close with the `exact` tactic. You may need to use `rw` before
writing the last `exact` that will take you home. Bewildered? Click on "View source" (located on the top right corner of the game screen) to see the solution.
-/
/- Lemma : no-side-bar
Given 4 distinct points that pass through a line, then that line passes through two different subsets of three points.
-/
lemma exists_line_example (P Q R S : Ω) (h : Q ≠ R) (h1 : ∃ ℓ : Line Ω, P ∈ ℓ ∧ Q ∈ ℓ ∧ R ∈ ℓ)
(h2 : ∃ ℓ : Line Ω, Q ∈ ℓ ∧ R ∈ ℓ ∧ S ∈ ℓ) :
∃ ℓ : Line Ω, P ∈ ℓ ∧ Q ∈ ℓ ∧ R ∈ ℓ ∧ S ∈ ℓ :=
begin
cases h1 with r hr,
cases h2 with s hs,
have H : r = s,
{
exact equal_lines_of_contain_two_points h hr.2.1 hs.1 hr.2.2 hs.2.1,
},
use r,
split,
exact hr.1,
split,
exact hr.2.1,
split,
exact hr.2.2,
rw H,
exact hs.2.2,
end
|
#define BOOST_TEST_MAIN
#include <boost/test/included/unit_test.hpp>
#include <poac/core/validator.hpp>
BOOST_AUTO_TEST_CASE( poac_core_validator_check_directory_can_be_created_test )
{
using poac::core::validator::can_crate_directory;
const std::filesystem::path test_dir = "test_dir";
BOOST_CHECK( can_crate_directory(test_dir).is_ok() );
std::filesystem::create_directory(test_dir);
BOOST_CHECK( can_crate_directory(test_dir).is_ok() );
std::ofstream((test_dir / "test_file").string());
BOOST_CHECK( can_crate_directory(test_dir).is_err() );
std::filesystem::remove_all(test_dir);
}
BOOST_AUTO_TEST_CASE( poac_core_validator_use_valid_characters_test )
{
using poac::core::validator::invalid_characters;
BOOST_CHECK( invalid_characters("na$me").is_err() );
BOOST_CHECK( invalid_characters("nam()e").is_err() );
BOOST_CHECK( invalid_characters("namße").is_err() );
BOOST_CHECK( !invalid_characters("poacpm/poac-api").is_err() );
BOOST_CHECK( !invalid_characters("poacpm/poac_api").is_err() );
BOOST_CHECK( !invalid_characters("poacpm/poac").is_err() );
BOOST_CHECK( invalid_characters("double//slashes").is_err() );
BOOST_CHECK( invalid_characters("double--hyphens").is_ok() );
BOOST_CHECK( invalid_characters("double__underscores").is_ok() );
BOOST_CHECK( invalid_characters("many////////////slashes").is_err() );
BOOST_CHECK( invalid_characters("many------------hyphens").is_ok() );
BOOST_CHECK( invalid_characters("many________underscores").is_ok() );
BOOST_CHECK( invalid_characters("/startWithSlash").is_err() );
BOOST_CHECK( invalid_characters("-startWithHyphen").is_err() );
BOOST_CHECK( invalid_characters("_startWithUnderscore").is_err() );
BOOST_CHECK( invalid_characters("endWithSlash/").is_err() );
BOOST_CHECK( invalid_characters("endWithHyphen-").is_err() );
BOOST_CHECK( invalid_characters("endWithUnderscore_").is_err() );
}
|
# Modeling the global energy budget
## Introducing the zero-dimensional Energy Balance Model
____________
<a id='section1'></a>
## 1. Recap of the global energy budget
____________
Let's look again at the observations:
____________
<a id='section1'></a>
## 2. Tuning radiative fluxes to the observations
____________
### Recap of our simple greenhouse model
Last class we introduced a very simple model for the **OLR** or Outgoing Longwave Radiation to space:
$$ \text{OLR} = \tau \sigma T_s^4 $$
where $\tau$ is the **transmissivity** of the atmosphere, a number less than 1 that represents the greenhouse effect of Earth's atmosphere.
We also tuned this model to the observations by choosing $ \tau \approx 0.61$.
More precisely:
```python
OLR_obs = 238.5 # in W/m2
sigma = 5.67E-8 # S-B constant
Ts_obs = 288. # global average surface temperature
tau = OLR_obs / sigma / Ts_obs**4 # solve for tuned value of transmissivity
print(tau)
```
0.6114139923687016
Let's now deal with the shortwave (solar) side of the energy budget.
### Absorbed Shortwave Radiation (ASR) and Planetary Albedo
Let's define a few terms.
#### Global mean insolation
From the observations, the area-averaged incoming solar radiation, or **insolation**, is 341.3 W m$^{-2}$.
Let's denote this quantity by $Q$.
```python
Q = 341.3 # the insolation
```
#### Planetary albedo
Some of the incoming radiation is not absorbed at all but simply reflected back to space. Let's call this quantity $F_{reflected}$
From observations we have:
```python
Freflected = 101.9 # reflected shortwave flux in W/m2
```
The **planetary albedo** is the fraction of $Q$ that is reflected.
We will denote the planetary albedo by $\alpha$.
From the observations:
```python
alpha = Freflected / Q
print(alpha)
```
0.29856431292118374
That is, about 30% of the incoming radiation is reflected back to space.
#### Absorbed Shortwave Radiation
The **Absorbed Shortwave Radiation** or ASR is the part of the incoming sunlight that is *not* reflected back to space, i.e. that part that is absorbed somewhere within the Earth system.
Mathematically we write
$$ \text{ASR} = Q - F_{reflected}\\
= Q-\alpha Q \\
= (1-\alpha) Q $$
From the observations:
```python
ASRobserved = Q - Freflected
print(ASRobserved)
```
239.4
As we noted last time, this number is *just slightly greater* than the observed OLR of 238.5 W m$^{-2}$.
____________
<a id='section3'></a>
## 3. Equilibrium temperature
____________
*This is one of the central concepts in climate modeling.*
The Earth system is in **energy balance** when energy in = energy out, i.e., when
$$ \text{ASR} = \text{OLR} $$
We want to know:
- What surface temperature do we need to have this balance?
- By how much would the temperature change in response to other changes in Earth system?
- Changes in greenhouse gases
- Changes in cloudiness
- etc.
With our simple greenhouse model, we can get an **exact solution** for the equilibrium temperature.
First, write down our statement of energy balance:
$$ (1-\alpha) Q = \tau \sigma T_s^4 $$
Rearrange to solve for $T_s$:
$$ T_s^4 = \frac{(1-\alpha) Q}{\tau \sigma} $$
and take the fourth root, denoting our **equilibrium temperature** as $T_{eq}$:
$$ T_{eq} = \left( \frac{(1-\alpha) Q}{\tau \sigma} \right)^\frac{1}{4} $$
Plugging the observed values back in, we compute:
```python
# define a reusable function
def equilibrium_temperature(alpha, Q, tau):
return ((1-alpha) *Q / (tau * sigma))**(1/4)
# call the function, passing arguments, and assign the return value to a new variable
Teq_obs = equilibrium_temperature(alpha, Q, tau)
print(Teq_obs)
```
288.27131447889224
And this equilibrium temperature is *just slightly warmer* than 288 K.
____________
## 4. A climate change scenario
____________
Suppose that, due to global warming (changes in atmospheric composition and subsequent changes in cloudiness):
- The longwave transmissitivity decreases to $\tau = 0.57$
- The planetary albedo increases to $\alpha = 0.32$
What is the ***new equilibrium temperature***?
For this very simple model, we can work out the answer exactly:
```python
Teq_new = equilibrium_temperature(0.32, Q, 0.57)
# an example of formatted print output, limiting to two or one decimal places
print('The new equilibrium temperature is {:.2f} K.'.format(Teq_new))
print('The equilibrium temperature increased by about {:.1f} K.'.format(Teq_new-Teq_obs))
```
The new equilibrium temperature is 291.10 K.
The equilibrium temperature increased by about 2.8 K.
Most climate models are more complicated mathematically, and solving directly for the equilibrium temperature will not be possible!
Instead, we will be able to use the model to calculate the terms in the energy budget (ASR and OLR).
### Python exercise
- Write **two** Python functions to calculate ASR and OLR for *arbitrary parameter values*.
- Verify the following:
- With the new parameter values but the old temperature $T = 288$ K, is ASR greater or lesser than OLR? (Use formatted strings to print your results.)
- Is the Earth gaining or losing energy?
- How does your answer change if $T = 295$ K (or any other temperature greater than 291 K)?
```python
```
```python
```
____________
## 5. A time-dependent Energy Balance Model
____________
The above exercise shows us that if some properties of the climate system change in such a way that the **equilibrium temperature goes up**, then the Earth system *receives more energy from the sun than it is losing to space*. The system is **no longer in energy balance**.
The temperature must then increase to get back into balance. The increase will not happen all at once! It will take time for energy to accumulate in the climate system. We want to model this **time-dependent adjustment** of the system.
In fact almost all climate models are **time-dependent**, meaning the model calculates **time derivatives** (rates of change) of climate variables.
### An energy balance **equation**
We will write the **total energy budget** of the Earth system as
\begin{align}
\frac{dE}{dt} &= \text{net energy flux in to system} \\
&= \text{flux in – flux out} \\
&= \text{ASR} - \text{OLR}
\end{align}
where $E$ is the **enthalpy** or **heat content** of the total system.
We will express the budget per unit surface area, so each term above has units W m$^{-2}$
Note: any **internal exchanges** of energy between different reservoirs (e.g. between ocean, land, ice, atmosphere) do not appear in this budget – because $E$ is the **sum of all reservoirs**.
Also note: **This is a generically true statement.** We have just defined some terms, and made the (very good) assumption that the only significant energy sources are radiative exchanges with space.
**This equation is the starting point for EVERY CLIMATE MODEL.**
But so far, we don’t actually have a MODEL. We just have a statement of a budget. To use this budget to make a model, we need to relate terms in the budget to state variables of the atmosphere-ocean system.
For now, the state variable we are most interested in is **temperature** – because it is directly connected to the physics of each term above.
### An energy balance **model**
If we now suppose that
$$ E = C T_s $$
where $T_s$ is the global mean surface temperature, and $C$ is a constant – the **effective heat capacity** of the atmosphere-ocean column.
Then our budget equation becomes:
$$ C \frac{dT_s}{dt} = \text{ASR} - \text{OLR} $$
where
- $C$ is the **heat capacity** of Earth system, in units of J m$^{-2}$ K$^{-1}$.
- $\frac{dT_s}{dt}$ is the rate of change of global average surface temperature.
By adopting this equation, we are assuming that the energy content of the Earth system (atmosphere, ocean, ice, etc.) is *proportional to surface temperature*.
Important things to think about:
- Why is this a sensible assumption?
- What determines the heat capacity $C$?
- What are some limitations of this assumption?
For our purposes here we are going to use a value of $C$ equivalent to heating 100 meters of water:
$$C = c_w \rho_w H$$
where
$c_w = 4 \times 10^3$ J kg$^{-1}$ $^\circ$C$^{-1}$ is the specific heat of water,
$\rho_w = 10^3$ kg m$^{-3}$ is the density of water, and
$H$ is an effective depth of water that is heated or cooled.
```python
c_w = 4E3 # Specific heat of water in J/kg/K
rho_w = 1E3 # Density of water in kg/m3
H = 100. # Depth of water in m
C = c_w * rho_w * H # Heat capacity of the model
print('The effective heat capacity is {:.1e} J/m2/K'.format(C))
```
The effective heat capacity is 4.0e+08 J/m2/K
### Solving the energy balance model
This is a first-order ordinary differential equation (ODE) for $T_s$ as a function of time. It is also **our very first climate model!**
To solve it (i.e. see how $T_s$ evolves from some specified initial condition) we have two choices:
1. Solve it analytically
2. Solve it numerically
Option 1 (analytical) will usually not be possible because the equations will typically be too complex and non-linear. This is why computers are our best friends in the world of climate modeling.
HOWEVER it is often useful and instructive to simplify a model down to something that is analytically solvable when possible. Why? Two reasons:
1. Analysis will often yield a deeper understanding of the behavior of the system
2. It gives us a benchmark against which to test the results of our numerical solutions.
____________
## 6. Representing time derivatives on a computer
____________
Recall that the derivative is the **instantaneous rate of change**. It is defined as
$$ \frac{dT}{dt} = \lim_{\Delta t\rightarrow 0} \frac{\Delta T}{\Delta t}$$
- **On the computer there is no such thing as an instantaneous change.**
- We are always dealing with *discrete quantities*.
- So we approximate the derivative with $\Delta T/ \Delta t$.
- So long as we take the time interval $\Delta t$ "small enough", the approximation is valid and useful.
- (The meaning of "small enough" varies widely in practice. Let's not talk about it now)
So we write our model as
$$ C \frac{\Delta T}{\Delta t} \approx \text{ASR} - \text{OLR}$$
where $\Delta T$ is the **change in temperature predicted by our model** over a short time interval $\Delta t$.
We can now use this to **make a prediction**:
Given a current temperature $T_1$ at time $t_1$, what is the temperature $T_2$ at a future time $t_2$?
We can write
$$ \Delta T = T_2-T_1 $$
$$ \Delta t = t_2-t_1 $$
and so our model says
$$ C \frac{T_2-T_1}{\Delta t} = \text{ASR} - \text{OLR} $$
Which we can rearrange to **solve for the future temperature**:
$$ T_2 = T_1 + \frac{\Delta t}{C} \left( \text{ASR} - \text{OLR}(T_1) \right) $$
We now have a formula with which to make our prediction!
Notice that we have written the OLR as a *function of temperature*. We will use the current temperature $T_1$ to compute the OLR, and use that OLR to determine the future temperature.
____________
## 7. Numerical solution of the Energy Balance Model
____________
The quantity $\Delta t$ is called a **timestep**. It is the smallest time interval represented in our model.
Here we're going to use a timestep of 1 year:
```python
dt = 60. * 60. * 24. * 365. # one year expressed in seconds
```
```python
# Try a single timestep, assuming we have working functions for ASR and OLR
T1 = 288.
T2 = T1 + dt / C * ( ASR(alpha=0.32) - OLR(T1, tau=0.57) )
# above I am passing arguments using keywords so that I don't have to remember the order
print(T2)
```
288.7678026614462
What happened? Why?
Try another timestep
```python
T1 = T2
T2 = T1 + dt / C * ( ASR(alpha=0.32) - OLR(T1, tau=0.57) )
print(T2)
```
289.3479210238739
Warmed up again, but by a smaller amount.
But this is tedious typing. Time to **define a function** to make things easier and more reliable:
```python
def step_forward(T):
return T + dt / C * ( ASR(alpha=0.32) - OLR(T, tau=0.57) )
```
Try it out with an arbitrary temperature:
```python
step_forward(300.)
```
297.658459884
Notice that our function calls other functions and variables we have already defined.
***
#### Python tip
Functions can access variables and other functions defined outside of the function.
This is both very useful and occasionally confusing.
***
Now let's really harness the power of the computer by **making a loop** (and storing values in arrays).
### Python "For" Loops
Definite iteration loops are frequently referred to as **for** loops because for is the keyword that is used to introduce them in nearly all programming languages, including Python.
Definite iteration means that the number of repetitions is specified in advance. Later in the course we will introduce indefinite iteration, in which the code block executes until some condition is met.
```python
# Iterate through a list of numbers and execute statements
for n in [0, 1, 2, 3, 4]:
print(n)
# Note the loop variable n takes on the value of the next element
# in the collection each time through the loop.
```
0
1
2
3
4
```python
# Same thing, but use the built-in range() function
# range(<end>) returns an iterable that yields integers
# starting with 0, up to but not including <end>:
for n in range(5):
print(n)
```
0
1
2
3
4
### Numpy arrays
[NumPy](https://numpy.org/) is the fundamental package for scientific computing with Python.
The fundamental data structure of NumPy is an **n-dimensional array**. N-dimensional means it can be 1-dimensional, 2-dimensional, 3-dimensional, and so on.
As your programming skills grow, you will want to avoid for loops and intead use array programming to speed up operation runtime. Let's not worry about that now.
To access numpy, we must first import it.
```python
import numpy as np
```
The `linspace` function creates an array object that is an array of numbers evenly spaced between the start and end points.
```python
np.linspace(230,300,10)
```
array([230. , 237.77777778, 245.55555556, 253.33333333,
261.11111111, 268.88888889, 276.66666667, 284.44444444,
292.22222222, 300. ])
An array can be a function argument.
```python
OLR(np.linspace(230,300,10), tau=0.57)
```
array([ 90.44181279, 103.31014479, 117.50516903, 133.11508224,
150.23091968, 168.9465551 , 189.35870079, 211.56690754,
235.67356467, 261.7839 ])
The `zeros` function creates an array object that is an array of zeros of the specified size.
```python
np.zeros(10)
```
array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
### Implementing For-loop and Array assignment in the Energy Balance Model
```python
numsteps = 20
Tsteps = np.zeros(numsteps+1)
Years = np.zeros(numsteps+1)
Tsteps[0] = 288.
for n in range(numsteps):
Years[n+1] = n+1
#Here we are calling a function inside a loop
Tsteps[n+1] = step_forward( Tsteps[n] )
print(Tsteps)
```
[288. 288.76780266 289.34792102 289.78523685 290.11433323
290.36166675 290.54736768 290.68669049 290.79115953 290.86946109
290.92813114 290.97208122 291.00499865 291.02964965 291.0481083
291.06192909 291.07227674 291.08002371 291.08582346 291.09016532
291.09341571]
What did we just do?
- Created an array of zeros
- Set the initial temperature to 288 K
- Repeated our time step 20 times
- Stored the results of each time step into the array
***
#### Python tip
Use square bracket [ ] to refer to elements of an array or list. Use round parentheses ( ) for function arguments.
***
### Plotting the result
Now let's draw a picture of our result!
```python
# a special instruction for the Jupyter notebook
# Display all plots inline in the notebook
%matplotlib inline
# import the plotting package
import matplotlib.pyplot as plt
```
```python
plt.plot(Years, Tsteps)
plt.xlabel('Years')
plt.ylabel('Global mean temperature (K)');
```
Note how the temperature *adjusts smoothly toward the equilibrium temperature*, that is, the temperature at which
ASR = OLR.
**If the planetary energy budget is out of balance, the temperature must change so that the OLR gets closer to the ASR!**
The adjustment is actually an *exponential decay* process: The rate of adjustment slows as the temperature approaches equilibrium.
The temperature gets very very close to equilibrium but never reaches it exactly.
***
#### Python tip
We can easily make simple graphs with the function `plt.plot(x,y)`, where `x` and `y` are arrays of the same size. But we must import it first.
This is actually not native Python, but uses a graphics library called [matplotlib](https://matplotlib.org). This is the workhorse of scientific plotting in Python, and we will be using it all the time!
Just about all of our notebooks will start with this:
```
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
```
***
____________
## 8. Summary
____________
- We looked at the flows of energy in and out of the Earth system.
- These are determined by radiation at the top of the Earth's atmosphere.
- Any imbalance between shortwave absorption (ASR) and longwave emission (OLR) drives a change in temperature
- Using this idea, we built a climate model!
- This **Zero-Dimensional Energy Balance Model** solves for the global, annual mean surface temperature $T_s$
- Two key assumptions:
- Energy content of the Earth system varies proportionally to $T_s$
- The OLR increases as $\tau \sigma T_s^4$ (our simple greenhouse model)
- Earth (or any planet) has a well-defined **equilibrium temperature** $T_{eq}$ at which ASR = OLR, because of the *temperature dependence of the outgoing longwave radiation*.
- If $T_s < T_{eq}$, the model will warm up.
- We can represent the continous warming process on the computer using discrete timesteps.
- We can plot the result.
____________
## Credits
This notebook is part of [The Climate Laboratory](https://brian-rose.github.io/ClimateLaboratoryBook), an open-source textbook developed and maintained by [Brian E. J. Rose](http://www.atmos.albany.edu/facstaff/brose/index.html), University at Albany. It has been modified by [Nicole Feldl](http://nicolefeldl.com), UC Santa Cruz.
It is licensed for free and open consumption under the
[Creative Commons Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/) license.
Development of these notes and the [climlab software](https://github.com/brian-rose/climlab) is partially supported by the National Science Foundation under award AGS-1455071 to Brian Rose. Any opinions, findings, conclusions or recommendations expressed here are mine and do not necessarily reflect the views of the National Science Foundation.
____________
```python
```
|
module Data.QuadTree.LensProofs.Valid-LensWrappedTree where
open import Haskell.Prelude renaming (zero to Z; suc to S)
open import Data.Lens.Lens
open import Data.Logic
open import Data.QuadTree.InternalAgda
open import Agda.Primitive
open import Data.Lens.Proofs.LensLaws
open import Data.Lens.Proofs.LensPostulates
open import Data.Lens.Proofs.LensComposition
open import Data.QuadTree.Implementation.QuadrantLenses
open import Data.QuadTree.Implementation.Definition
open import Data.QuadTree.Implementation.ValidTypes
open import Data.QuadTree.Implementation.SafeFunctions
open import Data.QuadTree.Implementation.PublicFunctions
open import Data.QuadTree.Implementation.DataLenses
---- Lens laws for lensWrappedTree
ValidLens-WrappedTree-ViewSet :
{t : Set} {{eqT : Eq t}} {dep : Nat}
-> ViewSet (lensWrappedTree {t} {dep})
ValidLens-WrappedTree-ViewSet (CVQuadrant qdi) (CVQuadTree (Wrapper (w , h) qdo)) = refl
ValidLens-WrappedTree-SetView :
{t : Set} {{eqT : Eq t}} {dep : Nat}
-> SetView (lensWrappedTree {t} {dep})
ValidLens-WrappedTree-SetView (CVQuadTree (Wrapper (w , h) qdo)) = refl
ValidLens-WrappedTree-SetSet :
{t : Set} {{eqT : Eq t}} {dep : Nat}
-> SetSet (lensWrappedTree {t} {dep})
ValidLens-WrappedTree-SetSet (CVQuadrant qd1) (CVQuadrant qd2) (CVQuadTree (Wrapper (w , h) qdo)) = refl
ValidLens-WrappedTree :
{t : Set} {{eqT : Eq t}} {dep : Nat}
-> ValidLens (VQuadTree t {dep}) (VQuadrant t {dep})
ValidLens-WrappedTree = CValidLens lensWrappedTree (ValidLens-WrappedTree-ViewSet) (ValidLens-WrappedTree-SetView) (ValidLens-WrappedTree-SetSet) |
module Language.Parser.Number where
import qualified Text.ParserCombinators.Parsec as P
import Language.Definition
import qualified Language.Number as N
import qualified Numeric
import qualified Data.Ratio as Ratio
import qualified Data.Complex as C
parse :: P.Parser LispVal
parse = P.try complex P.<|> P.try rational P.<|> P.try float P.<|> decimal1 P.<|> (P.char '#' >> (decimal2 P.<|> hex P.<|> oct P.<|> bin))
-- simple implementation
-- parse = M.liftM (Number . read) $ P.many1 P.digit
--
-- 'do' notation
-- parse :: P.Parser LispVal
-- parse = do
-- x <- P.many1 P.digit
-- return $ Number . read $ x
-- >>=
-- parse :: P.Parser LispVal
-- parse = P.many1 P.digit >>= return . Number . read
decimal1 :: P.Parser LispVal
decimal1 = P.many1 P.digit >>= (return . Number . read)
decimal2 :: P.Parser LispVal
-- decimal2 = do try $
decimal2 = do P.string "d"
x <- P.many1 P.digit
(return . Number . read) $ x
hex :: P.Parser LispVal
-- hex = do try $ string "#x"
hex = do P.string "x"
x <- P.many1 P.hexDigit
return $ Number (N.hex2dec x)
oct :: P.Parser LispVal
-- hex = do try $ string "#x"
oct = do P.string "o"
x <- P.many1 P.octDigit
return $ Number (N.oct2dec x)
bin :: P.Parser LispVal
-- hex = do try $ string "#x"
bin = do P.string "b"
x <- P.many1 (P.oneOf "10")
return $ Number (N.bin2dec x)
-- @todo: add support for precision
float :: P.Parser LispVal
float = do x <- P.many1 P.digit
P.char '.'
y <- P.many1 P.digit
return $ Float (fst . head $ Numeric.readFloat ( x ++ "." ++ y ) )
rational :: P.Parser LispVal
rational = do x <- P.many1 P.digit
P.char '/'
y <- P.many1 P.digit
return $ Ratio ((read x) Ratio.% (read y))
complex :: P.Parser LispVal
complex = do x <- (P.try float P.<|> decimal1)
P.char '+'
y <- (P.try float P.<|> decimal1)
P.char 'i'
return $ Complex (N.toDouble x C.:+ N.toDouble y)
|
[STATEMENT]
lemma right_total_comm_monoid_add_transfer[transfer_rule]:
includes lifting_syntax
assumes [transfer_rule]: "right_total A" "bi_unique A"
shows
"((A ===> A ===> A) ===> A ===> (=))
(comm_monoid_add_on_with (Collect (Domainp A))) class.comm_monoid_add"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ((A ===> A ===> A) ===> A ===> (=)) (comm_monoid_add_on_with (Collect (Domainp A))) class.comm_monoid_add
[PROOF STEP]
proof (intro rel_funI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<And>x y xa ya. \<lbrakk>(A ===> A ===> A) x y; A xa ya\<rbrakk> \<Longrightarrow> comm_monoid_add_on_with (Collect (Domainp A)) x xa = class.comm_monoid_add y ya
[PROOF STEP]
fix p p' z z'
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<And>x y xa ya. \<lbrakk>(A ===> A ===> A) x y; A xa ya\<rbrakk> \<Longrightarrow> comm_monoid_add_on_with (Collect (Domainp A)) x xa = class.comm_monoid_add y ya
[PROOF STEP]
assume [transfer_rule]: "(A ===> A ===> A) p p'" "A z z'"
[PROOF STATE]
proof (state)
this:
(A ===> A ===> A) p p'
A z z'
goal (1 subgoal):
1. \<And>x y xa ya. \<lbrakk>(A ===> A ===> A) x y; A xa ya\<rbrakk> \<Longrightarrow> comm_monoid_add_on_with (Collect (Domainp A)) x xa = class.comm_monoid_add y ya
[PROOF STEP]
show "comm_monoid_add_on_with (Collect (Domainp A)) p z = class.comm_monoid_add p' z'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. comm_monoid_add_on_with (Collect (Domainp A)) p z = class.comm_monoid_add p' z'
[PROOF STEP]
unfolding class.comm_monoid_add_def class.comm_monoid_add_axioms_def comm_monoid_add_on_with_Ball_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (ab_semigroup_add_on_with (Collect (Domainp A)) p \<and> (\<forall>a\<in>Collect (Domainp A). p z a = a) \<and> z \<in> Collect (Domainp A)) = (class.ab_semigroup_add p' \<and> (\<forall>a. p' z' a = a))
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (ab_semigroup_add_on_with (Collect (Domainp A)) p \<and> (\<forall>a\<in>Collect (Domainp A). p z a = a) \<and> z \<in> Collect (Domainp A)) = (ab_semigroup_add_on_with (Collect (Domainp A)) p \<and> (\<forall>a\<in>Collect (Domainp A). p z a = a))
[PROOF STEP]
using \<open>A z z'\<close>
[PROOF STATE]
proof (prove)
using this:
A z z'
goal (1 subgoal):
1. (ab_semigroup_add_on_with (Collect (Domainp A)) p \<and> (\<forall>a\<in>Collect (Domainp A). p z a = a) \<and> z \<in> Collect (Domainp A)) = (ab_semigroup_add_on_with (Collect (Domainp A)) p \<and> (\<forall>a\<in>Collect (Domainp A). p z a = a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
comm_monoid_add_on_with (Collect (Domainp A)) p z = class.comm_monoid_add p' z'
goal:
No subgoals!
[PROOF STEP]
qed |
---------------------------------------------------------------------------------
-- |
-- Utility functions for matrix operations
---------------------------------------------------------------------------------
module Utils where
import Numeric.LinearAlgebra (Container, Element, Matrix, R, cmap,
sumElements)
import Prelude (Num, Ord, (**), (.), (*), (-), abs, flip,
max, signum)
frobeniusNorm :: Matrix R -> R
frobeniusNorm = flip (**) 0.5 . sumElements . cmap ((flip (**) 2) . abs)
absL1Norm :: Matrix R -> R
absL1Norm = sumElements . cmap abs
softThreshold
:: (Ord e, Num e, Element e, Container c e)
=> c e
-> e
-> c e
softThreshold xs mu' = cmap f xs
where f x = (signum x) * max ((abs x) - mu') 0
|
//
// logging.cpp
// csvsqldb
//
// BSD 3-Clause License
// Copyright (c) 2015, Lars-Christian Fürstenberg
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted
// provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of
// conditions and the following disclaimer in the documentation and/or other materials provided
// with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
#include "global_configuration.h"
#include "log_devices.h"
#include "logging.h"
#include "string_helper.h"
#include <boost/regex.hpp>
#include <memory>
#include <vector>
namespace csvsqldb
{
typedef std::shared_ptr<LogDevice> LogDevicePtr;
LogDevice::~LogDevice()
{
}
void LogDevice::log(const LogEvent& event)
{
std::string separator = config<GlobalConfiguration>()->logging.separator;
std::ostringstream os;
os << event._time << separator;
os << event._categorie << separator;
os << event._tid << separator;
if(!event._classname.empty()) {
os << event._classname << separator;
}
if(config<GlobalConfiguration>()->logging.escape_newline) {
boost::regex exp("\n|\r");
os << regex_replace(event._message, exp, std::string("\\n"));
} else {
os << event._message;
}
if(!event._file.empty()) {
os << separator << event._file << ":" << event._line;
}
os << std::endl;
doLog(os);
}
struct LogDeviceFactory {
LogDevicePtr create(const std::string& device) const
{
if(device == "Console") {
return std::make_shared<ConsoleLogDevice>();
} else if(device == "None") {
return LogDevicePtr();
} else {
throw Exception("unknown log device " + device);
}
}
};
static LogDevicePtr s_logDevice;
void Logging::init()
{
s_logDevice = LogDeviceFactory().create(config<GlobalConfiguration>()->logging.device);
}
void Logging::log(const LogEvent& event)
{
static std::mutex _serializeLog;
if(s_logDevice) {
std::unique_lock<std::mutex> guard(_serializeLog);
s_logDevice->log(event);
}
}
}
|
Formal statement is: lemma measure_Union: "emeasure M A \<noteq> \<infinity> \<Longrightarrow> emeasure M B \<noteq> \<infinity> \<Longrightarrow> A \<in> sets M \<Longrightarrow> B \<in> sets M \<Longrightarrow> A \<inter> B = {} \<Longrightarrow> measure M (A \<union> B) = measure M A + measure M B" Informal statement is: If $A$ and $B$ are disjoint measurable sets with finite measure, then the measure of their union is the sum of their measures. |
[STATEMENT]
lemma inext_cut_less_conv: "inext n I < t \<Longrightarrow> inext n (I \<down>< t) = inext n I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. inext n I < t \<Longrightarrow> inext n (I \<down>< t) = inext n I
[PROOF STEP]
apply (frule le_less_trans[OF inext_mono])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>inext n I < t; n < t\<rbrakk> \<Longrightarrow> inext n (I \<down>< t) = inext n I
[PROOF STEP]
apply (case_tac "n \<in> I")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
1. \<lbrakk>inext n I < t; n < t; n \<in> I\<rbrakk> \<Longrightarrow> inext n (I \<down>< t) = inext n I
2. \<lbrakk>inext n I < t; n < t; n \<notin> I\<rbrakk> \<Longrightarrow> inext n (I \<down>< t) = inext n I
[PROOF STEP]
apply (simp add: inext_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
1. \<lbrakk>(if I \<down>> n \<noteq> {} then iMin (I \<down>> n) else n) < t; n < t; n \<in> I\<rbrakk> \<Longrightarrow> (n \<in> I \<down>< t \<and> I \<down>< t \<down>> n \<noteq> {} \<longrightarrow> (I \<down>> n \<noteq> {} \<longrightarrow> iMin (I \<down>< t \<down>> n) = iMin (I \<down>> n)) \<and> (I \<down>> n = {} \<longrightarrow> iMin (I \<down>< t \<down>> n) = n)) \<and> ((n \<in> I \<down>< t \<longrightarrow> I \<down>< t \<down>> n = {}) \<longrightarrow> I \<down>> n \<noteq> {} \<longrightarrow> n = iMin (I \<down>> n))
2. \<lbrakk>inext n I < t; n < t; n \<notin> I\<rbrakk> \<Longrightarrow> inext n (I \<down>< t) = inext n I
[PROOF STEP]
apply (simp add: i_cut_commute_disj[of "(\<down><)" "(\<down>>)"] cut_less_mem_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
1. \<lbrakk>(if I \<down>> n \<noteq> {} then iMin (I \<down>> n) else n) < t; n < t; n \<in> I\<rbrakk> \<Longrightarrow> (I \<down>> n \<down>< t \<noteq> {} \<longrightarrow> (I \<down>> n \<noteq> {} \<longrightarrow> iMin (I \<down>> n \<down>< t) = iMin (I \<down>> n)) \<and> (I \<down>> n = {} \<longrightarrow> iMin ({} \<down>< t) = n)) \<and> (I \<down>> n \<down>< t = {} \<longrightarrow> I \<down>> n \<noteq> {} \<longrightarrow> n = iMin (I \<down>> n))
2. \<lbrakk>inext n I < t; n < t; n \<notin> I\<rbrakk> \<Longrightarrow> inext n (I \<down>< t) = inext n I
[PROOF STEP]
apply (case_tac "I \<down>> n \<noteq> {}")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
1. \<lbrakk>(if I \<down>> n \<noteq> {} then iMin (I \<down>> n) else n) < t; n < t; n \<in> I; I \<down>> n \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<down>> n \<down>< t \<noteq> {} \<longrightarrow> (I \<down>> n \<noteq> {} \<longrightarrow> iMin (I \<down>> n \<down>< t) = iMin (I \<down>> n)) \<and> (I \<down>> n = {} \<longrightarrow> iMin ({} \<down>< t) = n)) \<and> (I \<down>> n \<down>< t = {} \<longrightarrow> I \<down>> n \<noteq> {} \<longrightarrow> n = iMin (I \<down>> n))
2. \<lbrakk>(if I \<down>> n \<noteq> {} then iMin (I \<down>> n) else n) < t; n < t; n \<in> I; \<not> I \<down>> n \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<down>> n \<down>< t \<noteq> {} \<longrightarrow> (I \<down>> n \<noteq> {} \<longrightarrow> iMin (I \<down>> n \<down>< t) = iMin (I \<down>> n)) \<and> (I \<down>> n = {} \<longrightarrow> iMin ({} \<down>< t) = n)) \<and> (I \<down>> n \<down>< t = {} \<longrightarrow> I \<down>> n \<noteq> {} \<longrightarrow> n = iMin (I \<down>> n))
3. \<lbrakk>inext n I < t; n < t; n \<notin> I\<rbrakk> \<Longrightarrow> inext n (I \<down>< t) = inext n I
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (3 subgoals):
1. \<lbrakk>iMin (I \<down>> n) < t; n < t; n \<in> I; I \<down>> n \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<down>> n \<down>< t \<noteq> {} \<longrightarrow> iMin (I \<down>> n \<down>< t) = iMin (I \<down>> n)) \<and> (I \<down>> n \<down>< t = {} \<longrightarrow> n = iMin (I \<down>> n))
2. \<lbrakk>(if I \<down>> n \<noteq> {} then iMin (I \<down>> n) else n) < t; n < t; n \<in> I; \<not> I \<down>> n \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<down>> n \<down>< t \<noteq> {} \<longrightarrow> (I \<down>> n \<noteq> {} \<longrightarrow> iMin (I \<down>> n \<down>< t) = iMin (I \<down>> n)) \<and> (I \<down>> n = {} \<longrightarrow> iMin ({} \<down>< t) = n)) \<and> (I \<down>> n \<down>< t = {} \<longrightarrow> I \<down>> n \<noteq> {} \<longrightarrow> n = iMin (I \<down>> n))
3. \<lbrakk>inext n I < t; n < t; n \<notin> I\<rbrakk> \<Longrightarrow> inext n (I \<down>< t) = inext n I
[PROOF STEP]
apply (metis cut_less_Min_eq cut_less_Min_not_empty)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
1. \<lbrakk>(if I \<down>> n \<noteq> {} then iMin (I \<down>> n) else n) < t; n < t; n \<in> I; \<not> I \<down>> n \<noteq> {}\<rbrakk> \<Longrightarrow> (I \<down>> n \<down>< t \<noteq> {} \<longrightarrow> (I \<down>> n \<noteq> {} \<longrightarrow> iMin (I \<down>> n \<down>< t) = iMin (I \<down>> n)) \<and> (I \<down>> n = {} \<longrightarrow> iMin ({} \<down>< t) = n)) \<and> (I \<down>> n \<down>< t = {} \<longrightarrow> I \<down>> n \<noteq> {} \<longrightarrow> n = iMin (I \<down>> n))
2. \<lbrakk>inext n I < t; n < t; n \<notin> I\<rbrakk> \<Longrightarrow> inext n (I \<down>< t) = inext n I
[PROOF STEP]
apply (simp add: i_cut_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>inext n I < t; n < t; n \<notin> I\<rbrakk> \<Longrightarrow> inext n (I \<down>< t) = inext n I
[PROOF STEP]
apply (simp add: not_in_inext_fix cut_less_not_in_imp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done |
Euler Problem 60
================
The primes 3, 7, 109, and 673, are quite remarkable. By taking any two primes and concatenating them in any order the result will always be prime. For example, taking 7 and 109, both 7109 and 1097 are prime. The sum of these four primes, 792, represents the lowest sum for a set of four primes with this property.
Find the lowest sum for a set of five primes for which any two primes concatenate to produce another prime.
```python
from time import time
start = time()
from sympy import primerange, isprime
primes = list(primerange(2, 50000))
N = len(primes)
minsum = 1e100
def concat(p, q):
return int(f'{p}{q}')
def edge(p, q):
if (p,q) in E:
return E[p,q]
answer = isprime(concat(p,q)) and isprime(concat(q,p))
E[p,q] = answer
return answer
cliques = [([], 0)]
for p in primes:
E = {}
if p >= minsum:
break
new_cliques = []
for clique, weight in cliques:
if all(edge(p,q) for q in clique):
new_clique = clique + [p]
if len(new_clique) == 5:
minsum = min(minsum, weight + p)
new_cliques.append((new_clique, weight + p))
cliques.extend(new_cliques)
print(minsum)
print("Time: %.2f seconds" % (time() - start))
```
26033
Time: 293.43 seconds
```python
```
|
module Data.Profunctor.Choice
import Data.Profunctor.Class
import Data.Morphisms
public export
interface Profunctor p => Choice (0 p : Type -> Type -> Type) where
left' : p a b -> p (Either a c) (Either b c)
left' = dimap (either Right Left) (either Right Left) . right'
right' : p a b -> p (Either c a) (Either c b)
right' = dimap (either Right Left) (either Right Left) . left'
public export
Choice Morphism where
left' (Mor f) = Mor g
where g : Either a c -> Either b c
g (Left a) = Left (f a)
g (Right c) = Right c
right' (Mor f) = Mor g
where g : Either c a -> Either c b
g (Left c) = Left c
g (Right a) = Right (f a)
|
(*
Copyright 2014 Cornell University
This file is part of VPrl (the Verified Nuprl project).
VPrl is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
VPrl is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with VPrl. Ifnot, see <http://www.gnu.org/licenses/>.
Website: http://nuprl.org/html/verification/
Authors: Abhishek Anand & Vincent Rahli
*)
Require Export Coq.Logic.ConstructiveEpsilon.
Require Export stronger_continuity_defs.
Require Export stronger_continuity_defs0.
Require Export per_props_atom.
Require Export terms5.
Lemma equality_mkc_union_tnat_unit {o} :
forall lib (a b : @CTerm o),
equality lib a b (mkc_union mkc_tnat mkc_unit)
<=>
({k : nat
, ccequivc lib a (mkc_inl (mkc_nat k))
# ccequivc lib b (mkc_inl (mkc_nat k))}
{+}
(ccequivc lib a (mkc_inr mkc_axiom)
# ccequivc lib b (mkc_inr mkc_axiom))).
Proof.
introv.
rw @equality_mkc_union.
split; intro k; exrepnd; repndors; exrepnd; spcast; dands; eauto 3 with slow.
- allrw @equality_in_tnat.
allunfold @equality_of_nat; exrepnd; spcast.
left.
exists k; dands; spcast.
+ eapply cequivc_trans;[apply computes_to_valc_implies_cequivc; exact k2|].
apply cequivc_mkc_inl_if.
apply computes_to_valc_implies_cequivc; auto.
+ eapply cequivc_trans;[apply computes_to_valc_implies_cequivc; exact k4|].
apply cequivc_mkc_inl_if.
apply computes_to_valc_implies_cequivc; auto.
- allrw @equality_in_unit; repnd; spcast.
right; dands; spcast.
+ eapply cequivc_trans;[apply computes_to_valc_implies_cequivc; exact k2|].
apply cequivc_mkc_inr_if.
apply computes_to_valc_implies_cequivc; auto.
+ eapply cequivc_trans;[apply computes_to_valc_implies_cequivc; exact k4|].
apply cequivc_mkc_inr_if.
apply computes_to_valc_implies_cequivc; auto.
- left.
apply cequivc_sym in k2; apply cequivc_mkc_inl_implies in k2.
apply cequivc_sym in k1; apply cequivc_mkc_inl_implies in k1.
exrepnd.
exists b1 b0; dands; spcast; auto.
eapply equality_respects_cequivc_left;[exact k4|].
eapply equality_respects_cequivc_right;[exact k3|].
apply equality_in_tnat.
unfold equality_of_nat.
exists k0; dands; spcast; auto;
apply computes_to_valc_refl; eauto 3 with slow.
- right.
apply cequivc_sym in k0; apply cequivc_mkc_inr_implies in k0.
apply cequivc_sym in k; apply cequivc_mkc_inr_implies in k.
exrepnd.
exists b1 b0; dands; spcast; auto.
eapply equality_respects_cequivc_left;[exact k3|].
eapply equality_respects_cequivc_right;[exact k1|].
apply equality_in_unit.
dands; spcast;
apply computes_to_valc_refl; eauto 3 with slow.
Qed.
Lemma equality_in_mkc_texc {o} :
forall lib (a b N E : @CTerm o),
equality lib a b (mkc_texc N E)
<=> {n1 : CTerm
, {n2 : CTerm
, {e1 : CTerm
, {e2 : CTerm
, a ===e>(lib,n1) e1
# b ===e>(lib,n2) e2
# equality lib n1 n2 N
# equality lib e1 e2 E }}}}.
Proof.
introv.
split; introv k; exrepnd; spcast.
- unfold equality in k; exrepnd.
inversion k1; subst; try not_univ.
clear k1.
match goal with
| [ H : per_texc _ _ _ _ _ |- _ ] => rename H into p
end.
allunfold @per_texc; exrepnd; spcast; computes_to_value_isvalue.
apply p1 in k0.
unfold per_texc_eq in k0; exrepnd; spcast.
exists n1 n2 e1 e2; dands; spcast; auto.
+ eapply eq_equality1; eauto.
+ eapply eq_equality1; eauto.
- allunfold @equality; exrepnd.
rename eq0 into eqn.
rename eq into eqe.
exists (per_texc_eq lib eqn eqe).
dands; auto.
+ apply CL_texc.
unfold per_texc.
exists eqn eqe N N E E.
dands; spcast; auto;
try (apply computes_to_valc_refl; apply iscvalue_mkc_texc).
+ unfold per_texc_eq.
exists n1 n2 e1 e2; dands; spcast; auto.
Qed.
Lemma tequality_mkc_texc {o} :
forall lib (N1 E1 N2 E2 : @CTerm o),
tequality lib (mkc_texc N1 E1) (mkc_texc N2 E2)
<=> (tequality lib N1 N2 # tequality lib E1 E2).
Proof.
introv; split; intro teq; repnd.
- unfold tequality in teq; exrepnd.
inversion teq0; try not_univ; allunfold @per_texc; exrepnd.
computes_to_value_isvalue; sp; try (complete (spcast; sp)).
+ exists eqn; sp.
+ exists eqe; sp.
- unfold tequality in teq0; exrepnd.
rename eq into eqn.
unfold tequality in teq; exrepnd.
rename eq into eqe.
exists (per_texc_eq lib eqn eqe); apply CL_texc; unfold per_texc.
exists eqn eqe N1 N2 E1 E2; sp; spcast;
try (apply computes_to_valc_refl; apply iscvalue_mkc_texc).
Qed.
Lemma disjoint_nat_exc {o} :
forall lib (a b : @CTerm o),
disjoint_types lib mkc_tnat (mkc_texc a b).
Proof.
introv mem; repnd.
allrw @equality_in_tnat.
allunfold @equality_of_nat; exrepnd; spcast; GC.
allrw @equality_in_mkc_texc; exrepnd; spcast.
eapply computes_to_valc_and_excc_false in mem0; eauto.
Qed.
Lemma tequality_mkc_singleton_uatom {o} :
forall lib (n1 n2 : @get_patom_set o),
tequality lib (mkc_singleton_uatom n1) (mkc_singleton_uatom n2)
<=> n1 = n2.
Proof.
introv.
unfold mkc_singleton_uatom.
rw @tequality_set; split; introv k; repnd; subst; tcsp.
- clear k0.
pose proof (k (mkc_utoken n1) (mkc_utoken n1)) as h; clear k.
autodimp h hyp.
{ apply equality_in_uatom_iff.
exists n1; dands; spcast;
try (apply computes_to_valc_refl; apply iscvalue_mkc_utoken). }
allrw @mkcv_cequiv_substc.
allrw @mkc_var_substc.
allrw @mkcv_utoken_substc.
allrw @tequality_mkc_cequiv.
destruct h as [h h2]; clear h2.
autodimp h hyp; spcast; eauto 3 with slow.
allrw @cequivc_mkc_utoken; auto.
- dands;[apply tequality_uatom|].
introv e.
apply equality_in_uatom_iff in e; exrepnd; spcast.
allrw @mkcv_cequiv_substc.
allrw @mkc_var_substc.
allrw @mkcv_utoken_substc.
allrw @tequality_mkc_cequiv.
allapply @computes_to_valc_implies_cequivc.
split; intro k; spcast.
+ eapply cequivc_trans in k;[|apply cequivc_sym;exact e1].
allrw @cequivc_mkc_utoken; subst; auto.
+ eapply cequivc_trans in k;[|apply cequivc_sym;exact e0].
allrw @cequivc_mkc_utoken; subst; auto.
Qed.
Lemma tequality_mkc_ntexc {o} :
forall lib n1 n2 (E1 E2 : @CTerm o),
tequality lib (mkc_ntexc n1 E1) (mkc_ntexc n2 E2)
<=> (n1 = n2 # tequality lib E1 E2).
Proof.
introv.
unfold mkc_ntexc.
rw @tequality_mkc_texc.
rw @tequality_mkc_singleton_uatom; auto.
Qed.
Lemma type_mkc_ntexc {o} :
forall lib n (E : @CTerm o),
type lib (mkc_ntexc n E) <=> (type lib E).
Proof.
introv.
rw @tequality_mkc_ntexc; split; sp.
Qed.
Lemma inhabited_type_mkc_cequiv {o} :
forall lib (t1 t2 : @CTerm o),
inhabited_type lib (mkc_cequiv t1 t2) <=> ccequivc lib t1 t2.
Proof.
introv.
unfold inhabited_type; split; introv k; exrepnd.
- allunfold @member; allunfold @equality; allunfold @nuprl; exrepnd.
inversion k0; subst; try not_univ.
allunfold @per_cequiv; sp.
uncast; computes_to_value_isvalue.
discover; sp.
- exists (@mkc_axiom o).
apply member_cequiv_iff; auto.
Qed.
Lemma equality_in_mkc_singleton_uatom {o} :
forall lib a b (n : @get_patom_set o),
equality lib a b (mkc_singleton_uatom n)
<=> (a ===>(lib) (mkc_utoken n) # b ===>(lib) (mkc_utoken n)).
Proof.
introv.
unfold mkc_singleton_uatom.
rw @equality_in_set.
allrw @mkcv_cequiv_substc.
allrw @mkc_var_substc.
allrw @mkcv_utoken_substc.
allrw @inhabited_type_mkc_cequiv.
allrw @equality_in_uatom_iff.
split; intro k; exrepnd; spcast; dands; tcsp.
- eapply close_type_sys_per_ffatom.cequivc_utoken in k;[|exact k1].
apply computes_to_valc_isvalue_eq in k; try (eqconstr k); eauto 3 with slow.
dands; spcast; auto.
- eapply close_type_sys_per_ffatom.cequivc_utoken in k;[|exact k1].
apply computes_to_valc_isvalue_eq in k; try (eqconstr k); eauto 3 with slow.
dands; spcast; auto.
- introv e.
allrw @mkcv_cequiv_substc.
allrw @mkc_var_substc.
allrw @mkcv_utoken_substc.
allrw @equality_in_uatom_iff; exrepnd; spcast.
apply tequality_mkc_cequiv.
allapply @computes_to_valc_implies_cequivc.
split; intro h; spcast.
+ eapply cequivc_trans in h;[|apply cequivc_sym;exact e1].
allrw @cequivc_mkc_utoken; subst; auto.
+ eapply cequivc_trans in h;[|apply cequivc_sym;exact e0].
allrw @cequivc_mkc_utoken; subst; auto.
- exists n; dands; spcast; auto.
- spcast.
allapply @computes_to_valc_implies_cequivc; auto.
Qed.
Lemma equality_in_mkc_ntexc {o} :
forall lib n (a b E : @CTerm o),
equality lib a b (mkc_ntexc n E)
<=> {n1 : CTerm
, {n2 : CTerm
, {e1 : CTerm
, {e2 : CTerm
, n1 ===>(lib) (mkc_utoken n)
# n2 ===>(lib) (mkc_utoken n)
# a ===e>(lib,n1) e1
# b ===e>(lib,n2) e2
# equality lib e1 e2 E }}}}.
Proof.
introv.
rw @equality_in_mkc_texc; split; intro k; exrepnd; spcast.
- allrw @equality_in_mkc_singleton_uatom; repnd; spcast.
exists n1 n2 e1 e2; dands; spcast; auto.
- exists n1 n2 e1 e2; dands; spcast; auto.
allrw @equality_in_mkc_singleton_uatom; dands; spcast; auto.
Qed.
Lemma equality_in_natE {o} :
forall lib n (a b : @CTerm o),
equality lib a b (natE n)
<=> (equality_of_nat lib a b
{+} (ccequivc lib a (spexcc n) # ccequivc lib b (spexcc n))).
Proof.
introv.
unfold natE, with_nexc_c.
pose proof (equality_in_disjoint_bunion lib a b mkc_tnat (mkc_ntexc n mkc_unit)) as h.
autodimp h hyp.
{ unfold mkc_ntexc; apply disjoint_nat_exc. }
rw h; clear h.
rw @type_mkc_ntexc.
split; intro k; repnd; dands; eauto 3 with slow; repndors; tcsp;
allrw @equality_in_tnat;
allrw @equality_in_mkc_ntexc;
exrepnd; spcast; tcsp;
allrw @equality_in_unit;
repnd; spcast.
- allapply @computes_to_excc_implies_cequivc.
allapply @computes_to_valc_implies_cequivc.
right; dands; spcast.
+ eapply cequivc_trans;[exact k5|].
unfold spexc.
apply cequivc_mkc_exception; auto.
+ eapply cequivc_trans;[exact k6|].
unfold spexc.
apply cequivc_mkc_exception; auto.
- left; allrw @equality_in_tnat; auto.
- right; allrw @equality_in_mkc_ntexc.
allunfold @spexc.
apply cequivc_sym in k0; apply cequivc_sym in k.
apply cequivc_exception_implies in k0.
apply cequivc_exception_implies in k.
exrepnd.
allapply @cequivc_axiom_implies.
allapply @cequivc_utoken_implies.
exists x0 x c0 c; dands; spcast; auto.
allrw @equality_in_unit; dands; spcast; auto.
Qed.
Lemma equality_in_tnat_nat {o} :
forall (lib : @library o) n, equality lib (mkc_nat n) (mkc_nat n) mkc_tnat.
Proof.
introv.
apply equality_in_tnat; unfold equality_of_nat; exists n.
dands; spcast; apply computes_to_valc_refl; eauto 3 with slow.
Qed.
Hint Resolve equality_in_tnat_nat : slow.
Definition equality_of_nat_tt {o} lib (n m : @CTerm o) :=
{k : nat & computes_to_valc lib n (mkc_nat k)
# computes_to_valc lib m (mkc_nat k)}.
Lemma dec_reduces_ksteps_excc {o} :
forall lib k (t v : @CTerm o),
(forall x, decidable (x = get_cterm v))
-> decidable (reduces_ksteps_excc lib t v k).
Proof.
introv d.
destruct_cterms; allsimpl.
pose proof (dec_reduces_in_atmost_k_steps_exc lib k x0 x d) as h.
destruct h as [h|h];[left|right].
- spcast; tcsp.
- intro r; spcast; tcsp.
Qed.
Lemma reduces_ksteps_excc_spexcc_decompose {o} :
forall lib (k : nat) a (t : @CTerm o),
reduces_ksteps_excc lib t (spexcc a) k
-> {k1 : nat
& {k2 : nat
& {k3 : nat
& {a' : CTerm
& {e' : CTerm
& k1 + k2 + k3 <= k
# reduces_in_atmost_k_stepsc lib t (mkc_exception a' e') k1
# reduces_in_atmost_k_stepsc lib a' (mkc_utoken a) k2
# reduces_in_atmost_k_stepsc lib e' mkc_axiom k3 }}}}}.
Proof.
introv r.
pose proof (dec_reduces_in_atmost_k_steps_excc lib k t (spexcc a)) as h; allsimpl.
try (fold (spexc a) in h).
autodimp h hyp; eauto 3 with slow.
destruct h as [d|d].
- apply reduces_in_atmost_k_steps_excc_decompose in d; eauto 2 with slow.
- provefalse; spcast; sp.
Qed.
Lemma reduces_ksteps_excc_impossible1 {o} :
forall lib k1 k2 (t : @CTerm o) a n,
reduces_ksteps_excc lib t (spexcc a) k1
-> reduces_ksteps_excc lib t (mkc_nat n) k2
-> False.
Proof.
introv r1 r2; spcast.
eapply reduces_in_atmost_k_steps_excc_impossible1 in r1; eauto.
Qed.
Lemma dec_reduces_ksteps_excc_nat {o} :
forall lib k (t : @CTerm o),
decidable {n : nat & reduces_ksteps_excc lib t (mkc_nat n) k}.
Proof.
introv; destruct_cterms; allsimpl.
pose proof (dec_reduces_in_atmost_k_steps_exc_nat lib k x) as h.
destruct h as [h|h];[left|right].
- exrepnd; exists n; spcast; tcsp.
- intro r; exrepnd; destruct h; exists n; spcast; tcsp.
Qed.
Lemma equality_in_natE_implies {o} :
forall lib (t u : @CTerm o) a,
equality lib t u (natE a)
-> equality_of_nat_tt lib t u
[+] (cequivc lib t (spexcc a) # cequivc lib u (spexcc a)).
Proof.
introv equ.
assert {k : nat
, {m : nat
, (reduces_ksteps_excc lib t (mkc_nat m) k
# reduces_ksteps_excc lib u (mkc_nat m) k)
{+} (reduces_ksteps_excc lib t (spexcc a) k
# reduces_ksteps_excc lib u (spexcc a) k)}} as j.
{ apply equality_in_natE in equ.
repndors.
- unfold equality_of_nat in equ; exrepnd; spcast.
allrw @computes_to_valc_iff_reduces_in_atmost_k_stepsc; exrepnd.
exists (Peano.max k0 k1) k.
left; dands; spcast.
+ apply (reduces_in_atmost_k_stepsc_le _ _ _ _ (Peano.max k0 k1)) in equ4; eauto 3 with slow;
try (apply Nat.le_max_l; auto).
apply reduces_in_atmost_k_steps_excc_can in equ4; tcsp.
+ apply (reduces_in_atmost_k_stepsc_le _ _ _ _ (Peano.max k0 k1)) in equ2; eauto 3 with slow;
try (apply Nat.le_max_r; auto).
apply reduces_in_atmost_k_steps_excc_can in equ2; tcsp.
- repnd; spcast.
apply cequivc_spexcc in equ0.
apply cequivc_spexcc in equ.
exrepnd.
allrw @computes_to_valc_iff_reduces_in_atmost_k_stepsc; exrepnd.
allrw @computes_to_excc_iff_reduces_in_atmost_k_stepsc; exrepnd.
exists (Peano.max (k3 + k + k0) (k4 + k1 + k2)) 0.
right; dands; spcast.
+ apply (reduces_in_atmost_k_steps_excc_le_exc _ (k3 + k + k0));
eauto 3 with slow; tcsp;
try (apply Nat.le_max_l; auto).
pose proof (reduces_in_atmost_k_steps_excc_exception
lib k k0 n0 e0 (mkc_utoken a) mkc_axiom) as h.
repeat (autodimp h hyp); tcsp; exrepnd.
pose proof (reduces_in_atmost_k_steps_excc_trans2
lib k3 i
t
(mkc_exception n0 e0)
(mkc_exception (mkc_utoken a) mkc_axiom)) as q.
repeat (autodimp q hyp); exrepnd.
apply (reduces_in_atmost_k_steps_excc_le_exc _ i0); tcsp; try omega.
+ apply (reduces_in_atmost_k_steps_excc_le_exc _ (k4 + k1 + k2));
eauto 3 with slow; tcsp;
try (apply Nat.le_max_r; auto).
pose proof (reduces_in_atmost_k_steps_excc_exception
lib k1 k2 n e (mkc_utoken a) mkc_axiom) as h.
repeat (autodimp h hyp); tcsp; exrepnd.
pose proof (reduces_in_atmost_k_steps_excc_trans2
lib k4 i
u
(mkc_exception n e)
(mkc_exception (mkc_utoken a) mkc_axiom)) as q.
repeat (autodimp q hyp); exrepnd.
apply (reduces_in_atmost_k_steps_excc_le_exc _ i0); tcsp; try omega.
}
apply (constructive_indefinite_ground_description nat (fun x => x) (fun x => x))
in j; auto.
{ exrepnd.
apply (constructive_indefinite_ground_description nat (fun x => x) (fun x => x))
in j0; auto.
- exrepnd.
pose proof (dec_reduces_ksteps_excc lib x t (mkc_nat x0)) as h.
autodimp h hyp; simpl; eauto 3 with slow.
pose proof (dec_reduces_ksteps_excc lib x t (spexcc a)) as q.
autodimp q hyp; simpl; try (fold (spexc a)); eauto 3 with slow.
pose proof (dec_reduces_ksteps_excc lib x u (mkc_nat x0)) as j.
autodimp j hyp; simpl; eauto 3 with slow.
pose proof (dec_reduces_ksteps_excc lib x u (spexcc a)) as l.
autodimp l hyp; simpl; try (fold (spexc a)); eauto 3 with slow.
destruct h as [h|h];
destruct q as [q|q];
destruct j as [j|j];
destruct l as [l|l];
try (complete (eapply reduces_ksteps_excc_impossible1 in h;[|exact q]; tcsp));
try (complete (eapply reduces_ksteps_excc_impossible1 in j;[|exact l]; eauto; tcsp));
try (complete (provefalse; repndors; repnd; tcsp)).
{ left; exists x0; dands; split; simpl; eauto 3 with slow; exists x; spcast;
apply reduces_in_atmost_k_steps_excc_can_implies in h;
apply reduces_in_atmost_k_steps_excc_can_implies in j;
allunfold @reduces_in_atmost_k_stepsc; allsimpl;
allrw @get_cterm_apply; tcsp. }
{ right.
apply reduces_ksteps_excc_spexcc_decompose in q.
apply reduces_ksteps_excc_spexcc_decompose in l.
exrepnd.
allunfold @reduces_in_atmost_k_stepsc; allsimpl.
allrw @get_cterm_apply; allsimpl.
allrw @get_cterm_mkc_exception; allsimpl.
dands;
apply cequiv_spexc_if;
try (apply isprog_apply);
try (apply isprog_mk_nat);
eauto 3 with slow.
- exists (get_cterm a'0) (get_cterm e'0); dands; eauto 3 with slow.
unfold computes_to_exception; exists k0; auto.
- exists (get_cterm a') (get_cterm e'); dands; eauto 3 with slow.
unfold computes_to_exception; exists k1; auto. }
- clear j0.
introv.
pose proof (dec_reduces_ksteps_excc lib x t (mkc_nat x0)) as h.
autodimp h hyp; simpl; eauto 3 with slow.
pose proof (dec_reduces_ksteps_excc lib x t (spexcc a)) as q.
autodimp q hyp; simpl; try (fold (spexc a)); eauto 3 with slow.
pose proof (dec_reduces_ksteps_excc lib x u (mkc_nat x0)) as j.
autodimp j hyp; simpl; eauto 3 with slow.
pose proof (dec_reduces_ksteps_excc lib x u (spexcc a)) as l.
autodimp l hyp; simpl; try (fold (spexc a)); eauto 3 with slow.
destruct h as [h|h];
destruct q as [q|q];
destruct j as [j|j];
destruct l as [l|l];
tcsp;
try (complete (right; intro xx; repndors; repnd; tcsp)).
}
{ clear j; introv.
pose proof (dec_reduces_ksteps_excc_nat lib x t) as h.
pose proof (dec_reduces_ksteps_excc lib x t (spexcc a)) as q.
autodimp q hyp; simpl; try (fold (spexc a)); eauto 3 with slow.
pose proof (dec_reduces_ksteps_excc_nat lib x u) as j.
pose proof (dec_reduces_ksteps_excc lib x u (spexcc a)) as l.
autodimp l hyp; simpl; try (fold (spexc a)); eauto 3 with slow.
destruct h as [h|h];
destruct q as [q|q];
destruct j as [j|j];
destruct l as [l|l];
exrepnd;
try (destruct (deq_nat n0 n) as [d|d]); subst;
tcsp;
try (complete (eapply reduces_ksteps_excc_impossible1 in h0; eauto; tcsp));
try (complete (eapply reduces_ksteps_excc_impossible1 in j0; eauto; tcsp));
try (complete (provefalse; repndors; repnd; tcsp));
try (complete (right; intro xx; exrepnd; repndors; repnd; tcsp;
try (complete (destruct h; eexists; eauto));
try (complete (destruct j; eexists; eauto))));
try (complete (left; exists n; left; tcsp));
try (complete (left; exists 0; right; tcsp)).
right; intro xx; exrepnd; repndors; repnd; tcsp; spcast.
allunfold @reduces_in_atmost_k_steps_excc; allsimpl.
allunfold @reduces_in_atmost_k_steps_exc.
rw xx1 in h0.
rw xx0 in j0.
inversion h0.
inversion j0.
allapply Znat.Nat2Z.inj; subst; tcsp.
}
Qed.
Lemma tequality_with_nexc_c {o} :
forall lib a1 a2 (T1 T2 E1 E2 : @CTerm o),
tequality lib (with_nexc_c a1 T1 E1) (with_nexc_c a2 T2 E2)
<=> (a1 = a2 # tequality lib T1 T2 # tequality lib E1 E2).
Proof.
introv.
unfold with_nexc_c.
rw @tequality_bunion.
rw @tequality_mkc_texc.
rw @tequality_mkc_singleton_uatom.
split; sp.
Qed.
Lemma tequality_natE {o} :
forall lib (a1 a2 : @get_patom_set o),
tequality lib (natE a1) (natE a2) <=> a1 = a2.
Proof.
introv.
unfold natE.
rw @tequality_with_nexc_c.
allrw @fold_type.
split; intro k; repnd; dands; eauto with slow.
Qed.
Lemma type_natE {o} :
forall lib (a : @get_patom_set o),
type lib (natE a).
Proof.
introv.
rw @tequality_natE; auto.
Qed.
Hint Resolve type_natE : slow.
Lemma disjoint_nat_unit {o}:
forall (lib : @library o),
disjoint_types lib mkc_tnat mkc_unit.
Proof.
introv mem; repnd.
allrw @equality_in_tnat.
allrw @equality_in_unit.
allunfold @equality_of_nat; exrepnd; spcast; GC.
computes_to_eqval.
Qed.
Hint Resolve disjoint_nat_unit : slow.
Definition equality_of_nat2 {p} lib (t1 t2 : @CTerm p) :=
{j : nat
, {n : nat
, reduces_kstepsc lib t1 (mkc_nat n) j
# reduces_kstepsc lib t2 (mkc_nat n) j}}.
Lemma equality_of_nat_implies_nat2 {o} :
forall lib (t1 t2 : @CTerm o),
equality_of_nat lib t1 t2 -> equality_of_nat2 lib t1 t2.
Proof.
introv e.
unfold equality_of_nat in e; exrepnd; spcast.
allrw @computes_to_valc_iff_reduces_in_atmost_k_stepsc; exrepnd.
exists (Peano.max k1 k0); exists k; dands; spcast.
- eapply reduces_in_atmost_k_stepsc_le;[|idtac|exact e4]; auto;
apply Nat.le_max_r; auto.
- eapply reduces_in_atmost_k_stepsc_le;[|idtac|exact e2]; auto;
apply Nat.le_max_l; auto.
Qed.
Lemma equality_of_nat2_implies_nat {o} :
forall lib (t1 t2 : @CTerm o),
equality_of_nat2 lib t1 t2 -> equality_of_nat lib t1 t2.
Proof.
introv e.
unfold equality_of_nat2 in e; exrepnd; spcast.
exists n; dands; spcast;
apply computes_to_valc_iff_reduces_in_atmost_k_stepsc;
dands; eauto 3 with slow.
Qed.
Lemma dec_reduces_kstepsc {o} :
forall lib k (t v : @CTerm o),
(forall x, decidable (x = get_cterm v))
-> decidable (reduces_kstepsc lib t v k).
Proof.
introv d.
destruct_cterms; allsimpl.
pose proof (dec_reduces_in_atmost_k_steps lib k x0 x d) as h.
destruct h as [h|h];[left|right].
- spcast; tcsp.
- intro r; spcast; tcsp.
Qed.
Lemma equality_of_nat_imp_tt {o} :
forall lib (n m : @CTerm o),
equality_of_nat lib n m
-> equality_of_nat_tt lib n m.
Proof.
introv e.
unfold equality_of_nat_tt.
apply equality_of_nat_implies_nat2 in e.
unfold equality_of_nat2 in e.
apply (constructive_indefinite_ground_description nat (fun x => x) (fun x => x))
in e; auto.
- exrepnd.
apply (constructive_indefinite_ground_description nat (fun x => x) (fun x => x))
in e0; auto.
+ exrepnd.
exists x0; dands; auto;
apply computes_to_valc_iff_reduces_in_atmost_k_stepsc;
dands; eauto 3 with slow; exists x; spcast; auto.
+ clear e0.
introv.
pose proof (dec_reduces_kstepsc lib x n (mkc_nat x0)) as h; allsimpl.
autodimp h hyp; eauto 3 with slow.
pose proof (dec_reduces_kstepsc lib x m (mkc_nat x0)) as q; allsimpl.
autodimp q hyp; eauto 3 with slow.
destruct h as [h|h]; destruct q as [q|q]; tcsp;
try (complete (right; intro r; repnd; tcsp)).
- clear e.
introv.
remember (compute_at_most_k_steps lib x (get_cterm n)) as c1; symmetry in Heqc1.
remember (compute_at_most_k_steps lib x (get_cterm m)) as c2; symmetry in Heqc2.
destruct c1, c2.
+ destruct (decidable_ex_mk_nat n0) as [h|h]; exrepnd.
* rw h0 in Heqc1; clear h0.
destruct (decidable_ex_mk_nat n1) as [q|q]; exrepnd.
{ rw q0 in Heqc2; clear q0.
destruct (deq_nat n2 n3) as [d|d].
- subst.
left; exists n3; dands; spcast; auto.
- right; intro r; exrepnd; spcast.
allunfold @reduces_in_atmost_k_stepsc; allsimpl.
allunfold @reduces_in_atmost_k_steps.
rw Heqc1 in r1.
rw Heqc2 in r0.
inversion r1 as [c1].
inversion r0 as [c2].
allapply Znat.Nat2Z.inj; subst; tcsp.
}
{ right; intro r; exrepnd; spcast.
allunfold @reduces_in_atmost_k_stepsc; allsimpl.
allunfold @reduces_in_atmost_k_steps.
rw Heqc1 in r1.
rw Heqc2 in r0.
inversion r1 as [c1].
inversion r0 as [c2].
allapply Znat.Nat2Z.inj; subst; tcsp.
destruct q; exists n3; auto.
}
* right; intro r; exrepnd; spcast.
allunfold @reduces_in_atmost_k_stepsc; allsimpl.
allunfold @reduces_in_atmost_k_steps.
rw Heqc1 in r1.
rw Heqc2 in r0.
inversion r1 as [c1].
inversion r0 as [c2].
allapply Znat.Nat2Z.inj; subst; tcsp.
destruct h; exists n2; auto.
+ right; intro r; exrepnd; spcast.
allunfold @reduces_in_atmost_k_stepsc; allsimpl.
allunfold @reduces_in_atmost_k_steps.
rw Heqc1 in r1.
rw Heqc2 in r0.
ginv.
+ right; intro r; exrepnd; spcast.
allunfold @reduces_in_atmost_k_stepsc; allsimpl.
allunfold @reduces_in_atmost_k_steps.
rw Heqc1 in r1.
rw Heqc2 in r0.
ginv.
+ right; intro r; exrepnd; spcast.
allunfold @reduces_in_atmost_k_stepsc; allsimpl.
allunfold @reduces_in_atmost_k_steps.
rw Heqc1 in r1.
rw Heqc2 in r0.
ginv.
Qed.
Lemma member_bunion_nat_unit_implies_cis_spcan_not_atom {o} :
forall lib (t : @CTerm o) a,
member lib t (mkc_bunion mkc_tnat mkc_unit)
-> cis_spcan_not_atom lib t a.
Proof.
introv mem.
apply @equality_in_disjoint_bunion in mem; eauto 3 with slow.
repnd.
clear mem0 mem1.
repndors.
- apply equality_in_tnat in mem.
unfold equality_of_nat in mem; exrepnd; spcast.
exists (@mkc_nat o k); dands; spcast; simpl; tcsp.
- apply equality_in_unit in mem; repnd; spcast.
exists (@mkc_axiom o); dands; spcast; simpl; tcsp.
Qed.
(*
*** Local Variables:
*** coq-load-path: ("." "./close/")
*** End:
*)
|
Keanu Reeves and Drew Barrymore? YAY! 1986? NAY! The Nostalgia Critic takes a look at 1986’s Babe’s in Toyland.
honestly, Hindsight on the 20/20, this film to me is pretty bad.
I mean when I was way younger I thought it was sorta nice (like a freakin barny & friends special or somethin’). but looking at it now,.. I’m glad I didn’t even remember it for the longest while. I mean, given the chance, I’ll probably watch it again, for nostalgia sake,.. or because my niece/nephews don’t know how bad it is, are watching it. but other than that, I won’t even have a place reserved on a digital collection, much less a DVD or VHS collection.
This review is imo one of the best you’ve done. I just love the editing so much.
I could make a joke about the woman who works in weather being called Gale… but I’m better than that. Not by much though. |
/-
Copyright (c) 2022 Anatole Dedecker. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anatole Dedecker
! This file was ported from Lean 3 source module topology.algebra.module.locally_convex
! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.Analysis.Convex.Topology
/-!
# Locally convex topological modules
A `locally_convex_space` is a topological semimodule over an ordered semiring in which any point
admits a neighborhood basis made of convex sets, or equivalently, in which convex neighborhoods of
a point form a neighborhood basis at that point.
In a module, this is equivalent to `0` satisfying such properties.
## Main results
- `locally_convex_space_iff_zero` : in a module, local convexity at zero gives
local convexity everywhere
- `seminorm.locally_convex_space` : a topology generated by a family of seminorms is locally convex
- `normed_space.locally_convex_space` : a normed space is locally convex
## TODO
- define a structure `locally_convex_filter_basis`, extending `module_filter_basis`, for filter
bases generating a locally convex topology
-/
open TopologicalSpace Filter Set
open Topology Pointwise
section Semimodule
/-- A `locally_convex_space` is a topological semimodule over an ordered semiring in which convex
neighborhoods of a point form a neighborhood basis at that point. -/
class LocallyConvexSpace (𝕜 E : Type _) [OrderedSemiring 𝕜] [AddCommMonoid E] [Module 𝕜 E]
[TopologicalSpace E] : Prop where
convex_basis : ∀ x : E, (𝓝 x).HasBasis (fun s : Set E => s ∈ 𝓝 x ∧ Convex 𝕜 s) id
#align locally_convex_space LocallyConvexSpace
variable (𝕜 E : Type _) [OrderedSemiring 𝕜] [AddCommMonoid E] [Module 𝕜 E] [TopologicalSpace E]
theorem locallyConvexSpace_iff :
LocallyConvexSpace 𝕜 E ↔ ∀ x : E, (𝓝 x).HasBasis (fun s : Set E => s ∈ 𝓝 x ∧ Convex 𝕜 s) id :=
⟨@LocallyConvexSpace.convex_basis _ _ _ _ _ _, LocallyConvexSpace.mk⟩
#align locally_convex_space_iff locallyConvexSpace_iff
theorem LocallyConvexSpace.ofBases {ι : Type _} (b : E → ι → Set E) (p : E → ι → Prop)
(hbasis : ∀ x : E, (𝓝 x).HasBasis (p x) (b x)) (hconvex : ∀ x i, p x i → Convex 𝕜 (b x i)) :
LocallyConvexSpace 𝕜 E :=
⟨fun x =>
(hbasis x).to_hasBasis
(fun i hi => ⟨b x i, ⟨⟨(hbasis x).mem_of_mem hi, hconvex x i hi⟩, le_refl (b x i)⟩⟩)
fun s hs =>
⟨(hbasis x).index s hs.1, ⟨(hbasis x).property_index hs.1, (hbasis x).set_index_subset hs.1⟩⟩⟩
#align locally_convex_space.of_bases LocallyConvexSpace.ofBases
theorem LocallyConvexSpace.convex_basis_zero [LocallyConvexSpace 𝕜 E] :
(𝓝 0 : Filter E).HasBasis (fun s => s ∈ (𝓝 0 : Filter E) ∧ Convex 𝕜 s) id :=
LocallyConvexSpace.convex_basis 0
#align locally_convex_space.convex_basis_zero LocallyConvexSpace.convex_basis_zero
theorem locallyConvexSpace_iff_exists_convex_subset :
LocallyConvexSpace 𝕜 E ↔ ∀ x : E, ∀ U ∈ 𝓝 x, ∃ S ∈ 𝓝 x, Convex 𝕜 S ∧ S ⊆ U :=
(locallyConvexSpace_iff 𝕜 E).trans (forall_congr' fun x => hasBasis_self)
#align locally_convex_space_iff_exists_convex_subset locallyConvexSpace_iff_exists_convex_subset
end Semimodule
section Module
variable (𝕜 E : Type _) [OrderedSemiring 𝕜] [AddCommGroup E] [Module 𝕜 E] [TopologicalSpace E]
[TopologicalAddGroup E]
theorem LocallyConvexSpace.ofBasisZero {ι : Type _} (b : ι → Set E) (p : ι → Prop)
(hbasis : (𝓝 0).HasBasis p b) (hconvex : ∀ i, p i → Convex 𝕜 (b i)) : LocallyConvexSpace 𝕜 E :=
by
refine'
LocallyConvexSpace.ofBases 𝕜 E (fun (x : E) (i : ι) => (· + ·) x '' b i) (fun _ => p)
(fun x => _) fun x i hi => (hconvex i hi).translate x
rw [← map_add_left_nhds_zero]
exact hbasis.map _
#align locally_convex_space.of_basis_zero LocallyConvexSpace.ofBasisZero
theorem locallyConvexSpace_iff_zero :
LocallyConvexSpace 𝕜 E ↔
(𝓝 0 : Filter E).HasBasis (fun s : Set E => s ∈ (𝓝 0 : Filter E) ∧ Convex 𝕜 s) id :=
⟨fun h => @LocallyConvexSpace.convex_basis _ _ _ _ _ _ h 0, fun h =>
LocallyConvexSpace.ofBasisZero 𝕜 E _ _ h fun s => And.right⟩
#align locally_convex_space_iff_zero locallyConvexSpace_iff_zero
theorem locallyConvexSpace_iff_exists_convex_subset_zero :
LocallyConvexSpace 𝕜 E ↔ ∀ U ∈ (𝓝 0 : Filter E), ∃ S ∈ (𝓝 0 : Filter E), Convex 𝕜 S ∧ S ⊆ U :=
(locallyConvexSpace_iff_zero 𝕜 E).trans hasBasis_self
#align locally_convex_space_iff_exists_convex_subset_zero locallyConvexSpace_iff_exists_convex_subset_zero
-- see Note [lower instance priority]
instance (priority := 100) LocallyConvexSpace.to_locallyConnectedSpace [Module ℝ E]
[ContinuousSMul ℝ E] [LocallyConvexSpace ℝ E] : LocallyConnectedSpace E :=
locallyConnectedSpace_of_connected_bases _ _
(fun x => @LocallyConvexSpace.convex_basis ℝ _ _ _ _ _ _ x) fun x s hs => hs.2.IsPreconnected
#align locally_convex_space.to_locally_connected_space LocallyConvexSpace.to_locallyConnectedSpace
end Module
section LinearOrderedField
variable (𝕜 E : Type _) [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] [TopologicalSpace E]
[TopologicalAddGroup E] [ContinuousConstSMul 𝕜 E]
theorem LocallyConvexSpace.convex_open_basis_zero [LocallyConvexSpace 𝕜 E] :
(𝓝 0 : Filter E).HasBasis (fun s => (0 : E) ∈ s ∧ IsOpen s ∧ Convex 𝕜 s) id :=
(LocallyConvexSpace.convex_basis_zero 𝕜 E).to_hasBasis
(fun s hs =>
⟨interior s, ⟨mem_interior_iff_mem_nhds.mpr hs.1, isOpen_interior, hs.2.interior⟩,
interior_subset⟩)
fun s hs => ⟨s, ⟨hs.2.1.mem_nhds hs.1, hs.2.2⟩, subset_rfl⟩
#align locally_convex_space.convex_open_basis_zero LocallyConvexSpace.convex_open_basis_zero
variable {𝕜 E}
/-- In a locally convex space, if `s`, `t` are disjoint convex sets, `s` is compact and `t` is
closed, then we can find open disjoint convex sets containing them. -/
theorem Disjoint.exists_open_convexes [LocallyConvexSpace 𝕜 E] {s t : Set E} (disj : Disjoint s t)
(hs₁ : Convex 𝕜 s) (hs₂ : IsCompact s) (ht₁ : Convex 𝕜 t) (ht₂ : IsClosed t) :
∃ u v, IsOpen u ∧ IsOpen v ∧ Convex 𝕜 u ∧ Convex 𝕜 v ∧ s ⊆ u ∧ t ⊆ v ∧ Disjoint u v :=
by
letI : UniformSpace E := TopologicalAddGroup.toUniformSpace E
haveI : UniformAddGroup E := comm_topologicalAddGroup_is_uniform
have := (LocallyConvexSpace.convex_open_basis_zero 𝕜 E).comap fun x : E × E => x.2 - x.1
rw [← uniformity_eq_comap_nhds_zero] at this
rcases disj.exists_uniform_thickening_of_basis this hs₂ ht₂ with ⟨V, ⟨hV0, hVopen, hVconvex⟩, hV⟩
refine'
⟨s + V, t + V, hVopen.add_left, hVopen.add_left, hs₁.add hVconvex, ht₁.add hVconvex,
subset_add_left _ hV0, subset_add_left _ hV0, _⟩
simp_rw [← Union_add_left_image, image_add_left]
simp_rw [UniformSpace.ball, ← preimage_comp, sub_eq_neg_add] at hV
exact hV
#align disjoint.exists_open_convexes Disjoint.exists_open_convexes
end LinearOrderedField
section LatticeOps
variable {ι : Sort _} {𝕜 E F : Type _} [OrderedSemiring 𝕜] [AddCommMonoid E] [Module 𝕜 E]
[AddCommMonoid F] [Module 𝕜 F]
theorem locallyConvexSpaceInf {ts : Set (TopologicalSpace E)}
(h : ∀ t ∈ ts, @LocallyConvexSpace 𝕜 E _ _ _ t) : @LocallyConvexSpace 𝕜 E _ _ _ (infₛ ts) :=
by
letI : TopologicalSpace E := Inf ts
refine'
LocallyConvexSpace.ofBases 𝕜 E (fun x => fun If : Set ts × (ts → Set E) => ⋂ i ∈ If.1, If.2 i)
(fun x => fun If : Set ts × (ts → Set E) =>
If.1.Finite ∧ ∀ i ∈ If.1, If.2 i ∈ @nhds _ (↑i) x ∧ Convex 𝕜 (If.2 i))
(fun x => _) fun x If hif => convex_interᵢ fun i => convex_interᵢ fun hi => (hif.2 i hi).2
rw [nhds_infₛ, ← infᵢ_subtype'']
exact has_basis_infi' fun i : ts => (@locallyConvexSpace_iff 𝕜 E _ _ _ ↑i).mp (h (↑i) i.2) x
#align locally_convex_space_Inf locallyConvexSpaceInf
theorem locallyConvexSpaceInfi {ts' : ι → TopologicalSpace E}
(h' : ∀ i, @LocallyConvexSpace 𝕜 E _ _ _ (ts' i)) :
@LocallyConvexSpace 𝕜 E _ _ _ (⨅ i, ts' i) :=
by
refine' locallyConvexSpaceInf _
rwa [forall_range_iff]
#align locally_convex_space_infi locallyConvexSpaceInfi
/- warning: locally_convex_space_inf clashes with locally_convex_space_Inf -> locallyConvexSpaceInf
Case conversion may be inaccurate. Consider using '#align locally_convex_space_inf locallyConvexSpaceInfₓ'. -/
#print locallyConvexSpaceInf /-
theorem locallyConvexSpaceInf {t₁ t₂ : TopologicalSpace E} (h₁ : @LocallyConvexSpace 𝕜 E _ _ _ t₁)
(h₂ : @LocallyConvexSpace 𝕜 E _ _ _ t₂) : @LocallyConvexSpace 𝕜 E _ _ _ (t₁ ⊓ t₂) :=
by
rw [inf_eq_infᵢ]
refine' locallyConvexSpaceInfi fun b => _
cases b <;> assumption
#align locally_convex_space_inf locallyConvexSpaceInf
-/
theorem locallyConvexSpaceInduced {t : TopologicalSpace F} [LocallyConvexSpace 𝕜 F]
(f : E →ₗ[𝕜] F) : @LocallyConvexSpace 𝕜 E _ _ _ (t.induced f) :=
by
letI : TopologicalSpace E := t.induced f
refine'
LocallyConvexSpace.ofBases 𝕜 E (fun x => preimage f)
(fun x => fun s : Set F => s ∈ 𝓝 (f x) ∧ Convex 𝕜 s) (fun x => _) fun x s ⟨_, hs⟩ =>
hs.linear_preimage f
rw [nhds_induced]
exact (LocallyConvexSpace.convex_basis <| f x).comap f
#align locally_convex_space_induced locallyConvexSpaceInduced
instance {ι : Type _} {X : ι → Type _} [∀ i, AddCommMonoid (X i)] [∀ i, TopologicalSpace (X i)]
[∀ i, Module 𝕜 (X i)] [∀ i, LocallyConvexSpace 𝕜 (X i)] : LocallyConvexSpace 𝕜 (∀ i, X i) :=
locallyConvexSpaceInfi fun i => locallyConvexSpaceInduced (LinearMap.proj i)
instance [TopologicalSpace E] [TopologicalSpace F] [LocallyConvexSpace 𝕜 E]
[LocallyConvexSpace 𝕜 F] : LocallyConvexSpace 𝕜 (E × F) :=
locallyConvexSpaceInf (locallyConvexSpaceInduced (LinearMap.fst _ _ _))
(locallyConvexSpaceInduced (LinearMap.snd _ _ _))
end LatticeOps
|
[STATEMENT]
lemma sum_case_Inr [simp]: "sum_case f g (Inr y) = g y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. sum_case f g (HF.Inr y) = g y
[PROOF STEP]
by (simp add: sum_case_def is_hsum_def) |
module TestRectifier
println("\nRectifier: Demonstrating the ability to simulate models with state events")
using Modia
using Modia.Electric
using ModiaMath.plot
@model Rectifier begin
R=Resistor(R=1)
r=Resistor(R=0.01)
C=Capacitor(C=1,start=0)
D=IdealDiode()
V=SineVoltage(V=5,freqHz=1.5, offset=0, startTime=0)
@equations begin
connect(V.p, D.p)
connect(D.n, R.p)
connect(R.n, r.p)
connect(r.n, V.n)
connect(C.n, R.n)
connect(C.p, R.p)
end
end
result = checkSimulation(Rectifier, 2, "C.v", 0.4773911315322196)
plot(result, ("C.v", "V.v"), heading="Rectifier", figure=12)
end
|
classdef MimEditYellow < MimGuiPlugin
% MimEditYellow. Gui Plugin for setting paint colour
%
% You should not use this class within your own code. It is intended to
% be used by the gui of the TD MIM Toolkit.
%
% MimEditYellow is a Gui Plugin for the MIM Toolkit.
%
%
% Licence
% -------
% Part of the TD MIM Toolkit. https://github.com/tomdoel
% Author: Tom Doel, Copyright Tom Doel 2014. www.tomdoel.com
% Distributed under the MIT licence. Please see website for details.
%
properties
ButtonText = 'Yellow'
SelectedText = 'Yellow'
ToolTip = 'Edit with yellow label'
Category = 'Segmentation label'
Visibility = 'Dataset'
Mode = 'Edit'
HidePluginInDisplay = false
PTKVersion = '1'
ButtonWidth = 5
ButtonHeight = 1
Icon = 'paint.png'
IconColour = GemMarkerPoint.DefaultColours{6}
Location = 36
end
methods (Static)
function RunGuiPlugin(gui_app)
gui_app.ImagePanel.PaintBrushColour = 6;
end
function enabled = IsEnabled(gui_app)
enabled = gui_app.IsDatasetLoaded && gui_app.ImagePanel.OverlayImage.ImageExists && ...
isequal(gui_app.ImagePanel.SelectedControl, 'Paint');
end
function is_selected = IsSelected(gui_app)
is_selected = gui_app.ImagePanel.PaintBrushColour == 6;
end
end
end |
module Text.Greek.SBLGNT.1John where
open import Data.List
open import Text.Greek.Bible
open import Text.Greek.Script
open import Text.Greek.Script.Unicode
ΙΩΑΝΝΟΥ-Α : List (Word)
ΙΩΑΝΝΟΥ-Α =
word (Ὃ ∷ []) "1John.1.1"
∷ word (ἦ ∷ ν ∷ []) "1John.1.1"
∷ word (ἀ ∷ π ∷ []) "1John.1.1"
∷ word (ἀ ∷ ρ ∷ χ ∷ ῆ ∷ ς ∷ []) "1John.1.1"
∷ word (ὃ ∷ []) "1John.1.1"
∷ word (ἀ ∷ κ ∷ η ∷ κ ∷ ό ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.1"
∷ word (ὃ ∷ []) "1John.1.1"
∷ word (ἑ ∷ ω ∷ ρ ∷ ά ∷ κ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.1"
∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1John.1.1"
∷ word (ὀ ∷ φ ∷ θ ∷ α ∷ ∙λ ∷ μ ∷ ο ∷ ῖ ∷ ς ∷ []) "1John.1.1"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.1.1"
∷ word (ὃ ∷ []) "1John.1.1"
∷ word (ἐ ∷ θ ∷ ε ∷ α ∷ σ ∷ ά ∷ μ ∷ ε ∷ θ ∷ α ∷ []) "1John.1.1"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.1"
∷ word (α ∷ ἱ ∷ []) "1John.1.1"
∷ word (χ ∷ ε ∷ ῖ ∷ ρ ∷ ε ∷ ς ∷ []) "1John.1.1"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.1.1"
∷ word (ἐ ∷ ψ ∷ η ∷ ∙λ ∷ ά ∷ φ ∷ η ∷ σ ∷ α ∷ ν ∷ []) "1John.1.1"
∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "1John.1.1"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.1.1"
∷ word (∙λ ∷ ό ∷ γ ∷ ο ∷ υ ∷ []) "1John.1.1"
∷ word (τ ∷ ῆ ∷ ς ∷ []) "1John.1.1"
∷ word (ζ ∷ ω ∷ ῆ ∷ ς ∷ []) "1John.1.1"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.2"
∷ word (ἡ ∷ []) "1John.1.2"
∷ word (ζ ∷ ω ∷ ὴ ∷ []) "1John.1.2"
∷ word (ἐ ∷ φ ∷ α ∷ ν ∷ ε ∷ ρ ∷ ώ ∷ θ ∷ η ∷ []) "1John.1.2"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.2"
∷ word (ἑ ∷ ω ∷ ρ ∷ ά ∷ κ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.2"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.2"
∷ word (μ ∷ α ∷ ρ ∷ τ ∷ υ ∷ ρ ∷ ο ∷ ῦ ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.2"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.2"
∷ word (ἀ ∷ π ∷ α ∷ γ ∷ γ ∷ έ ∷ ∙λ ∷ ∙λ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.2"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.1.2"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.1.2"
∷ word (ζ ∷ ω ∷ ὴ ∷ ν ∷ []) "1John.1.2"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.1.2"
∷ word (α ∷ ἰ ∷ ώ ∷ ν ∷ ι ∷ ο ∷ ν ∷ []) "1John.1.2"
∷ word (ἥ ∷ τ ∷ ι ∷ ς ∷ []) "1John.1.2"
∷ word (ἦ ∷ ν ∷ []) "1John.1.2"
∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "1John.1.2"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.1.2"
∷ word (π ∷ α ∷ τ ∷ έ ∷ ρ ∷ α ∷ []) "1John.1.2"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.2"
∷ word (ἐ ∷ φ ∷ α ∷ ν ∷ ε ∷ ρ ∷ ώ ∷ θ ∷ η ∷ []) "1John.1.2"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.1.2"
∷ word (ὃ ∷ []) "1John.1.3"
∷ word (ἑ ∷ ω ∷ ρ ∷ ά ∷ κ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.3"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.3"
∷ word (ἀ ∷ κ ∷ η ∷ κ ∷ ό ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.3"
∷ word (ἀ ∷ π ∷ α ∷ γ ∷ γ ∷ έ ∷ ∙λ ∷ ∙λ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.3"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.3"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.1.3"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.1.3"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.3"
∷ word (ὑ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.1.3"
∷ word (κ ∷ ο ∷ ι ∷ ν ∷ ω ∷ ν ∷ ί ∷ α ∷ ν ∷ []) "1John.1.3"
∷ word (ἔ ∷ χ ∷ η ∷ τ ∷ ε ∷ []) "1John.1.3"
∷ word (μ ∷ ε ∷ θ ∷ []) "1John.1.3"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.1.3"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.3"
∷ word (ἡ ∷ []) "1John.1.3"
∷ word (κ ∷ ο ∷ ι ∷ ν ∷ ω ∷ ν ∷ ί ∷ α ∷ []) "1John.1.3"
∷ word (δ ∷ ὲ ∷ []) "1John.1.3"
∷ word (ἡ ∷ []) "1John.1.3"
∷ word (ἡ ∷ μ ∷ ε ∷ τ ∷ έ ∷ ρ ∷ α ∷ []) "1John.1.3"
∷ word (μ ∷ ε ∷ τ ∷ ὰ ∷ []) "1John.1.3"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.1.3"
∷ word (π ∷ α ∷ τ ∷ ρ ∷ ὸ ∷ ς ∷ []) "1John.1.3"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.3"
∷ word (μ ∷ ε ∷ τ ∷ ὰ ∷ []) "1John.1.3"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.1.3"
∷ word (υ ∷ ἱ ∷ ο ∷ ῦ ∷ []) "1John.1.3"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.1.3"
∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "1John.1.3"
∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.1.3"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.4"
∷ word (τ ∷ α ∷ ῦ ∷ τ ∷ α ∷ []) "1John.1.4"
∷ word (γ ∷ ρ ∷ ά ∷ φ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.4"
∷ word (ἡ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.1.4"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.1.4"
∷ word (ἡ ∷ []) "1John.1.4"
∷ word (χ ∷ α ∷ ρ ∷ ὰ ∷ []) "1John.1.4"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.1.4"
∷ word (ᾖ ∷ []) "1John.1.4"
∷ word (π ∷ ε ∷ π ∷ ∙λ ∷ η ∷ ρ ∷ ω ∷ μ ∷ έ ∷ ν ∷ η ∷ []) "1John.1.4"
∷ word (Κ ∷ α ∷ ὶ ∷ []) "1John.1.5"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.1.5"
∷ word (α ∷ ὕ ∷ τ ∷ η ∷ []) "1John.1.5"
∷ word (ἡ ∷ []) "1John.1.5"
∷ word (ἀ ∷ γ ∷ γ ∷ ε ∷ ∙λ ∷ ί ∷ α ∷ []) "1John.1.5"
∷ word (ἣ ∷ ν ∷ []) "1John.1.5"
∷ word (ἀ ∷ κ ∷ η ∷ κ ∷ ό ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.5"
∷ word (ἀ ∷ π ∷ []) "1John.1.5"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.1.5"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.5"
∷ word (ἀ ∷ ν ∷ α ∷ γ ∷ γ ∷ έ ∷ ∙λ ∷ ∙λ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.5"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.1.5"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.1.5"
∷ word (ὁ ∷ []) "1John.1.5"
∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1John.1.5"
∷ word (φ ∷ ῶ ∷ ς ∷ []) "1John.1.5"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.1.5"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.5"
∷ word (σ ∷ κ ∷ ο ∷ τ ∷ ί ∷ α ∷ []) "1John.1.5"
∷ word (ἐ ∷ ν ∷ []) "1John.1.5"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.1.5"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.1.5"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.1.5"
∷ word (ο ∷ ὐ ∷ δ ∷ ε ∷ μ ∷ ί ∷ α ∷ []) "1John.1.5"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.1.6"
∷ word (ε ∷ ἴ ∷ π ∷ ω ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.6"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.1.6"
∷ word (κ ∷ ο ∷ ι ∷ ν ∷ ω ∷ ν ∷ ί ∷ α ∷ ν ∷ []) "1John.1.6"
∷ word (ἔ ∷ χ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.6"
∷ word (μ ∷ ε ∷ τ ∷ []) "1John.1.6"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.1.6"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.6"
∷ word (ἐ ∷ ν ∷ []) "1John.1.6"
∷ word (τ ∷ ῷ ∷ []) "1John.1.6"
∷ word (σ ∷ κ ∷ ό ∷ τ ∷ ε ∷ ι ∷ []) "1John.1.6"
∷ word (π ∷ ε ∷ ρ ∷ ι ∷ π ∷ α ∷ τ ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.6"
∷ word (ψ ∷ ε ∷ υ ∷ δ ∷ ό ∷ μ ∷ ε ∷ θ ∷ α ∷ []) "1John.1.6"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.6"
∷ word (ο ∷ ὐ ∷ []) "1John.1.6"
∷ word (π ∷ ο ∷ ι ∷ ο ∷ ῦ ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.6"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.1.6"
∷ word (ἀ ∷ ∙λ ∷ ή ∷ θ ∷ ε ∷ ι ∷ α ∷ ν ∷ []) "1John.1.6"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.1.7"
∷ word (δ ∷ ὲ ∷ []) "1John.1.7"
∷ word (ἐ ∷ ν ∷ []) "1John.1.7"
∷ word (τ ∷ ῷ ∷ []) "1John.1.7"
∷ word (φ ∷ ω ∷ τ ∷ ὶ ∷ []) "1John.1.7"
∷ word (π ∷ ε ∷ ρ ∷ ι ∷ π ∷ α ∷ τ ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.7"
∷ word (ὡ ∷ ς ∷ []) "1John.1.7"
∷ word (α ∷ ὐ ∷ τ ∷ ό ∷ ς ∷ []) "1John.1.7"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.1.7"
∷ word (ἐ ∷ ν ∷ []) "1John.1.7"
∷ word (τ ∷ ῷ ∷ []) "1John.1.7"
∷ word (φ ∷ ω ∷ τ ∷ ί ∷ []) "1John.1.7"
∷ word (κ ∷ ο ∷ ι ∷ ν ∷ ω ∷ ν ∷ ί ∷ α ∷ ν ∷ []) "1John.1.7"
∷ word (ἔ ∷ χ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.7"
∷ word (μ ∷ ε ∷ τ ∷ []) "1John.1.7"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ή ∷ ∙λ ∷ ω ∷ ν ∷ []) "1John.1.7"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.7"
∷ word (τ ∷ ὸ ∷ []) "1John.1.7"
∷ word (α ∷ ἷ ∷ μ ∷ α ∷ []) "1John.1.7"
∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "1John.1.7"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.1.7"
∷ word (υ ∷ ἱ ∷ ο ∷ ῦ ∷ []) "1John.1.7"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.1.7"
∷ word (κ ∷ α ∷ θ ∷ α ∷ ρ ∷ ί ∷ ζ ∷ ε ∷ ι ∷ []) "1John.1.7"
∷ word (ἡ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1John.1.7"
∷ word (ἀ ∷ π ∷ ὸ ∷ []) "1John.1.7"
∷ word (π ∷ ά ∷ σ ∷ η ∷ ς ∷ []) "1John.1.7"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ ς ∷ []) "1John.1.7"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.1.8"
∷ word (ε ∷ ἴ ∷ π ∷ ω ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.8"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.1.8"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ ν ∷ []) "1John.1.8"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.1.8"
∷ word (ἔ ∷ χ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.8"
∷ word (ἑ ∷ α ∷ υ ∷ τ ∷ ο ∷ ὺ ∷ ς ∷ []) "1John.1.8"
∷ word (π ∷ ∙λ ∷ α ∷ ν ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.8"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.8"
∷ word (ἡ ∷ []) "1John.1.8"
∷ word (ἀ ∷ ∙λ ∷ ή ∷ θ ∷ ε ∷ ι ∷ α ∷ []) "1John.1.8"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.1.8"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.1.8"
∷ word (ἐ ∷ ν ∷ []) "1John.1.8"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.1.8"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.1.9"
∷ word (ὁ ∷ μ ∷ ο ∷ ∙λ ∷ ο ∷ γ ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.9"
∷ word (τ ∷ ὰ ∷ ς ∷ []) "1John.1.9"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ ς ∷ []) "1John.1.9"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.1.9"
∷ word (π ∷ ι ∷ σ ∷ τ ∷ ό ∷ ς ∷ []) "1John.1.9"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.1.9"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.9"
∷ word (δ ∷ ί ∷ κ ∷ α ∷ ι ∷ ο ∷ ς ∷ []) "1John.1.9"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.1.9"
∷ word (ἀ ∷ φ ∷ ῇ ∷ []) "1John.1.9"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.1.9"
∷ word (τ ∷ ὰ ∷ ς ∷ []) "1John.1.9"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ ς ∷ []) "1John.1.9"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.9"
∷ word (κ ∷ α ∷ θ ∷ α ∷ ρ ∷ ί ∷ σ ∷ ῃ ∷ []) "1John.1.9"
∷ word (ἡ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1John.1.9"
∷ word (ἀ ∷ π ∷ ὸ ∷ []) "1John.1.9"
∷ word (π ∷ ά ∷ σ ∷ η ∷ ς ∷ []) "1John.1.9"
∷ word (ἀ ∷ δ ∷ ι ∷ κ ∷ ί ∷ α ∷ ς ∷ []) "1John.1.9"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.1.10"
∷ word (ε ∷ ἴ ∷ π ∷ ω ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.10"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.1.10"
∷ word (ο ∷ ὐ ∷ χ ∷ []) "1John.1.10"
∷ word (ἡ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ή ∷ κ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.10"
∷ word (ψ ∷ ε ∷ ύ ∷ σ ∷ τ ∷ η ∷ ν ∷ []) "1John.1.10"
∷ word (π ∷ ο ∷ ι ∷ ο ∷ ῦ ∷ μ ∷ ε ∷ ν ∷ []) "1John.1.10"
∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ν ∷ []) "1John.1.10"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.1.10"
∷ word (ὁ ∷ []) "1John.1.10"
∷ word (∙λ ∷ ό ∷ γ ∷ ο ∷ ς ∷ []) "1John.1.10"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.1.10"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.1.10"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.1.10"
∷ word (ἐ ∷ ν ∷ []) "1John.1.10"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.1.10"
∷ word (Τ ∷ ε ∷ κ ∷ ν ∷ ί ∷ α ∷ []) "1John.2.1"
∷ word (μ ∷ ο ∷ υ ∷ []) "1John.2.1"
∷ word (τ ∷ α ∷ ῦ ∷ τ ∷ α ∷ []) "1John.2.1"
∷ word (γ ∷ ρ ∷ ά ∷ φ ∷ ω ∷ []) "1John.2.1"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.1"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.2.1"
∷ word (μ ∷ ὴ ∷ []) "1John.2.1"
∷ word (ἁ ∷ μ ∷ ά ∷ ρ ∷ τ ∷ η ∷ τ ∷ ε ∷ []) "1John.2.1"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.1"
∷ word (ἐ ∷ ά ∷ ν ∷ []) "1John.2.1"
∷ word (τ ∷ ι ∷ ς ∷ []) "1John.2.1"
∷ word (ἁ ∷ μ ∷ ά ∷ ρ ∷ τ ∷ ῃ ∷ []) "1John.2.1"
∷ word (π ∷ α ∷ ρ ∷ ά ∷ κ ∷ ∙λ ∷ η ∷ τ ∷ ο ∷ ν ∷ []) "1John.2.1"
∷ word (ἔ ∷ χ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.2.1"
∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "1John.2.1"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.1"
∷ word (π ∷ α ∷ τ ∷ έ ∷ ρ ∷ α ∷ []) "1John.2.1"
∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ ν ∷ []) "1John.2.1"
∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ὸ ∷ ν ∷ []) "1John.2.1"
∷ word (δ ∷ ί ∷ κ ∷ α ∷ ι ∷ ο ∷ ν ∷ []) "1John.2.1"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.2"
∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ς ∷ []) "1John.2.2"
∷ word (ἱ ∷ ∙λ ∷ α ∷ σ ∷ μ ∷ ό ∷ ς ∷ []) "1John.2.2"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.2.2"
∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "1John.2.2"
∷ word (τ ∷ ῶ ∷ ν ∷ []) "1John.2.2"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ι ∷ ῶ ∷ ν ∷ []) "1John.2.2"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.2.2"
∷ word (ο ∷ ὐ ∷ []) "1John.2.2"
∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "1John.2.2"
∷ word (τ ∷ ῶ ∷ ν ∷ []) "1John.2.2"
∷ word (ἡ ∷ μ ∷ ε ∷ τ ∷ έ ∷ ρ ∷ ω ∷ ν ∷ []) "1John.2.2"
∷ word (δ ∷ ὲ ∷ []) "1John.2.2"
∷ word (μ ∷ ό ∷ ν ∷ ο ∷ ν ∷ []) "1John.2.2"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1John.2.2"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.2"
∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "1John.2.2"
∷ word (ὅ ∷ ∙λ ∷ ο ∷ υ ∷ []) "1John.2.2"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.2.2"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ υ ∷ []) "1John.2.2"
∷ word (Κ ∷ α ∷ ὶ ∷ []) "1John.2.3"
∷ word (ἐ ∷ ν ∷ []) "1John.2.3"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1John.2.3"
∷ word (γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.2.3"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.3"
∷ word (ἐ ∷ γ ∷ ν ∷ ώ ∷ κ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.2.3"
∷ word (α ∷ ὐ ∷ τ ∷ ό ∷ ν ∷ []) "1John.2.3"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.2.3"
∷ word (τ ∷ ὰ ∷ ς ∷ []) "1John.2.3"
∷ word (ἐ ∷ ν ∷ τ ∷ ο ∷ ∙λ ∷ ὰ ∷ ς ∷ []) "1John.2.3"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.2.3"
∷ word (τ ∷ η ∷ ρ ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.2.3"
∷ word (ὁ ∷ []) "1John.2.4"
∷ word (∙λ ∷ έ ∷ γ ∷ ω ∷ ν ∷ []) "1John.2.4"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.4"
∷ word (Ἔ ∷ γ ∷ ν ∷ ω ∷ κ ∷ α ∷ []) "1John.2.4"
∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ν ∷ []) "1John.2.4"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.4"
∷ word (τ ∷ ὰ ∷ ς ∷ []) "1John.2.4"
∷ word (ἐ ∷ ν ∷ τ ∷ ο ∷ ∙λ ∷ ὰ ∷ ς ∷ []) "1John.2.4"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.2.4"
∷ word (μ ∷ ὴ ∷ []) "1John.2.4"
∷ word (τ ∷ η ∷ ρ ∷ ῶ ∷ ν ∷ []) "1John.2.4"
∷ word (ψ ∷ ε ∷ ύ ∷ σ ∷ τ ∷ η ∷ ς ∷ []) "1John.2.4"
∷ word (ἐ ∷ σ ∷ τ ∷ ί ∷ ν ∷ []) "1John.2.4"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.4"
∷ word (ἐ ∷ ν ∷ []) "1John.2.4"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1John.2.4"
∷ word (ἡ ∷ []) "1John.2.4"
∷ word (ἀ ∷ ∙λ ∷ ή ∷ θ ∷ ε ∷ ι ∷ α ∷ []) "1John.2.4"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.2.4"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.2.4"
∷ word (ὃ ∷ ς ∷ []) "1John.2.5"
∷ word (δ ∷ []) "1John.2.5"
∷ word (ἂ ∷ ν ∷ []) "1John.2.5"
∷ word (τ ∷ η ∷ ρ ∷ ῇ ∷ []) "1John.2.5"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.2.5"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.5"
∷ word (∙λ ∷ ό ∷ γ ∷ ο ∷ ν ∷ []) "1John.2.5"
∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ῶ ∷ ς ∷ []) "1John.2.5"
∷ word (ἐ ∷ ν ∷ []) "1John.2.5"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1John.2.5"
∷ word (ἡ ∷ []) "1John.2.5"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ []) "1John.2.5"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.2.5"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.2.5"
∷ word (τ ∷ ε ∷ τ ∷ ε ∷ ∙λ ∷ ε ∷ ί ∷ ω ∷ τ ∷ α ∷ ι ∷ []) "1John.2.5"
∷ word (ἐ ∷ ν ∷ []) "1John.2.5"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1John.2.5"
∷ word (γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.2.5"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.5"
∷ word (ἐ ∷ ν ∷ []) "1John.2.5"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.2.5"
∷ word (ἐ ∷ σ ∷ μ ∷ ε ∷ ν ∷ []) "1John.2.5"
∷ word (ὁ ∷ []) "1John.2.6"
∷ word (∙λ ∷ έ ∷ γ ∷ ω ∷ ν ∷ []) "1John.2.6"
∷ word (ἐ ∷ ν ∷ []) "1John.2.6"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.2.6"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ ν ∷ []) "1John.2.6"
∷ word (ὀ ∷ φ ∷ ε ∷ ί ∷ ∙λ ∷ ε ∷ ι ∷ []) "1John.2.6"
∷ word (κ ∷ α ∷ θ ∷ ὼ ∷ ς ∷ []) "1John.2.6"
∷ word (ἐ ∷ κ ∷ ε ∷ ῖ ∷ ν ∷ ο ∷ ς ∷ []) "1John.2.6"
∷ word (π ∷ ε ∷ ρ ∷ ι ∷ ε ∷ π ∷ ά ∷ τ ∷ η ∷ σ ∷ ε ∷ ν ∷ []) "1John.2.6"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.6"
∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ς ∷ []) "1John.2.6"
∷ word (π ∷ ε ∷ ρ ∷ ι ∷ π ∷ α ∷ τ ∷ ε ∷ ῖ ∷ ν ∷ []) "1John.2.6"
∷ word (Ἀ ∷ γ ∷ α ∷ π ∷ η ∷ τ ∷ ο ∷ ί ∷ []) "1John.2.7"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.2.7"
∷ word (ἐ ∷ ν ∷ τ ∷ ο ∷ ∙λ ∷ ὴ ∷ ν ∷ []) "1John.2.7"
∷ word (κ ∷ α ∷ ι ∷ ν ∷ ὴ ∷ ν ∷ []) "1John.2.7"
∷ word (γ ∷ ρ ∷ ά ∷ φ ∷ ω ∷ []) "1John.2.7"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.7"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ []) "1John.2.7"
∷ word (ἐ ∷ ν ∷ τ ∷ ο ∷ ∙λ ∷ ὴ ∷ ν ∷ []) "1John.2.7"
∷ word (π ∷ α ∷ ∙λ ∷ α ∷ ι ∷ ὰ ∷ ν ∷ []) "1John.2.7"
∷ word (ἣ ∷ ν ∷ []) "1John.2.7"
∷ word (ε ∷ ἴ ∷ χ ∷ ε ∷ τ ∷ ε ∷ []) "1John.2.7"
∷ word (ἀ ∷ π ∷ []) "1John.2.7"
∷ word (ἀ ∷ ρ ∷ χ ∷ ῆ ∷ ς ∷ []) "1John.2.7"
∷ word (ἡ ∷ []) "1John.2.7"
∷ word (ἐ ∷ ν ∷ τ ∷ ο ∷ ∙λ ∷ ὴ ∷ []) "1John.2.7"
∷ word (ἡ ∷ []) "1John.2.7"
∷ word (π ∷ α ∷ ∙λ ∷ α ∷ ι ∷ ά ∷ []) "1John.2.7"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.2.7"
∷ word (ὁ ∷ []) "1John.2.7"
∷ word (∙λ ∷ ό ∷ γ ∷ ο ∷ ς ∷ []) "1John.2.7"
∷ word (ὃ ∷ ν ∷ []) "1John.2.7"
∷ word (ἠ ∷ κ ∷ ο ∷ ύ ∷ σ ∷ α ∷ τ ∷ ε ∷ []) "1John.2.7"
∷ word (π ∷ ά ∷ ∙λ ∷ ι ∷ ν ∷ []) "1John.2.8"
∷ word (ἐ ∷ ν ∷ τ ∷ ο ∷ ∙λ ∷ ὴ ∷ ν ∷ []) "1John.2.8"
∷ word (κ ∷ α ∷ ι ∷ ν ∷ ὴ ∷ ν ∷ []) "1John.2.8"
∷ word (γ ∷ ρ ∷ ά ∷ φ ∷ ω ∷ []) "1John.2.8"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.8"
∷ word (ὅ ∷ []) "1John.2.8"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.2.8"
∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ὲ ∷ ς ∷ []) "1John.2.8"
∷ word (ἐ ∷ ν ∷ []) "1John.2.8"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.2.8"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.8"
∷ word (ἐ ∷ ν ∷ []) "1John.2.8"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.8"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.8"
∷ word (ἡ ∷ []) "1John.2.8"
∷ word (σ ∷ κ ∷ ο ∷ τ ∷ ί ∷ α ∷ []) "1John.2.8"
∷ word (π ∷ α ∷ ρ ∷ ά ∷ γ ∷ ε ∷ τ ∷ α ∷ ι ∷ []) "1John.2.8"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.8"
∷ word (τ ∷ ὸ ∷ []) "1John.2.8"
∷ word (φ ∷ ῶ ∷ ς ∷ []) "1John.2.8"
∷ word (τ ∷ ὸ ∷ []) "1John.2.8"
∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ι ∷ ν ∷ ὸ ∷ ν ∷ []) "1John.2.8"
∷ word (ἤ ∷ δ ∷ η ∷ []) "1John.2.8"
∷ word (φ ∷ α ∷ ί ∷ ν ∷ ε ∷ ι ∷ []) "1John.2.8"
∷ word (ὁ ∷ []) "1John.2.9"
∷ word (∙λ ∷ έ ∷ γ ∷ ω ∷ ν ∷ []) "1John.2.9"
∷ word (ἐ ∷ ν ∷ []) "1John.2.9"
∷ word (τ ∷ ῷ ∷ []) "1John.2.9"
∷ word (φ ∷ ω ∷ τ ∷ ὶ ∷ []) "1John.2.9"
∷ word (ε ∷ ἶ ∷ ν ∷ α ∷ ι ∷ []) "1John.2.9"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.9"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.9"
∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ὸ ∷ ν ∷ []) "1John.2.9"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.2.9"
∷ word (μ ∷ ι ∷ σ ∷ ῶ ∷ ν ∷ []) "1John.2.9"
∷ word (ἐ ∷ ν ∷ []) "1John.2.9"
∷ word (τ ∷ ῇ ∷ []) "1John.2.9"
∷ word (σ ∷ κ ∷ ο ∷ τ ∷ ί ∷ ᾳ ∷ []) "1John.2.9"
∷ word (ἐ ∷ σ ∷ τ ∷ ὶ ∷ ν ∷ []) "1John.2.9"
∷ word (ἕ ∷ ω ∷ ς ∷ []) "1John.2.9"
∷ word (ἄ ∷ ρ ∷ τ ∷ ι ∷ []) "1John.2.9"
∷ word (ὁ ∷ []) "1John.2.10"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ ν ∷ []) "1John.2.10"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.10"
∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ὸ ∷ ν ∷ []) "1John.2.10"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.2.10"
∷ word (ἐ ∷ ν ∷ []) "1John.2.10"
∷ word (τ ∷ ῷ ∷ []) "1John.2.10"
∷ word (φ ∷ ω ∷ τ ∷ ὶ ∷ []) "1John.2.10"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ []) "1John.2.10"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.10"
∷ word (σ ∷ κ ∷ ά ∷ ν ∷ δ ∷ α ∷ ∙λ ∷ ο ∷ ν ∷ []) "1John.2.10"
∷ word (ἐ ∷ ν ∷ []) "1John.2.10"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.2.10"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.2.10"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.2.10"
∷ word (ὁ ∷ []) "1John.2.11"
∷ word (δ ∷ ὲ ∷ []) "1John.2.11"
∷ word (μ ∷ ι ∷ σ ∷ ῶ ∷ ν ∷ []) "1John.2.11"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.11"
∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ὸ ∷ ν ∷ []) "1John.2.11"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.2.11"
∷ word (ἐ ∷ ν ∷ []) "1John.2.11"
∷ word (τ ∷ ῇ ∷ []) "1John.2.11"
∷ word (σ ∷ κ ∷ ο ∷ τ ∷ ί ∷ ᾳ ∷ []) "1John.2.11"
∷ word (ἐ ∷ σ ∷ τ ∷ ὶ ∷ ν ∷ []) "1John.2.11"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.11"
∷ word (ἐ ∷ ν ∷ []) "1John.2.11"
∷ word (τ ∷ ῇ ∷ []) "1John.2.11"
∷ word (σ ∷ κ ∷ ο ∷ τ ∷ ί ∷ ᾳ ∷ []) "1John.2.11"
∷ word (π ∷ ε ∷ ρ ∷ ι ∷ π ∷ α ∷ τ ∷ ε ∷ ῖ ∷ []) "1John.2.11"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.11"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.2.11"
∷ word (ο ∷ ἶ ∷ δ ∷ ε ∷ ν ∷ []) "1John.2.11"
∷ word (π ∷ ο ∷ ῦ ∷ []) "1John.2.11"
∷ word (ὑ ∷ π ∷ ά ∷ γ ∷ ε ∷ ι ∷ []) "1John.2.11"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.11"
∷ word (ἡ ∷ []) "1John.2.11"
∷ word (σ ∷ κ ∷ ο ∷ τ ∷ ί ∷ α ∷ []) "1John.2.11"
∷ word (ἐ ∷ τ ∷ ύ ∷ φ ∷ ∙λ ∷ ω ∷ σ ∷ ε ∷ ν ∷ []) "1John.2.11"
∷ word (τ ∷ ο ∷ ὺ ∷ ς ∷ []) "1John.2.11"
∷ word (ὀ ∷ φ ∷ θ ∷ α ∷ ∙λ ∷ μ ∷ ο ∷ ὺ ∷ ς ∷ []) "1John.2.11"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.2.11"
∷ word (Γ ∷ ρ ∷ ά ∷ φ ∷ ω ∷ []) "1John.2.12"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.12"
∷ word (τ ∷ ε ∷ κ ∷ ν ∷ ί ∷ α ∷ []) "1John.2.12"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.12"
∷ word (ἀ ∷ φ ∷ έ ∷ ω ∷ ν ∷ τ ∷ α ∷ ι ∷ []) "1John.2.12"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.12"
∷ word (α ∷ ἱ ∷ []) "1John.2.12"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ ι ∷ []) "1John.2.12"
∷ word (δ ∷ ι ∷ ὰ ∷ []) "1John.2.12"
∷ word (τ ∷ ὸ ∷ []) "1John.2.12"
∷ word (ὄ ∷ ν ∷ ο ∷ μ ∷ α ∷ []) "1John.2.12"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.2.12"
∷ word (γ ∷ ρ ∷ ά ∷ φ ∷ ω ∷ []) "1John.2.13"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.13"
∷ word (π ∷ α ∷ τ ∷ έ ∷ ρ ∷ ε ∷ ς ∷ []) "1John.2.13"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.13"
∷ word (ἐ ∷ γ ∷ ν ∷ ώ ∷ κ ∷ α ∷ τ ∷ ε ∷ []) "1John.2.13"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.13"
∷ word (ἀ ∷ π ∷ []) "1John.2.13"
∷ word (ἀ ∷ ρ ∷ χ ∷ ῆ ∷ ς ∷ []) "1John.2.13"
∷ word (γ ∷ ρ ∷ ά ∷ φ ∷ ω ∷ []) "1John.2.13"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.13"
∷ word (ν ∷ ε ∷ α ∷ ν ∷ ί ∷ σ ∷ κ ∷ ο ∷ ι ∷ []) "1John.2.13"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.13"
∷ word (ν ∷ ε ∷ ν ∷ ι ∷ κ ∷ ή ∷ κ ∷ α ∷ τ ∷ ε ∷ []) "1John.2.13"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.13"
∷ word (π ∷ ο ∷ ν ∷ η ∷ ρ ∷ ό ∷ ν ∷ []) "1John.2.13"
∷ word (ἔ ∷ γ ∷ ρ ∷ α ∷ ψ ∷ α ∷ []) "1John.2.14"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.14"
∷ word (π ∷ α ∷ ι ∷ δ ∷ ί ∷ α ∷ []) "1John.2.14"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.14"
∷ word (ἐ ∷ γ ∷ ν ∷ ώ ∷ κ ∷ α ∷ τ ∷ ε ∷ []) "1John.2.14"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.14"
∷ word (π ∷ α ∷ τ ∷ έ ∷ ρ ∷ α ∷ []) "1John.2.14"
∷ word (ἔ ∷ γ ∷ ρ ∷ α ∷ ψ ∷ α ∷ []) "1John.2.14"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.14"
∷ word (π ∷ α ∷ τ ∷ έ ∷ ρ ∷ ε ∷ ς ∷ []) "1John.2.14"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.14"
∷ word (ἐ ∷ γ ∷ ν ∷ ώ ∷ κ ∷ α ∷ τ ∷ ε ∷ []) "1John.2.14"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.14"
∷ word (ἀ ∷ π ∷ []) "1John.2.14"
∷ word (ἀ ∷ ρ ∷ χ ∷ ῆ ∷ ς ∷ []) "1John.2.14"
∷ word (ἔ ∷ γ ∷ ρ ∷ α ∷ ψ ∷ α ∷ []) "1John.2.14"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.14"
∷ word (ν ∷ ε ∷ α ∷ ν ∷ ί ∷ σ ∷ κ ∷ ο ∷ ι ∷ []) "1John.2.14"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.14"
∷ word (ἰ ∷ σ ∷ χ ∷ υ ∷ ρ ∷ ο ∷ ί ∷ []) "1John.2.14"
∷ word (ἐ ∷ σ ∷ τ ∷ ε ∷ []) "1John.2.14"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.14"
∷ word (ὁ ∷ []) "1John.2.14"
∷ word (∙λ ∷ ό ∷ γ ∷ ο ∷ ς ∷ []) "1John.2.14"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.2.14"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.2.14"
∷ word (ἐ ∷ ν ∷ []) "1John.2.14"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.14"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ []) "1John.2.14"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.14"
∷ word (ν ∷ ε ∷ ν ∷ ι ∷ κ ∷ ή ∷ κ ∷ α ∷ τ ∷ ε ∷ []) "1John.2.14"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.14"
∷ word (π ∷ ο ∷ ν ∷ η ∷ ρ ∷ ό ∷ ν ∷ []) "1John.2.14"
∷ word (Μ ∷ ὴ ∷ []) "1John.2.15"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ᾶ ∷ τ ∷ ε ∷ []) "1John.2.15"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.15"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ ν ∷ []) "1John.2.15"
∷ word (μ ∷ η ∷ δ ∷ ὲ ∷ []) "1John.2.15"
∷ word (τ ∷ ὰ ∷ []) "1John.2.15"
∷ word (ἐ ∷ ν ∷ []) "1John.2.15"
∷ word (τ ∷ ῷ ∷ []) "1John.2.15"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ῳ ∷ []) "1John.2.15"
∷ word (ἐ ∷ ά ∷ ν ∷ []) "1John.2.15"
∷ word (τ ∷ ι ∷ ς ∷ []) "1John.2.15"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ᾷ ∷ []) "1John.2.15"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.15"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ ν ∷ []) "1John.2.15"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.2.15"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.2.15"
∷ word (ἡ ∷ []) "1John.2.15"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ []) "1John.2.15"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.2.15"
∷ word (π ∷ α ∷ τ ∷ ρ ∷ ὸ ∷ ς ∷ []) "1John.2.15"
∷ word (ἐ ∷ ν ∷ []) "1John.2.15"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.2.15"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.16"
∷ word (π ∷ ᾶ ∷ ν ∷ []) "1John.2.16"
∷ word (τ ∷ ὸ ∷ []) "1John.2.16"
∷ word (ἐ ∷ ν ∷ []) "1John.2.16"
∷ word (τ ∷ ῷ ∷ []) "1John.2.16"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ῳ ∷ []) "1John.2.16"
∷ word (ἡ ∷ []) "1John.2.16"
∷ word (ἐ ∷ π ∷ ι ∷ θ ∷ υ ∷ μ ∷ ί ∷ α ∷ []) "1John.2.16"
∷ word (τ ∷ ῆ ∷ ς ∷ []) "1John.2.16"
∷ word (σ ∷ α ∷ ρ ∷ κ ∷ ὸ ∷ ς ∷ []) "1John.2.16"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.16"
∷ word (ἡ ∷ []) "1John.2.16"
∷ word (ἐ ∷ π ∷ ι ∷ θ ∷ υ ∷ μ ∷ ί ∷ α ∷ []) "1John.2.16"
∷ word (τ ∷ ῶ ∷ ν ∷ []) "1John.2.16"
∷ word (ὀ ∷ φ ∷ θ ∷ α ∷ ∙λ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.2.16"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.16"
∷ word (ἡ ∷ []) "1John.2.16"
∷ word (ἀ ∷ ∙λ ∷ α ∷ ζ ∷ ο ∷ ν ∷ ε ∷ ί ∷ α ∷ []) "1John.2.16"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.2.16"
∷ word (β ∷ ί ∷ ο ∷ υ ∷ []) "1John.2.16"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.2.16"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.2.16"
∷ word (ἐ ∷ κ ∷ []) "1John.2.16"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.2.16"
∷ word (π ∷ α ∷ τ ∷ ρ ∷ ό ∷ ς ∷ []) "1John.2.16"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1John.2.16"
∷ word (ἐ ∷ κ ∷ []) "1John.2.16"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.2.16"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ υ ∷ []) "1John.2.16"
∷ word (ἐ ∷ σ ∷ τ ∷ ί ∷ ν ∷ []) "1John.2.16"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.17"
∷ word (ὁ ∷ []) "1John.2.17"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ ς ∷ []) "1John.2.17"
∷ word (π ∷ α ∷ ρ ∷ ά ∷ γ ∷ ε ∷ τ ∷ α ∷ ι ∷ []) "1John.2.17"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.17"
∷ word (ἡ ∷ []) "1John.2.17"
∷ word (ἐ ∷ π ∷ ι ∷ θ ∷ υ ∷ μ ∷ ί ∷ α ∷ []) "1John.2.17"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.2.17"
∷ word (ὁ ∷ []) "1John.2.17"
∷ word (δ ∷ ὲ ∷ []) "1John.2.17"
∷ word (π ∷ ο ∷ ι ∷ ῶ ∷ ν ∷ []) "1John.2.17"
∷ word (τ ∷ ὸ ∷ []) "1John.2.17"
∷ word (θ ∷ έ ∷ ∙λ ∷ η ∷ μ ∷ α ∷ []) "1John.2.17"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.2.17"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.2.17"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ []) "1John.2.17"
∷ word (ε ∷ ἰ ∷ ς ∷ []) "1John.2.17"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.17"
∷ word (α ∷ ἰ ∷ ῶ ∷ ν ∷ α ∷ []) "1John.2.17"
∷ word (Π ∷ α ∷ ι ∷ δ ∷ ί ∷ α ∷ []) "1John.2.18"
∷ word (ἐ ∷ σ ∷ χ ∷ ά ∷ τ ∷ η ∷ []) "1John.2.18"
∷ word (ὥ ∷ ρ ∷ α ∷ []) "1John.2.18"
∷ word (ἐ ∷ σ ∷ τ ∷ ί ∷ ν ∷ []) "1John.2.18"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.18"
∷ word (κ ∷ α ∷ θ ∷ ὼ ∷ ς ∷ []) "1John.2.18"
∷ word (ἠ ∷ κ ∷ ο ∷ ύ ∷ σ ∷ α ∷ τ ∷ ε ∷ []) "1John.2.18"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.18"
∷ word (ἀ ∷ ν ∷ τ ∷ ί ∷ χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ς ∷ []) "1John.2.18"
∷ word (ἔ ∷ ρ ∷ χ ∷ ε ∷ τ ∷ α ∷ ι ∷ []) "1John.2.18"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.18"
∷ word (ν ∷ ῦ ∷ ν ∷ []) "1John.2.18"
∷ word (ἀ ∷ ν ∷ τ ∷ ί ∷ χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ι ∷ []) "1John.2.18"
∷ word (π ∷ ο ∷ ∙λ ∷ ∙λ ∷ ο ∷ ὶ ∷ []) "1John.2.18"
∷ word (γ ∷ ε ∷ γ ∷ ό ∷ ν ∷ α ∷ σ ∷ ι ∷ ν ∷ []) "1John.2.18"
∷ word (ὅ ∷ θ ∷ ε ∷ ν ∷ []) "1John.2.18"
∷ word (γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.2.18"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.18"
∷ word (ἐ ∷ σ ∷ χ ∷ ά ∷ τ ∷ η ∷ []) "1John.2.18"
∷ word (ὥ ∷ ρ ∷ α ∷ []) "1John.2.18"
∷ word (ἐ ∷ σ ∷ τ ∷ ί ∷ ν ∷ []) "1John.2.18"
∷ word (ἐ ∷ ξ ∷ []) "1John.2.19"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.2.19"
∷ word (ἐ ∷ ξ ∷ ῆ ∷ ∙λ ∷ θ ∷ α ∷ ν ∷ []) "1John.2.19"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ []) "1John.2.19"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.2.19"
∷ word (ἦ ∷ σ ∷ α ∷ ν ∷ []) "1John.2.19"
∷ word (ἐ ∷ ξ ∷ []) "1John.2.19"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.2.19"
∷ word (ε ∷ ἰ ∷ []) "1John.2.19"
∷ word (γ ∷ ὰ ∷ ρ ∷ []) "1John.2.19"
∷ word (ἐ ∷ ξ ∷ []) "1John.2.19"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.2.19"
∷ word (ἦ ∷ σ ∷ α ∷ ν ∷ []) "1John.2.19"
∷ word (μ ∷ ε ∷ μ ∷ ε ∷ ν ∷ ή ∷ κ ∷ ε ∷ ι ∷ σ ∷ α ∷ ν ∷ []) "1John.2.19"
∷ word (ἂ ∷ ν ∷ []) "1John.2.19"
∷ word (μ ∷ ε ∷ θ ∷ []) "1John.2.19"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.2.19"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ []) "1John.2.19"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.2.19"
∷ word (φ ∷ α ∷ ν ∷ ε ∷ ρ ∷ ω ∷ θ ∷ ῶ ∷ σ ∷ ι ∷ ν ∷ []) "1John.2.19"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.19"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.2.19"
∷ word (ε ∷ ἰ ∷ σ ∷ ὶ ∷ ν ∷ []) "1John.2.19"
∷ word (π ∷ ά ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1John.2.19"
∷ word (ἐ ∷ ξ ∷ []) "1John.2.19"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.2.19"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.20"
∷ word (ὑ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.2.20"
∷ word (χ ∷ ρ ∷ ῖ ∷ σ ∷ μ ∷ α ∷ []) "1John.2.20"
∷ word (ἔ ∷ χ ∷ ε ∷ τ ∷ ε ∷ []) "1John.2.20"
∷ word (ἀ ∷ π ∷ ὸ ∷ []) "1John.2.20"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.2.20"
∷ word (ἁ ∷ γ ∷ ί ∷ ο ∷ υ ∷ []) "1John.2.20"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.20"
∷ word (ο ∷ ἴ ∷ δ ∷ α ∷ τ ∷ ε ∷ []) "1John.2.20"
∷ word (π ∷ ά ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1John.2.20"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.2.21"
∷ word (ἔ ∷ γ ∷ ρ ∷ α ∷ ψ ∷ α ∷ []) "1John.2.21"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.21"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.21"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.2.21"
∷ word (ο ∷ ἴ ∷ δ ∷ α ∷ τ ∷ ε ∷ []) "1John.2.21"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.2.21"
∷ word (ἀ ∷ ∙λ ∷ ή ∷ θ ∷ ε ∷ ι ∷ α ∷ ν ∷ []) "1John.2.21"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ []) "1John.2.21"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.21"
∷ word (ο ∷ ἴ ∷ δ ∷ α ∷ τ ∷ ε ∷ []) "1John.2.21"
∷ word (α ∷ ὐ ∷ τ ∷ ή ∷ ν ∷ []) "1John.2.21"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.21"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.21"
∷ word (π ∷ ᾶ ∷ ν ∷ []) "1John.2.21"
∷ word (ψ ∷ ε ∷ ῦ ∷ δ ∷ ο ∷ ς ∷ []) "1John.2.21"
∷ word (ἐ ∷ κ ∷ []) "1John.2.21"
∷ word (τ ∷ ῆ ∷ ς ∷ []) "1John.2.21"
∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ε ∷ ί ∷ α ∷ ς ∷ []) "1John.2.21"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.2.21"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.2.21"
∷ word (τ ∷ ί ∷ ς ∷ []) "1John.2.22"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.2.22"
∷ word (ὁ ∷ []) "1John.2.22"
∷ word (ψ ∷ ε ∷ ύ ∷ σ ∷ τ ∷ η ∷ ς ∷ []) "1John.2.22"
∷ word (ε ∷ ἰ ∷ []) "1John.2.22"
∷ word (μ ∷ ὴ ∷ []) "1John.2.22"
∷ word (ὁ ∷ []) "1John.2.22"
∷ word (ἀ ∷ ρ ∷ ν ∷ ο ∷ ύ ∷ μ ∷ ε ∷ ν ∷ ο ∷ ς ∷ []) "1John.2.22"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.22"
∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ ς ∷ []) "1John.2.22"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.2.22"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.2.22"
∷ word (ὁ ∷ []) "1John.2.22"
∷ word (χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ό ∷ ς ∷ []) "1John.2.22"
∷ word (ο ∷ ὗ ∷ τ ∷ ό ∷ ς ∷ []) "1John.2.22"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.2.22"
∷ word (ὁ ∷ []) "1John.2.22"
∷ word (ἀ ∷ ν ∷ τ ∷ ί ∷ χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ς ∷ []) "1John.2.22"
∷ word (ὁ ∷ []) "1John.2.22"
∷ word (ἀ ∷ ρ ∷ ν ∷ ο ∷ ύ ∷ μ ∷ ε ∷ ν ∷ ο ∷ ς ∷ []) "1John.2.22"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.22"
∷ word (π ∷ α ∷ τ ∷ έ ∷ ρ ∷ α ∷ []) "1John.2.22"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.22"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.22"
∷ word (υ ∷ ἱ ∷ ό ∷ ν ∷ []) "1John.2.22"
∷ word (π ∷ ᾶ ∷ ς ∷ []) "1John.2.23"
∷ word (ὁ ∷ []) "1John.2.23"
∷ word (ἀ ∷ ρ ∷ ν ∷ ο ∷ ύ ∷ μ ∷ ε ∷ ν ∷ ο ∷ ς ∷ []) "1John.2.23"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.23"
∷ word (υ ∷ ἱ ∷ ὸ ∷ ν ∷ []) "1John.2.23"
∷ word (ο ∷ ὐ ∷ δ ∷ ὲ ∷ []) "1John.2.23"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.23"
∷ word (π ∷ α ∷ τ ∷ έ ∷ ρ ∷ α ∷ []) "1John.2.23"
∷ word (ἔ ∷ χ ∷ ε ∷ ι ∷ []) "1John.2.23"
∷ word (ὁ ∷ []) "1John.2.23"
∷ word (ὁ ∷ μ ∷ ο ∷ ∙λ ∷ ο ∷ γ ∷ ῶ ∷ ν ∷ []) "1John.2.23"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.23"
∷ word (υ ∷ ἱ ∷ ὸ ∷ ν ∷ []) "1John.2.23"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.23"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.2.23"
∷ word (π ∷ α ∷ τ ∷ έ ∷ ρ ∷ α ∷ []) "1John.2.23"
∷ word (ἔ ∷ χ ∷ ε ∷ ι ∷ []) "1John.2.23"
∷ word (ὑ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.2.24"
∷ word (ὃ ∷ []) "1John.2.24"
∷ word (ἠ ∷ κ ∷ ο ∷ ύ ∷ σ ∷ α ∷ τ ∷ ε ∷ []) "1John.2.24"
∷ word (ἀ ∷ π ∷ []) "1John.2.24"
∷ word (ἀ ∷ ρ ∷ χ ∷ ῆ ∷ ς ∷ []) "1John.2.24"
∷ word (ἐ ∷ ν ∷ []) "1John.2.24"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.24"
∷ word (μ ∷ ε ∷ ν ∷ έ ∷ τ ∷ ω ∷ []) "1John.2.24"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.2.24"
∷ word (ἐ ∷ ν ∷ []) "1John.2.24"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.24"
∷ word (μ ∷ ε ∷ ί ∷ ν ∷ ῃ ∷ []) "1John.2.24"
∷ word (ὃ ∷ []) "1John.2.24"
∷ word (ἀ ∷ π ∷ []) "1John.2.24"
∷ word (ἀ ∷ ρ ∷ χ ∷ ῆ ∷ ς ∷ []) "1John.2.24"
∷ word (ἠ ∷ κ ∷ ο ∷ ύ ∷ σ ∷ α ∷ τ ∷ ε ∷ []) "1John.2.24"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.24"
∷ word (ὑ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.2.24"
∷ word (ἐ ∷ ν ∷ []) "1John.2.24"
∷ word (τ ∷ ῷ ∷ []) "1John.2.24"
∷ word (υ ∷ ἱ ∷ ῷ ∷ []) "1John.2.24"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.24"
∷ word (ἐ ∷ ν ∷ []) "1John.2.24"
∷ word (τ ∷ ῷ ∷ []) "1John.2.24"
∷ word (π ∷ α ∷ τ ∷ ρ ∷ ὶ ∷ []) "1John.2.24"
∷ word (μ ∷ ε ∷ ν ∷ ε ∷ ῖ ∷ τ ∷ ε ∷ []) "1John.2.24"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.25"
∷ word (α ∷ ὕ ∷ τ ∷ η ∷ []) "1John.2.25"
∷ word (ἐ ∷ σ ∷ τ ∷ ὶ ∷ ν ∷ []) "1John.2.25"
∷ word (ἡ ∷ []) "1John.2.25"
∷ word (ἐ ∷ π ∷ α ∷ γ ∷ γ ∷ ε ∷ ∙λ ∷ ί ∷ α ∷ []) "1John.2.25"
∷ word (ἣ ∷ ν ∷ []) "1John.2.25"
∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ς ∷ []) "1John.2.25"
∷ word (ἐ ∷ π ∷ η ∷ γ ∷ γ ∷ ε ∷ ί ∷ ∙λ ∷ α ∷ τ ∷ ο ∷ []) "1John.2.25"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.25"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.2.25"
∷ word (ζ ∷ ω ∷ ὴ ∷ ν ∷ []) "1John.2.25"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.2.25"
∷ word (α ∷ ἰ ∷ ώ ∷ ν ∷ ι ∷ ο ∷ ν ∷ []) "1John.2.25"
∷ word (Τ ∷ α ∷ ῦ ∷ τ ∷ α ∷ []) "1John.2.26"
∷ word (ἔ ∷ γ ∷ ρ ∷ α ∷ ψ ∷ α ∷ []) "1John.2.26"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.26"
∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "1John.2.26"
∷ word (τ ∷ ῶ ∷ ν ∷ []) "1John.2.26"
∷ word (π ∷ ∙λ ∷ α ∷ ν ∷ ώ ∷ ν ∷ τ ∷ ω ∷ ν ∷ []) "1John.2.26"
∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1John.2.26"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.27"
∷ word (ὑ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.2.27"
∷ word (τ ∷ ὸ ∷ []) "1John.2.27"
∷ word (χ ∷ ρ ∷ ῖ ∷ σ ∷ μ ∷ α ∷ []) "1John.2.27"
∷ word (ὃ ∷ []) "1John.2.27"
∷ word (ἐ ∷ ∙λ ∷ ά ∷ β ∷ ε ∷ τ ∷ ε ∷ []) "1John.2.27"
∷ word (ἀ ∷ π ∷ []) "1John.2.27"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.2.27"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ []) "1John.2.27"
∷ word (ἐ ∷ ν ∷ []) "1John.2.27"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.2.27"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.27"
∷ word (ο ∷ ὐ ∷ []) "1John.2.27"
∷ word (χ ∷ ρ ∷ ε ∷ ί ∷ α ∷ ν ∷ []) "1John.2.27"
∷ word (ἔ ∷ χ ∷ ε ∷ τ ∷ ε ∷ []) "1John.2.27"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.2.27"
∷ word (τ ∷ ι ∷ ς ∷ []) "1John.2.27"
∷ word (δ ∷ ι ∷ δ ∷ ά ∷ σ ∷ κ ∷ ῃ ∷ []) "1John.2.27"
∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1John.2.27"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ []) "1John.2.27"
∷ word (ὡ ∷ ς ∷ []) "1John.2.27"
∷ word (τ ∷ ὸ ∷ []) "1John.2.27"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.2.27"
∷ word (χ ∷ ρ ∷ ῖ ∷ σ ∷ μ ∷ α ∷ []) "1John.2.27"
∷ word (δ ∷ ι ∷ δ ∷ ά ∷ σ ∷ κ ∷ ε ∷ ι ∷ []) "1John.2.27"
∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1John.2.27"
∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "1John.2.27"
∷ word (π ∷ ά ∷ ν ∷ τ ∷ ω ∷ ν ∷ []) "1John.2.27"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.27"
∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ έ ∷ ς ∷ []) "1John.2.27"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.2.27"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.27"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.2.27"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.2.27"
∷ word (ψ ∷ ε ∷ ῦ ∷ δ ∷ ο ∷ ς ∷ []) "1John.2.27"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.27"
∷ word (κ ∷ α ∷ θ ∷ ὼ ∷ ς ∷ []) "1John.2.27"
∷ word (ἐ ∷ δ ∷ ί ∷ δ ∷ α ∷ ξ ∷ ε ∷ ν ∷ []) "1John.2.27"
∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1John.2.27"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ τ ∷ ε ∷ []) "1John.2.27"
∷ word (ἐ ∷ ν ∷ []) "1John.2.27"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.2.27"
∷ word (Κ ∷ α ∷ ὶ ∷ []) "1John.2.28"
∷ word (ν ∷ ῦ ∷ ν ∷ []) "1John.2.28"
∷ word (τ ∷ ε ∷ κ ∷ ν ∷ ί ∷ α ∷ []) "1John.2.28"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ τ ∷ ε ∷ []) "1John.2.28"
∷ word (ἐ ∷ ν ∷ []) "1John.2.28"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.2.28"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.2.28"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.2.28"
∷ word (φ ∷ α ∷ ν ∷ ε ∷ ρ ∷ ω ∷ θ ∷ ῇ ∷ []) "1John.2.28"
∷ word (σ ∷ χ ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.2.28"
∷ word (π ∷ α ∷ ρ ∷ ρ ∷ η ∷ σ ∷ ί ∷ α ∷ ν ∷ []) "1John.2.28"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.2.28"
∷ word (μ ∷ ὴ ∷ []) "1John.2.28"
∷ word (α ∷ ἰ ∷ σ ∷ χ ∷ υ ∷ ν ∷ θ ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.2.28"
∷ word (ἀ ∷ π ∷ []) "1John.2.28"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.2.28"
∷ word (ἐ ∷ ν ∷ []) "1John.2.28"
∷ word (τ ∷ ῇ ∷ []) "1John.2.28"
∷ word (π ∷ α ∷ ρ ∷ ο ∷ υ ∷ σ ∷ ί ∷ ᾳ ∷ []) "1John.2.28"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.2.28"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.2.29"
∷ word (ε ∷ ἰ ∷ δ ∷ ῆ ∷ τ ∷ ε ∷ []) "1John.2.29"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.29"
∷ word (δ ∷ ί ∷ κ ∷ α ∷ ι ∷ ό ∷ ς ∷ []) "1John.2.29"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.2.29"
∷ word (γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ε ∷ τ ∷ ε ∷ []) "1John.2.29"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.2.29"
∷ word (π ∷ ᾶ ∷ ς ∷ []) "1John.2.29"
∷ word (ὁ ∷ []) "1John.2.29"
∷ word (π ∷ ο ∷ ι ∷ ῶ ∷ ν ∷ []) "1John.2.29"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.2.29"
∷ word (δ ∷ ι ∷ κ ∷ α ∷ ι ∷ ο ∷ σ ∷ ύ ∷ ν ∷ η ∷ ν ∷ []) "1John.2.29"
∷ word (ἐ ∷ ξ ∷ []) "1John.2.29"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.2.29"
∷ word (γ ∷ ε ∷ γ ∷ έ ∷ ν ∷ ν ∷ η ∷ τ ∷ α ∷ ι ∷ []) "1John.2.29"
∷ word (ἴ ∷ δ ∷ ε ∷ τ ∷ ε ∷ []) "1John.3.1"
∷ word (π ∷ ο ∷ τ ∷ α ∷ π ∷ ὴ ∷ ν ∷ []) "1John.3.1"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ ν ∷ []) "1John.3.1"
∷ word (δ ∷ έ ∷ δ ∷ ω ∷ κ ∷ ε ∷ ν ∷ []) "1John.3.1"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.3.1"
∷ word (ὁ ∷ []) "1John.3.1"
∷ word (π ∷ α ∷ τ ∷ ὴ ∷ ρ ∷ []) "1John.3.1"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.3.1"
∷ word (τ ∷ έ ∷ κ ∷ ν ∷ α ∷ []) "1John.3.1"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.3.1"
∷ word (κ ∷ ∙λ ∷ η ∷ θ ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.1"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.1"
∷ word (ἐ ∷ σ ∷ μ ∷ έ ∷ ν ∷ []) "1John.3.1"
∷ word (δ ∷ ι ∷ ὰ ∷ []) "1John.3.1"
∷ word (τ ∷ ο ∷ ῦ ∷ τ ∷ ο ∷ []) "1John.3.1"
∷ word (ὁ ∷ []) "1John.3.1"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ ς ∷ []) "1John.3.1"
∷ word (ο ∷ ὐ ∷ []) "1John.3.1"
∷ word (γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ε ∷ ι ∷ []) "1John.3.1"
∷ word (ἡ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1John.3.1"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.1"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.3.1"
∷ word (ἔ ∷ γ ∷ ν ∷ ω ∷ []) "1John.3.1"
∷ word (α ∷ ὐ ∷ τ ∷ ό ∷ ν ∷ []) "1John.3.1"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ η ∷ τ ∷ ο ∷ ί ∷ []) "1John.3.2"
∷ word (ν ∷ ῦ ∷ ν ∷ []) "1John.3.2"
∷ word (τ ∷ έ ∷ κ ∷ ν ∷ α ∷ []) "1John.3.2"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.3.2"
∷ word (ἐ ∷ σ ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.2"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.2"
∷ word (ο ∷ ὔ ∷ π ∷ ω ∷ []) "1John.3.2"
∷ word (ἐ ∷ φ ∷ α ∷ ν ∷ ε ∷ ρ ∷ ώ ∷ θ ∷ η ∷ []) "1John.3.2"
∷ word (τ ∷ ί ∷ []) "1John.3.2"
∷ word (ἐ ∷ σ ∷ ό ∷ μ ∷ ε ∷ θ ∷ α ∷ []) "1John.3.2"
∷ word (ο ∷ ἴ ∷ δ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.2"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.2"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.3.2"
∷ word (φ ∷ α ∷ ν ∷ ε ∷ ρ ∷ ω ∷ θ ∷ ῇ ∷ []) "1John.3.2"
∷ word (ὅ ∷ μ ∷ ο ∷ ι ∷ ο ∷ ι ∷ []) "1John.3.2"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.3.2"
∷ word (ἐ ∷ σ ∷ ό ∷ μ ∷ ε ∷ θ ∷ α ∷ []) "1John.3.2"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.2"
∷ word (ὀ ∷ ψ ∷ ό ∷ μ ∷ ε ∷ θ ∷ α ∷ []) "1John.3.2"
∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ν ∷ []) "1John.3.2"
∷ word (κ ∷ α ∷ θ ∷ ώ ∷ ς ∷ []) "1John.3.2"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.3.2"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.3"
∷ word (π ∷ ᾶ ∷ ς ∷ []) "1John.3.3"
∷ word (ὁ ∷ []) "1John.3.3"
∷ word (ἔ ∷ χ ∷ ω ∷ ν ∷ []) "1John.3.3"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.3.3"
∷ word (ἐ ∷ ∙λ ∷ π ∷ ί ∷ δ ∷ α ∷ []) "1John.3.3"
∷ word (τ ∷ α ∷ ύ ∷ τ ∷ η ∷ ν ∷ []) "1John.3.3"
∷ word (ἐ ∷ π ∷ []) "1John.3.3"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.3.3"
∷ word (ἁ ∷ γ ∷ ν ∷ ί ∷ ζ ∷ ε ∷ ι ∷ []) "1John.3.3"
∷ word (ἑ ∷ α ∷ υ ∷ τ ∷ ὸ ∷ ν ∷ []) "1John.3.3"
∷ word (κ ∷ α ∷ θ ∷ ὼ ∷ ς ∷ []) "1John.3.3"
∷ word (ἐ ∷ κ ∷ ε ∷ ῖ ∷ ν ∷ ο ∷ ς ∷ []) "1John.3.3"
∷ word (ἁ ∷ γ ∷ ν ∷ ό ∷ ς ∷ []) "1John.3.3"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.3.3"
∷ word (Π ∷ ᾶ ∷ ς ∷ []) "1John.3.4"
∷ word (ὁ ∷ []) "1John.3.4"
∷ word (π ∷ ο ∷ ι ∷ ῶ ∷ ν ∷ []) "1John.3.4"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.3.4"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ ν ∷ []) "1John.3.4"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.4"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.3.4"
∷ word (ἀ ∷ ν ∷ ο ∷ μ ∷ ί ∷ α ∷ ν ∷ []) "1John.3.4"
∷ word (π ∷ ο ∷ ι ∷ ε ∷ ῖ ∷ []) "1John.3.4"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.4"
∷ word (ἡ ∷ []) "1John.3.4"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ []) "1John.3.4"
∷ word (ἐ ∷ σ ∷ τ ∷ ὶ ∷ ν ∷ []) "1John.3.4"
∷ word (ἡ ∷ []) "1John.3.4"
∷ word (ἀ ∷ ν ∷ ο ∷ μ ∷ ί ∷ α ∷ []) "1John.3.4"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.5"
∷ word (ο ∷ ἴ ∷ δ ∷ α ∷ τ ∷ ε ∷ []) "1John.3.5"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.5"
∷ word (ἐ ∷ κ ∷ ε ∷ ῖ ∷ ν ∷ ο ∷ ς ∷ []) "1John.3.5"
∷ word (ἐ ∷ φ ∷ α ∷ ν ∷ ε ∷ ρ ∷ ώ ∷ θ ∷ η ∷ []) "1John.3.5"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.3.5"
∷ word (τ ∷ ὰ ∷ ς ∷ []) "1John.3.5"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ ς ∷ []) "1John.3.5"
∷ word (ἄ ∷ ρ ∷ ῃ ∷ []) "1John.3.5"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.5"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ []) "1John.3.5"
∷ word (ἐ ∷ ν ∷ []) "1John.3.5"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.3.5"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.3.5"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.3.5"
∷ word (π ∷ ᾶ ∷ ς ∷ []) "1John.3.6"
∷ word (ὁ ∷ []) "1John.3.6"
∷ word (ἐ ∷ ν ∷ []) "1John.3.6"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.3.6"
∷ word (μ ∷ έ ∷ ν ∷ ω ∷ ν ∷ []) "1John.3.6"
∷ word (ο ∷ ὐ ∷ χ ∷ []) "1John.3.6"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ά ∷ ν ∷ ε ∷ ι ∷ []) "1John.3.6"
∷ word (π ∷ ᾶ ∷ ς ∷ []) "1John.3.6"
∷ word (ὁ ∷ []) "1John.3.6"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ά ∷ ν ∷ ω ∷ ν ∷ []) "1John.3.6"
∷ word (ο ∷ ὐ ∷ χ ∷ []) "1John.3.6"
∷ word (ἑ ∷ ώ ∷ ρ ∷ α ∷ κ ∷ ε ∷ ν ∷ []) "1John.3.6"
∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ν ∷ []) "1John.3.6"
∷ word (ο ∷ ὐ ∷ δ ∷ ὲ ∷ []) "1John.3.6"
∷ word (ἔ ∷ γ ∷ ν ∷ ω ∷ κ ∷ ε ∷ ν ∷ []) "1John.3.6"
∷ word (α ∷ ὐ ∷ τ ∷ ό ∷ ν ∷ []) "1John.3.6"
∷ word (τ ∷ ε ∷ κ ∷ ν ∷ ί ∷ α ∷ []) "1John.3.7"
∷ word (μ ∷ η ∷ δ ∷ ε ∷ ὶ ∷ ς ∷ []) "1John.3.7"
∷ word (π ∷ ∙λ ∷ α ∷ ν ∷ ά ∷ τ ∷ ω ∷ []) "1John.3.7"
∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1John.3.7"
∷ word (ὁ ∷ []) "1John.3.7"
∷ word (π ∷ ο ∷ ι ∷ ῶ ∷ ν ∷ []) "1John.3.7"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.3.7"
∷ word (δ ∷ ι ∷ κ ∷ α ∷ ι ∷ ο ∷ σ ∷ ύ ∷ ν ∷ η ∷ ν ∷ []) "1John.3.7"
∷ word (δ ∷ ί ∷ κ ∷ α ∷ ι ∷ ό ∷ ς ∷ []) "1John.3.7"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.3.7"
∷ word (κ ∷ α ∷ θ ∷ ὼ ∷ ς ∷ []) "1John.3.7"
∷ word (ἐ ∷ κ ∷ ε ∷ ῖ ∷ ν ∷ ο ∷ ς ∷ []) "1John.3.7"
∷ word (δ ∷ ί ∷ κ ∷ α ∷ ι ∷ ό ∷ ς ∷ []) "1John.3.7"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.3.7"
∷ word (ὁ ∷ []) "1John.3.8"
∷ word (π ∷ ο ∷ ι ∷ ῶ ∷ ν ∷ []) "1John.3.8"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.3.8"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ ν ∷ []) "1John.3.8"
∷ word (ἐ ∷ κ ∷ []) "1John.3.8"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.3.8"
∷ word (δ ∷ ι ∷ α ∷ β ∷ ό ∷ ∙λ ∷ ο ∷ υ ∷ []) "1John.3.8"
∷ word (ἐ ∷ σ ∷ τ ∷ ί ∷ ν ∷ []) "1John.3.8"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.8"
∷ word (ἀ ∷ π ∷ []) "1John.3.8"
∷ word (ἀ ∷ ρ ∷ χ ∷ ῆ ∷ ς ∷ []) "1John.3.8"
∷ word (ὁ ∷ []) "1John.3.8"
∷ word (δ ∷ ι ∷ ά ∷ β ∷ ο ∷ ∙λ ∷ ο ∷ ς ∷ []) "1John.3.8"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ά ∷ ν ∷ ε ∷ ι ∷ []) "1John.3.8"
∷ word (ε ∷ ἰ ∷ ς ∷ []) "1John.3.8"
∷ word (τ ∷ ο ∷ ῦ ∷ τ ∷ ο ∷ []) "1John.3.8"
∷ word (ἐ ∷ φ ∷ α ∷ ν ∷ ε ∷ ρ ∷ ώ ∷ θ ∷ η ∷ []) "1John.3.8"
∷ word (ὁ ∷ []) "1John.3.8"
∷ word (υ ∷ ἱ ∷ ὸ ∷ ς ∷ []) "1John.3.8"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.3.8"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.3.8"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.3.8"
∷ word (∙λ ∷ ύ ∷ σ ∷ ῃ ∷ []) "1John.3.8"
∷ word (τ ∷ ὰ ∷ []) "1John.3.8"
∷ word (ἔ ∷ ρ ∷ γ ∷ α ∷ []) "1John.3.8"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.3.8"
∷ word (δ ∷ ι ∷ α ∷ β ∷ ό ∷ ∙λ ∷ ο ∷ υ ∷ []) "1John.3.8"
∷ word (π ∷ ᾶ ∷ ς ∷ []) "1John.3.9"
∷ word (ὁ ∷ []) "1John.3.9"
∷ word (γ ∷ ε ∷ γ ∷ ε ∷ ν ∷ ν ∷ η ∷ μ ∷ έ ∷ ν ∷ ο ∷ ς ∷ []) "1John.3.9"
∷ word (ἐ ∷ κ ∷ []) "1John.3.9"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.3.9"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.3.9"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ ν ∷ []) "1John.3.9"
∷ word (ο ∷ ὐ ∷ []) "1John.3.9"
∷ word (π ∷ ο ∷ ι ∷ ε ∷ ῖ ∷ []) "1John.3.9"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.9"
∷ word (σ ∷ π ∷ έ ∷ ρ ∷ μ ∷ α ∷ []) "1John.3.9"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.9"
∷ word (ἐ ∷ ν ∷ []) "1John.3.9"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.3.9"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ []) "1John.3.9"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.9"
∷ word (ο ∷ ὐ ∷ []) "1John.3.9"
∷ word (δ ∷ ύ ∷ ν ∷ α ∷ τ ∷ α ∷ ι ∷ []) "1John.3.9"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ά ∷ ν ∷ ε ∷ ι ∷ ν ∷ []) "1John.3.9"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.9"
∷ word (ἐ ∷ κ ∷ []) "1John.3.9"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.3.9"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.3.9"
∷ word (γ ∷ ε ∷ γ ∷ έ ∷ ν ∷ ν ∷ η ∷ τ ∷ α ∷ ι ∷ []) "1John.3.9"
∷ word (ἐ ∷ ν ∷ []) "1John.3.10"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1John.3.10"
∷ word (φ ∷ α ∷ ν ∷ ε ∷ ρ ∷ ά ∷ []) "1John.3.10"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.3.10"
∷ word (τ ∷ ὰ ∷ []) "1John.3.10"
∷ word (τ ∷ έ ∷ κ ∷ ν ∷ α ∷ []) "1John.3.10"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.3.10"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.3.10"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.10"
∷ word (τ ∷ ὰ ∷ []) "1John.3.10"
∷ word (τ ∷ έ ∷ κ ∷ ν ∷ α ∷ []) "1John.3.10"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.3.10"
∷ word (δ ∷ ι ∷ α ∷ β ∷ ό ∷ ∙λ ∷ ο ∷ υ ∷ []) "1John.3.10"
∷ word (π ∷ ᾶ ∷ ς ∷ []) "1John.3.10"
∷ word (ὁ ∷ []) "1John.3.10"
∷ word (μ ∷ ὴ ∷ []) "1John.3.10"
∷ word (π ∷ ο ∷ ι ∷ ῶ ∷ ν ∷ []) "1John.3.10"
∷ word (δ ∷ ι ∷ κ ∷ α ∷ ι ∷ ο ∷ σ ∷ ύ ∷ ν ∷ η ∷ ν ∷ []) "1John.3.10"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.3.10"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.3.10"
∷ word (ἐ ∷ κ ∷ []) "1John.3.10"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.3.10"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.3.10"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.10"
∷ word (ὁ ∷ []) "1John.3.10"
∷ word (μ ∷ ὴ ∷ []) "1John.3.10"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ ν ∷ []) "1John.3.10"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.3.10"
∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ὸ ∷ ν ∷ []) "1John.3.10"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.10"
∷ word (Ὅ ∷ τ ∷ ι ∷ []) "1John.3.11"
∷ word (α ∷ ὕ ∷ τ ∷ η ∷ []) "1John.3.11"
∷ word (ἐ ∷ σ ∷ τ ∷ ὶ ∷ ν ∷ []) "1John.3.11"
∷ word (ἡ ∷ []) "1John.3.11"
∷ word (ἀ ∷ γ ∷ γ ∷ ε ∷ ∙λ ∷ ί ∷ α ∷ []) "1John.3.11"
∷ word (ἣ ∷ ν ∷ []) "1John.3.11"
∷ word (ἠ ∷ κ ∷ ο ∷ ύ ∷ σ ∷ α ∷ τ ∷ ε ∷ []) "1John.3.11"
∷ word (ἀ ∷ π ∷ []) "1John.3.11"
∷ word (ἀ ∷ ρ ∷ χ ∷ ῆ ∷ ς ∷ []) "1John.3.11"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.3.11"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.11"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ή ∷ ∙λ ∷ ο ∷ υ ∷ ς ∷ []) "1John.3.11"
∷ word (ο ∷ ὐ ∷ []) "1John.3.12"
∷ word (κ ∷ α ∷ θ ∷ ὼ ∷ ς ∷ []) "1John.3.12"
∷ word (Κ ∷ ά ∷ ϊ ∷ ν ∷ []) "1John.3.12"
∷ word (ἐ ∷ κ ∷ []) "1John.3.12"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.3.12"
∷ word (π ∷ ο ∷ ν ∷ η ∷ ρ ∷ ο ∷ ῦ ∷ []) "1John.3.12"
∷ word (ἦ ∷ ν ∷ []) "1John.3.12"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.12"
∷ word (ἔ ∷ σ ∷ φ ∷ α ∷ ξ ∷ ε ∷ ν ∷ []) "1John.3.12"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.3.12"
∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ὸ ∷ ν ∷ []) "1John.3.12"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.12"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.12"
∷ word (χ ∷ ά ∷ ρ ∷ ι ∷ ν ∷ []) "1John.3.12"
∷ word (τ ∷ ί ∷ ν ∷ ο ∷ ς ∷ []) "1John.3.12"
∷ word (ἔ ∷ σ ∷ φ ∷ α ∷ ξ ∷ ε ∷ ν ∷ []) "1John.3.12"
∷ word (α ∷ ὐ ∷ τ ∷ ό ∷ ν ∷ []) "1John.3.12"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.12"
∷ word (τ ∷ ὰ ∷ []) "1John.3.12"
∷ word (ἔ ∷ ρ ∷ γ ∷ α ∷ []) "1John.3.12"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.12"
∷ word (π ∷ ο ∷ ν ∷ η ∷ ρ ∷ ὰ ∷ []) "1John.3.12"
∷ word (ἦ ∷ ν ∷ []) "1John.3.12"
∷ word (τ ∷ ὰ ∷ []) "1John.3.12"
∷ word (δ ∷ ὲ ∷ []) "1John.3.12"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.3.12"
∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ο ∷ ῦ ∷ []) "1John.3.12"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.12"
∷ word (δ ∷ ί ∷ κ ∷ α ∷ ι ∷ α ∷ []) "1John.3.12"
∷ word (μ ∷ ὴ ∷ []) "1John.3.13"
∷ word (θ ∷ α ∷ υ ∷ μ ∷ ά ∷ ζ ∷ ε ∷ τ ∷ ε ∷ []) "1John.3.13"
∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ο ∷ ί ∷ []) "1John.3.13"
∷ word (ε ∷ ἰ ∷ []) "1John.3.13"
∷ word (μ ∷ ι ∷ σ ∷ ε ∷ ῖ ∷ []) "1John.3.13"
∷ word (ὑ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1John.3.13"
∷ word (ὁ ∷ []) "1John.3.13"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ ς ∷ []) "1John.3.13"
∷ word (ἡ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.3.14"
∷ word (ο ∷ ἴ ∷ δ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.14"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.14"
∷ word (μ ∷ ε ∷ τ ∷ α ∷ β ∷ ε ∷ β ∷ ή ∷ κ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.14"
∷ word (ἐ ∷ κ ∷ []) "1John.3.14"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.3.14"
∷ word (θ ∷ α ∷ ν ∷ ά ∷ τ ∷ ο ∷ υ ∷ []) "1John.3.14"
∷ word (ε ∷ ἰ ∷ ς ∷ []) "1John.3.14"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.3.14"
∷ word (ζ ∷ ω ∷ ή ∷ ν ∷ []) "1John.3.14"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.14"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.14"
∷ word (τ ∷ ο ∷ ὺ ∷ ς ∷ []) "1John.3.14"
∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ο ∷ ύ ∷ ς ∷ []) "1John.3.14"
∷ word (ὁ ∷ []) "1John.3.14"
∷ word (μ ∷ ὴ ∷ []) "1John.3.14"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ ν ∷ []) "1John.3.14"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ []) "1John.3.14"
∷ word (ἐ ∷ ν ∷ []) "1John.3.14"
∷ word (τ ∷ ῷ ∷ []) "1John.3.14"
∷ word (θ ∷ α ∷ ν ∷ ά ∷ τ ∷ ῳ ∷ []) "1John.3.14"
∷ word (π ∷ ᾶ ∷ ς ∷ []) "1John.3.15"
∷ word (ὁ ∷ []) "1John.3.15"
∷ word (μ ∷ ι ∷ σ ∷ ῶ ∷ ν ∷ []) "1John.3.15"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.3.15"
∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ὸ ∷ ν ∷ []) "1John.3.15"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.15"
∷ word (ἀ ∷ ν ∷ θ ∷ ρ ∷ ω ∷ π ∷ ο ∷ κ ∷ τ ∷ ό ∷ ν ∷ ο ∷ ς ∷ []) "1John.3.15"
∷ word (ἐ ∷ σ ∷ τ ∷ ί ∷ ν ∷ []) "1John.3.15"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.15"
∷ word (ο ∷ ἴ ∷ δ ∷ α ∷ τ ∷ ε ∷ []) "1John.3.15"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.15"
∷ word (π ∷ ᾶ ∷ ς ∷ []) "1John.3.15"
∷ word (ἀ ∷ ν ∷ θ ∷ ρ ∷ ω ∷ π ∷ ο ∷ κ ∷ τ ∷ ό ∷ ν ∷ ο ∷ ς ∷ []) "1John.3.15"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.3.15"
∷ word (ἔ ∷ χ ∷ ε ∷ ι ∷ []) "1John.3.15"
∷ word (ζ ∷ ω ∷ ὴ ∷ ν ∷ []) "1John.3.15"
∷ word (α ∷ ἰ ∷ ώ ∷ ν ∷ ι ∷ ο ∷ ν ∷ []) "1John.3.15"
∷ word (ἐ ∷ ν ∷ []) "1John.3.15"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.3.15"
∷ word (μ ∷ έ ∷ ν ∷ ο ∷ υ ∷ σ ∷ α ∷ ν ∷ []) "1John.3.15"
∷ word (ἐ ∷ ν ∷ []) "1John.3.16"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1John.3.16"
∷ word (ἐ ∷ γ ∷ ν ∷ ώ ∷ κ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.16"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.3.16"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ ν ∷ []) "1John.3.16"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.16"
∷ word (ἐ ∷ κ ∷ ε ∷ ῖ ∷ ν ∷ ο ∷ ς ∷ []) "1John.3.16"
∷ word (ὑ ∷ π ∷ ὲ ∷ ρ ∷ []) "1John.3.16"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.3.16"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.3.16"
∷ word (ψ ∷ υ ∷ χ ∷ ὴ ∷ ν ∷ []) "1John.3.16"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.16"
∷ word (ἔ ∷ θ ∷ η ∷ κ ∷ ε ∷ ν ∷ []) "1John.3.16"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.16"
∷ word (ἡ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.3.16"
∷ word (ὀ ∷ φ ∷ ε ∷ ί ∷ ∙λ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.16"
∷ word (ὑ ∷ π ∷ ὲ ∷ ρ ∷ []) "1John.3.16"
∷ word (τ ∷ ῶ ∷ ν ∷ []) "1John.3.16"
∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ῶ ∷ ν ∷ []) "1John.3.16"
∷ word (τ ∷ ὰ ∷ ς ∷ []) "1John.3.16"
∷ word (ψ ∷ υ ∷ χ ∷ ὰ ∷ ς ∷ []) "1John.3.16"
∷ word (θ ∷ ε ∷ ῖ ∷ ν ∷ α ∷ ι ∷ []) "1John.3.16"
∷ word (ὃ ∷ ς ∷ []) "1John.3.17"
∷ word (δ ∷ []) "1John.3.17"
∷ word (ἂ ∷ ν ∷ []) "1John.3.17"
∷ word (ἔ ∷ χ ∷ ῃ ∷ []) "1John.3.17"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.3.17"
∷ word (β ∷ ί ∷ ο ∷ ν ∷ []) "1John.3.17"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.3.17"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ υ ∷ []) "1John.3.17"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.17"
∷ word (θ ∷ ε ∷ ω ∷ ρ ∷ ῇ ∷ []) "1John.3.17"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.3.17"
∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ὸ ∷ ν ∷ []) "1John.3.17"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.17"
∷ word (χ ∷ ρ ∷ ε ∷ ί ∷ α ∷ ν ∷ []) "1John.3.17"
∷ word (ἔ ∷ χ ∷ ο ∷ ν ∷ τ ∷ α ∷ []) "1John.3.17"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.17"
∷ word (κ ∷ ∙λ ∷ ε ∷ ί ∷ σ ∷ ῃ ∷ []) "1John.3.17"
∷ word (τ ∷ ὰ ∷ []) "1John.3.17"
∷ word (σ ∷ π ∷ ∙λ ∷ ά ∷ γ ∷ χ ∷ ν ∷ α ∷ []) "1John.3.17"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.17"
∷ word (ἀ ∷ π ∷ []) "1John.3.17"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.17"
∷ word (π ∷ ῶ ∷ ς ∷ []) "1John.3.17"
∷ word (ἡ ∷ []) "1John.3.17"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ []) "1John.3.17"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.3.17"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.3.17"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ []) "1John.3.17"
∷ word (ἐ ∷ ν ∷ []) "1John.3.17"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.3.17"
∷ word (Τ ∷ ε ∷ κ ∷ ν ∷ ί ∷ α ∷ []) "1John.3.18"
∷ word (μ ∷ ὴ ∷ []) "1John.3.18"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.18"
∷ word (∙λ ∷ ό ∷ γ ∷ ῳ ∷ []) "1John.3.18"
∷ word (μ ∷ η ∷ δ ∷ ὲ ∷ []) "1John.3.18"
∷ word (τ ∷ ῇ ∷ []) "1John.3.18"
∷ word (γ ∷ ∙λ ∷ ώ ∷ σ ∷ σ ∷ ῃ ∷ []) "1John.3.18"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1John.3.18"
∷ word (ἐ ∷ ν ∷ []) "1John.3.18"
∷ word (ἔ ∷ ρ ∷ γ ∷ ῳ ∷ []) "1John.3.18"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.18"
∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ε ∷ ί ∷ ᾳ ∷ []) "1John.3.18"
∷ word (ἐ ∷ ν ∷ []) "1John.3.19"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1John.3.19"
∷ word (γ ∷ ν ∷ ω ∷ σ ∷ ό ∷ μ ∷ ε ∷ θ ∷ α ∷ []) "1John.3.19"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.19"
∷ word (ἐ ∷ κ ∷ []) "1John.3.19"
∷ word (τ ∷ ῆ ∷ ς ∷ []) "1John.3.19"
∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ε ∷ ί ∷ α ∷ ς ∷ []) "1John.3.19"
∷ word (ἐ ∷ σ ∷ μ ∷ έ ∷ ν ∷ []) "1John.3.19"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.19"
∷ word (ἔ ∷ μ ∷ π ∷ ρ ∷ ο ∷ σ ∷ θ ∷ ε ∷ ν ∷ []) "1John.3.19"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.19"
∷ word (π ∷ ε ∷ ί ∷ σ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.19"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.3.19"
∷ word (κ ∷ α ∷ ρ ∷ δ ∷ ί ∷ α ∷ ν ∷ []) "1John.3.19"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.3.19"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.20"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.3.20"
∷ word (κ ∷ α ∷ τ ∷ α ∷ γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ῃ ∷ []) "1John.3.20"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.3.20"
∷ word (ἡ ∷ []) "1John.3.20"
∷ word (κ ∷ α ∷ ρ ∷ δ ∷ ί ∷ α ∷ []) "1John.3.20"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.20"
∷ word (μ ∷ ε ∷ ί ∷ ζ ∷ ω ∷ ν ∷ []) "1John.3.20"
∷ word (ἐ ∷ σ ∷ τ ∷ ὶ ∷ ν ∷ []) "1John.3.20"
∷ word (ὁ ∷ []) "1John.3.20"
∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1John.3.20"
∷ word (τ ∷ ῆ ∷ ς ∷ []) "1John.3.20"
∷ word (κ ∷ α ∷ ρ ∷ δ ∷ ί ∷ α ∷ ς ∷ []) "1John.3.20"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.3.20"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.20"
∷ word (γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ε ∷ ι ∷ []) "1John.3.20"
∷ word (π ∷ ά ∷ ν ∷ τ ∷ α ∷ []) "1John.3.20"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ η ∷ τ ∷ ο ∷ ί ∷ []) "1John.3.21"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.3.21"
∷ word (ἡ ∷ []) "1John.3.21"
∷ word (κ ∷ α ∷ ρ ∷ δ ∷ ί ∷ α ∷ []) "1John.3.21"
∷ word (μ ∷ ὴ ∷ []) "1John.3.21"
∷ word (κ ∷ α ∷ τ ∷ α ∷ γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ῃ ∷ []) "1John.3.21"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.3.21"
∷ word (π ∷ α ∷ ρ ∷ ρ ∷ η ∷ σ ∷ ί ∷ α ∷ ν ∷ []) "1John.3.21"
∷ word (ἔ ∷ χ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.21"
∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "1John.3.21"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.3.21"
∷ word (θ ∷ ε ∷ ό ∷ ν ∷ []) "1John.3.21"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.22"
∷ word (ὃ ∷ []) "1John.3.22"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.3.22"
∷ word (α ∷ ἰ ∷ τ ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.22"
∷ word (∙λ ∷ α ∷ μ ∷ β ∷ ά ∷ ν ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.22"
∷ word (ἀ ∷ π ∷ []) "1John.3.22"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.22"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.22"
∷ word (τ ∷ ὰ ∷ ς ∷ []) "1John.3.22"
∷ word (ἐ ∷ ν ∷ τ ∷ ο ∷ ∙λ ∷ ὰ ∷ ς ∷ []) "1John.3.22"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.22"
∷ word (τ ∷ η ∷ ρ ∷ ο ∷ ῦ ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.22"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.22"
∷ word (τ ∷ ὰ ∷ []) "1John.3.22"
∷ word (ἀ ∷ ρ ∷ ε ∷ σ ∷ τ ∷ ὰ ∷ []) "1John.3.22"
∷ word (ἐ ∷ ν ∷ ώ ∷ π ∷ ι ∷ ο ∷ ν ∷ []) "1John.3.22"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.22"
∷ word (π ∷ ο ∷ ι ∷ ο ∷ ῦ ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.22"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.23"
∷ word (α ∷ ὕ ∷ τ ∷ η ∷ []) "1John.3.23"
∷ word (ἐ ∷ σ ∷ τ ∷ ὶ ∷ ν ∷ []) "1John.3.23"
∷ word (ἡ ∷ []) "1John.3.23"
∷ word (ἐ ∷ ν ∷ τ ∷ ο ∷ ∙λ ∷ ὴ ∷ []) "1John.3.23"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.23"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.3.23"
∷ word (π ∷ ι ∷ σ ∷ τ ∷ ε ∷ ύ ∷ σ ∷ ω ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.23"
∷ word (τ ∷ ῷ ∷ []) "1John.3.23"
∷ word (ὀ ∷ ν ∷ ό ∷ μ ∷ α ∷ τ ∷ ι ∷ []) "1John.3.23"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.3.23"
∷ word (υ ∷ ἱ ∷ ο ∷ ῦ ∷ []) "1John.3.23"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.23"
∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "1John.3.23"
∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.23"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.23"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.23"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ή ∷ ∙λ ∷ ο ∷ υ ∷ ς ∷ []) "1John.3.23"
∷ word (κ ∷ α ∷ θ ∷ ὼ ∷ ς ∷ []) "1John.3.23"
∷ word (ἔ ∷ δ ∷ ω ∷ κ ∷ ε ∷ ν ∷ []) "1John.3.23"
∷ word (ἐ ∷ ν ∷ τ ∷ ο ∷ ∙λ ∷ ὴ ∷ ν ∷ []) "1John.3.23"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.3.23"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.24"
∷ word (ὁ ∷ []) "1John.3.24"
∷ word (τ ∷ η ∷ ρ ∷ ῶ ∷ ν ∷ []) "1John.3.24"
∷ word (τ ∷ ὰ ∷ ς ∷ []) "1John.3.24"
∷ word (ἐ ∷ ν ∷ τ ∷ ο ∷ ∙λ ∷ ὰ ∷ ς ∷ []) "1John.3.24"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.3.24"
∷ word (ἐ ∷ ν ∷ []) "1John.3.24"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.3.24"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ []) "1John.3.24"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.24"
∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ς ∷ []) "1John.3.24"
∷ word (ἐ ∷ ν ∷ []) "1John.3.24"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.3.24"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.3.24"
∷ word (ἐ ∷ ν ∷ []) "1John.3.24"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1John.3.24"
∷ word (γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.3.24"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.3.24"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ []) "1John.3.24"
∷ word (ἐ ∷ ν ∷ []) "1John.3.24"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.3.24"
∷ word (ἐ ∷ κ ∷ []) "1John.3.24"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.3.24"
∷ word (π ∷ ν ∷ ε ∷ ύ ∷ μ ∷ α ∷ τ ∷ ο ∷ ς ∷ []) "1John.3.24"
∷ word (ο ∷ ὗ ∷ []) "1John.3.24"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.3.24"
∷ word (ἔ ∷ δ ∷ ω ∷ κ ∷ ε ∷ ν ∷ []) "1John.3.24"
∷ word (Ἀ ∷ γ ∷ α ∷ π ∷ η ∷ τ ∷ ο ∷ ί ∷ []) "1John.4.1"
∷ word (μ ∷ ὴ ∷ []) "1John.4.1"
∷ word (π ∷ α ∷ ν ∷ τ ∷ ὶ ∷ []) "1John.4.1"
∷ word (π ∷ ν ∷ ε ∷ ύ ∷ μ ∷ α ∷ τ ∷ ι ∷ []) "1John.4.1"
∷ word (π ∷ ι ∷ σ ∷ τ ∷ ε ∷ ύ ∷ ε ∷ τ ∷ ε ∷ []) "1John.4.1"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ὰ ∷ []) "1John.4.1"
∷ word (δ ∷ ο ∷ κ ∷ ι ∷ μ ∷ ά ∷ ζ ∷ ε ∷ τ ∷ ε ∷ []) "1John.4.1"
∷ word (τ ∷ ὰ ∷ []) "1John.4.1"
∷ word (π ∷ ν ∷ ε ∷ ύ ∷ μ ∷ α ∷ τ ∷ α ∷ []) "1John.4.1"
∷ word (ε ∷ ἰ ∷ []) "1John.4.1"
∷ word (ἐ ∷ κ ∷ []) "1John.4.1"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.1"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.4.1"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.4.1"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.1"
∷ word (π ∷ ο ∷ ∙λ ∷ ∙λ ∷ ο ∷ ὶ ∷ []) "1John.4.1"
∷ word (ψ ∷ ε ∷ υ ∷ δ ∷ ο ∷ π ∷ ρ ∷ ο ∷ φ ∷ ῆ ∷ τ ∷ α ∷ ι ∷ []) "1John.4.1"
∷ word (ἐ ∷ ξ ∷ ε ∷ ∙λ ∷ η ∷ ∙λ ∷ ύ ∷ θ ∷ α ∷ σ ∷ ι ∷ ν ∷ []) "1John.4.1"
∷ word (ε ∷ ἰ ∷ ς ∷ []) "1John.4.1"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.1"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ ν ∷ []) "1John.4.1"
∷ word (ἐ ∷ ν ∷ []) "1John.4.2"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1John.4.2"
∷ word (γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ε ∷ τ ∷ ε ∷ []) "1John.4.2"
∷ word (τ ∷ ὸ ∷ []) "1John.4.2"
∷ word (π ∷ ν ∷ ε ∷ ῦ ∷ μ ∷ α ∷ []) "1John.4.2"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.2"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.4.2"
∷ word (π ∷ ᾶ ∷ ν ∷ []) "1John.4.2"
∷ word (π ∷ ν ∷ ε ∷ ῦ ∷ μ ∷ α ∷ []) "1John.4.2"
∷ word (ὃ ∷ []) "1John.4.2"
∷ word (ὁ ∷ μ ∷ ο ∷ ∙λ ∷ ο ∷ γ ∷ ε ∷ ῖ ∷ []) "1John.4.2"
∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ ν ∷ []) "1John.4.2"
∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ὸ ∷ ν ∷ []) "1John.4.2"
∷ word (ἐ ∷ ν ∷ []) "1John.4.2"
∷ word (σ ∷ α ∷ ρ ∷ κ ∷ ὶ ∷ []) "1John.4.2"
∷ word (ἐ ∷ ∙λ ∷ η ∷ ∙λ ∷ υ ∷ θ ∷ ό ∷ τ ∷ α ∷ []) "1John.4.2"
∷ word (ἐ ∷ κ ∷ []) "1John.4.2"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.2"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.4.2"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.4.2"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.3"
∷ word (π ∷ ᾶ ∷ ν ∷ []) "1John.4.3"
∷ word (π ∷ ν ∷ ε ∷ ῦ ∷ μ ∷ α ∷ []) "1John.4.3"
∷ word (ὃ ∷ []) "1John.4.3"
∷ word (μ ∷ ὴ ∷ []) "1John.4.3"
∷ word (ὁ ∷ μ ∷ ο ∷ ∙λ ∷ ο ∷ γ ∷ ε ∷ ῖ ∷ []) "1John.4.3"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.3"
∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ ν ∷ []) "1John.4.3"
∷ word (ἐ ∷ κ ∷ []) "1John.4.3"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.3"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.4.3"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.4.3"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.4.3"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.3"
∷ word (τ ∷ ο ∷ ῦ ∷ τ ∷ ό ∷ []) "1John.4.3"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.4.3"
∷ word (τ ∷ ὸ ∷ []) "1John.4.3"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.3"
∷ word (ἀ ∷ ν ∷ τ ∷ ι ∷ χ ∷ ρ ∷ ί ∷ σ ∷ τ ∷ ο ∷ υ ∷ []) "1John.4.3"
∷ word (ὃ ∷ []) "1John.4.3"
∷ word (ἀ ∷ κ ∷ η ∷ κ ∷ ό ∷ α ∷ τ ∷ ε ∷ []) "1John.4.3"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.3"
∷ word (ἔ ∷ ρ ∷ χ ∷ ε ∷ τ ∷ α ∷ ι ∷ []) "1John.4.3"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.3"
∷ word (ν ∷ ῦ ∷ ν ∷ []) "1John.4.3"
∷ word (ἐ ∷ ν ∷ []) "1John.4.3"
∷ word (τ ∷ ῷ ∷ []) "1John.4.3"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ῳ ∷ []) "1John.4.3"
∷ word (ἐ ∷ σ ∷ τ ∷ ὶ ∷ ν ∷ []) "1John.4.3"
∷ word (ἤ ∷ δ ∷ η ∷ []) "1John.4.3"
∷ word (ὑ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.4.4"
∷ word (ἐ ∷ κ ∷ []) "1John.4.4"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.4"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.4.4"
∷ word (ἐ ∷ σ ∷ τ ∷ ε ∷ []) "1John.4.4"
∷ word (τ ∷ ε ∷ κ ∷ ν ∷ ί ∷ α ∷ []) "1John.4.4"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.4"
∷ word (ν ∷ ε ∷ ν ∷ ι ∷ κ ∷ ή ∷ κ ∷ α ∷ τ ∷ ε ∷ []) "1John.4.4"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ύ ∷ ς ∷ []) "1John.4.4"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.4"
∷ word (μ ∷ ε ∷ ί ∷ ζ ∷ ω ∷ ν ∷ []) "1John.4.4"
∷ word (ἐ ∷ σ ∷ τ ∷ ὶ ∷ ν ∷ []) "1John.4.4"
∷ word (ὁ ∷ []) "1John.4.4"
∷ word (ἐ ∷ ν ∷ []) "1John.4.4"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.4.4"
∷ word (ἢ ∷ []) "1John.4.4"
∷ word (ὁ ∷ []) "1John.4.4"
∷ word (ἐ ∷ ν ∷ []) "1John.4.4"
∷ word (τ ∷ ῷ ∷ []) "1John.4.4"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ῳ ∷ []) "1John.4.4"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ὶ ∷ []) "1John.4.5"
∷ word (ἐ ∷ κ ∷ []) "1John.4.5"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.5"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ υ ∷ []) "1John.4.5"
∷ word (ε ∷ ἰ ∷ σ ∷ ί ∷ ν ∷ []) "1John.4.5"
∷ word (δ ∷ ι ∷ ὰ ∷ []) "1John.4.5"
∷ word (τ ∷ ο ∷ ῦ ∷ τ ∷ ο ∷ []) "1John.4.5"
∷ word (ἐ ∷ κ ∷ []) "1John.4.5"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.5"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ υ ∷ []) "1John.4.5"
∷ word (∙λ ∷ α ∷ ∙λ ∷ ο ∷ ῦ ∷ σ ∷ ι ∷ ν ∷ []) "1John.4.5"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.5"
∷ word (ὁ ∷ []) "1John.4.5"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ ς ∷ []) "1John.4.5"
∷ word (α ∷ ὐ ∷ τ ∷ ῶ ∷ ν ∷ []) "1John.4.5"
∷ word (ἀ ∷ κ ∷ ο ∷ ύ ∷ ε ∷ ι ∷ []) "1John.4.5"
∷ word (ἡ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.4.6"
∷ word (ἐ ∷ κ ∷ []) "1John.4.6"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.6"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.4.6"
∷ word (ἐ ∷ σ ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.6"
∷ word (ὁ ∷ []) "1John.4.6"
∷ word (γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ω ∷ ν ∷ []) "1John.4.6"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.6"
∷ word (θ ∷ ε ∷ ὸ ∷ ν ∷ []) "1John.4.6"
∷ word (ἀ ∷ κ ∷ ο ∷ ύ ∷ ε ∷ ι ∷ []) "1John.4.6"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.4.6"
∷ word (ὃ ∷ ς ∷ []) "1John.4.6"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.4.6"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.4.6"
∷ word (ἐ ∷ κ ∷ []) "1John.4.6"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.6"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.4.6"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.4.6"
∷ word (ἀ ∷ κ ∷ ο ∷ ύ ∷ ε ∷ ι ∷ []) "1John.4.6"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.4.6"
∷ word (ἐ ∷ κ ∷ []) "1John.4.6"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ο ∷ υ ∷ []) "1John.4.6"
∷ word (γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.6"
∷ word (τ ∷ ὸ ∷ []) "1John.4.6"
∷ word (π ∷ ν ∷ ε ∷ ῦ ∷ μ ∷ α ∷ []) "1John.4.6"
∷ word (τ ∷ ῆ ∷ ς ∷ []) "1John.4.6"
∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ε ∷ ί ∷ α ∷ ς ∷ []) "1John.4.6"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.6"
∷ word (τ ∷ ὸ ∷ []) "1John.4.6"
∷ word (π ∷ ν ∷ ε ∷ ῦ ∷ μ ∷ α ∷ []) "1John.4.6"
∷ word (τ ∷ ῆ ∷ ς ∷ []) "1John.4.6"
∷ word (π ∷ ∙λ ∷ ά ∷ ν ∷ η ∷ ς ∷ []) "1John.4.6"
∷ word (Ἀ ∷ γ ∷ α ∷ π ∷ η ∷ τ ∷ ο ∷ ί ∷ []) "1John.4.7"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.7"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ή ∷ ∙λ ∷ ο ∷ υ ∷ ς ∷ []) "1John.4.7"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.7"
∷ word (ἡ ∷ []) "1John.4.7"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ []) "1John.4.7"
∷ word (ἐ ∷ κ ∷ []) "1John.4.7"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.7"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.4.7"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.4.7"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.7"
∷ word (π ∷ ᾶ ∷ ς ∷ []) "1John.4.7"
∷ word (ὁ ∷ []) "1John.4.7"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ ν ∷ []) "1John.4.7"
∷ word (ἐ ∷ κ ∷ []) "1John.4.7"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.7"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.4.7"
∷ word (γ ∷ ε ∷ γ ∷ έ ∷ ν ∷ ν ∷ η ∷ τ ∷ α ∷ ι ∷ []) "1John.4.7"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.7"
∷ word (γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ε ∷ ι ∷ []) "1John.4.7"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.7"
∷ word (θ ∷ ε ∷ ό ∷ ν ∷ []) "1John.4.7"
∷ word (ὁ ∷ []) "1John.4.8"
∷ word (μ ∷ ὴ ∷ []) "1John.4.8"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ ν ∷ []) "1John.4.8"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.4.8"
∷ word (ἔ ∷ γ ∷ ν ∷ ω ∷ []) "1John.4.8"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.8"
∷ word (θ ∷ ε ∷ ό ∷ ν ∷ []) "1John.4.8"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.8"
∷ word (ὁ ∷ []) "1John.4.8"
∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1John.4.8"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ []) "1John.4.8"
∷ word (ἐ ∷ σ ∷ τ ∷ ί ∷ ν ∷ []) "1John.4.8"
∷ word (ἐ ∷ ν ∷ []) "1John.4.9"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1John.4.9"
∷ word (ἐ ∷ φ ∷ α ∷ ν ∷ ε ∷ ρ ∷ ώ ∷ θ ∷ η ∷ []) "1John.4.9"
∷ word (ἡ ∷ []) "1John.4.9"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ []) "1John.4.9"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.9"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.4.9"
∷ word (ἐ ∷ ν ∷ []) "1John.4.9"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.4.9"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.9"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.9"
∷ word (υ ∷ ἱ ∷ ὸ ∷ ν ∷ []) "1John.4.9"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.4.9"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.9"
∷ word (μ ∷ ο ∷ ν ∷ ο ∷ γ ∷ ε ∷ ν ∷ ῆ ∷ []) "1John.4.9"
∷ word (ἀ ∷ π ∷ έ ∷ σ ∷ τ ∷ α ∷ ∙λ ∷ κ ∷ ε ∷ ν ∷ []) "1John.4.9"
∷ word (ὁ ∷ []) "1John.4.9"
∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1John.4.9"
∷ word (ε ∷ ἰ ∷ ς ∷ []) "1John.4.9"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.9"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ ν ∷ []) "1John.4.9"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.4.9"
∷ word (ζ ∷ ή ∷ σ ∷ ω ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.9"
∷ word (δ ∷ ι ∷ []) "1John.4.9"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.4.9"
∷ word (ἐ ∷ ν ∷ []) "1John.4.10"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1John.4.10"
∷ word (ἐ ∷ σ ∷ τ ∷ ὶ ∷ ν ∷ []) "1John.4.10"
∷ word (ἡ ∷ []) "1John.4.10"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ []) "1John.4.10"
∷ word (ο ∷ ὐ ∷ χ ∷ []) "1John.4.10"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.10"
∷ word (ἡ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.4.10"
∷ word (ἠ ∷ γ ∷ α ∷ π ∷ ή ∷ κ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.10"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.10"
∷ word (θ ∷ ε ∷ ό ∷ ν ∷ []) "1John.4.10"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ []) "1John.4.10"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.10"
∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ς ∷ []) "1John.4.10"
∷ word (ἠ ∷ γ ∷ ά ∷ π ∷ η ∷ σ ∷ ε ∷ ν ∷ []) "1John.4.10"
∷ word (ἡ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1John.4.10"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.10"
∷ word (ἀ ∷ π ∷ έ ∷ σ ∷ τ ∷ ε ∷ ι ∷ ∙λ ∷ ε ∷ ν ∷ []) "1John.4.10"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.10"
∷ word (υ ∷ ἱ ∷ ὸ ∷ ν ∷ []) "1John.4.10"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.4.10"
∷ word (ἱ ∷ ∙λ ∷ α ∷ σ ∷ μ ∷ ὸ ∷ ν ∷ []) "1John.4.10"
∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "1John.4.10"
∷ word (τ ∷ ῶ ∷ ν ∷ []) "1John.4.10"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ι ∷ ῶ ∷ ν ∷ []) "1John.4.10"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.4.10"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ η ∷ τ ∷ ο ∷ ί ∷ []) "1John.4.11"
∷ word (ε ∷ ἰ ∷ []) "1John.4.11"
∷ word (ο ∷ ὕ ∷ τ ∷ ω ∷ ς ∷ []) "1John.4.11"
∷ word (ὁ ∷ []) "1John.4.11"
∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1John.4.11"
∷ word (ἠ ∷ γ ∷ ά ∷ π ∷ η ∷ σ ∷ ε ∷ ν ∷ []) "1John.4.11"
∷ word (ἡ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1John.4.11"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.11"
∷ word (ἡ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.4.11"
∷ word (ὀ ∷ φ ∷ ε ∷ ί ∷ ∙λ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.11"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ή ∷ ∙λ ∷ ο ∷ υ ∷ ς ∷ []) "1John.4.11"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ᾶ ∷ ν ∷ []) "1John.4.11"
∷ word (θ ∷ ε ∷ ὸ ∷ ν ∷ []) "1John.4.12"
∷ word (ο ∷ ὐ ∷ δ ∷ ε ∷ ὶ ∷ ς ∷ []) "1John.4.12"
∷ word (π ∷ ώ ∷ π ∷ ο ∷ τ ∷ ε ∷ []) "1John.4.12"
∷ word (τ ∷ ε ∷ θ ∷ έ ∷ α ∷ τ ∷ α ∷ ι ∷ []) "1John.4.12"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.4.12"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.12"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ ή ∷ ∙λ ∷ ο ∷ υ ∷ ς ∷ []) "1John.4.12"
∷ word (ὁ ∷ []) "1John.4.12"
∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1John.4.12"
∷ word (ἐ ∷ ν ∷ []) "1John.4.12"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.4.12"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ []) "1John.4.12"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.12"
∷ word (ἡ ∷ []) "1John.4.12"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ []) "1John.4.12"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.4.12"
∷ word (ἐ ∷ ν ∷ []) "1John.4.12"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.4.12"
∷ word (τ ∷ ε ∷ τ ∷ ε ∷ ∙λ ∷ ε ∷ ι ∷ ω ∷ μ ∷ έ ∷ ν ∷ η ∷ []) "1John.4.12"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.4.12"
∷ word (Ἐ ∷ ν ∷ []) "1John.4.13"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1John.4.13"
∷ word (γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.13"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.13"
∷ word (ἐ ∷ ν ∷ []) "1John.4.13"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.4.13"
∷ word (μ ∷ έ ∷ ν ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.13"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.13"
∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ς ∷ []) "1John.4.13"
∷ word (ἐ ∷ ν ∷ []) "1John.4.13"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.4.13"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.13"
∷ word (ἐ ∷ κ ∷ []) "1John.4.13"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.13"
∷ word (π ∷ ν ∷ ε ∷ ύ ∷ μ ∷ α ∷ τ ∷ ο ∷ ς ∷ []) "1John.4.13"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.4.13"
∷ word (δ ∷ έ ∷ δ ∷ ω ∷ κ ∷ ε ∷ ν ∷ []) "1John.4.13"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.4.13"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.14"
∷ word (ἡ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.4.14"
∷ word (τ ∷ ε ∷ θ ∷ ε ∷ ά ∷ μ ∷ ε ∷ θ ∷ α ∷ []) "1John.4.14"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.14"
∷ word (μ ∷ α ∷ ρ ∷ τ ∷ υ ∷ ρ ∷ ο ∷ ῦ ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.14"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.14"
∷ word (ὁ ∷ []) "1John.4.14"
∷ word (π ∷ α ∷ τ ∷ ὴ ∷ ρ ∷ []) "1John.4.14"
∷ word (ἀ ∷ π ∷ έ ∷ σ ∷ τ ∷ α ∷ ∙λ ∷ κ ∷ ε ∷ ν ∷ []) "1John.4.14"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.14"
∷ word (υ ∷ ἱ ∷ ὸ ∷ ν ∷ []) "1John.4.14"
∷ word (σ ∷ ω ∷ τ ∷ ῆ ∷ ρ ∷ α ∷ []) "1John.4.14"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.14"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ υ ∷ []) "1John.4.14"
∷ word (ὃ ∷ ς ∷ []) "1John.4.15"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.4.15"
∷ word (ὁ ∷ μ ∷ ο ∷ ∙λ ∷ ο ∷ γ ∷ ή ∷ σ ∷ ῃ ∷ []) "1John.4.15"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.15"
∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ ς ∷ []) "1John.4.15"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.4.15"
∷ word (ὁ ∷ []) "1John.4.15"
∷ word (υ ∷ ἱ ∷ ὸ ∷ ς ∷ []) "1John.4.15"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.4.15"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.4.15"
∷ word (ὁ ∷ []) "1John.4.15"
∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1John.4.15"
∷ word (ἐ ∷ ν ∷ []) "1John.4.15"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.4.15"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ []) "1John.4.15"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.15"
∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ς ∷ []) "1John.4.15"
∷ word (ἐ ∷ ν ∷ []) "1John.4.15"
∷ word (τ ∷ ῷ ∷ []) "1John.4.15"
∷ word (θ ∷ ε ∷ ῷ ∷ []) "1John.4.15"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.16"
∷ word (ἡ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.4.16"
∷ word (ἐ ∷ γ ∷ ν ∷ ώ ∷ κ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.16"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.16"
∷ word (π ∷ ε ∷ π ∷ ι ∷ σ ∷ τ ∷ ε ∷ ύ ∷ κ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.16"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.4.16"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ ν ∷ []) "1John.4.16"
∷ word (ἣ ∷ ν ∷ []) "1John.4.16"
∷ word (ἔ ∷ χ ∷ ε ∷ ι ∷ []) "1John.4.16"
∷ word (ὁ ∷ []) "1John.4.16"
∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1John.4.16"
∷ word (ἐ ∷ ν ∷ []) "1John.4.16"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.4.16"
∷ word (Ὁ ∷ []) "1John.4.16"
∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1John.4.16"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ []) "1John.4.16"
∷ word (ἐ ∷ σ ∷ τ ∷ ί ∷ ν ∷ []) "1John.4.16"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.16"
∷ word (ὁ ∷ []) "1John.4.16"
∷ word (μ ∷ έ ∷ ν ∷ ω ∷ ν ∷ []) "1John.4.16"
∷ word (ἐ ∷ ν ∷ []) "1John.4.16"
∷ word (τ ∷ ῇ ∷ []) "1John.4.16"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ ῃ ∷ []) "1John.4.16"
∷ word (ἐ ∷ ν ∷ []) "1John.4.16"
∷ word (τ ∷ ῷ ∷ []) "1John.4.16"
∷ word (θ ∷ ε ∷ ῷ ∷ []) "1John.4.16"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ []) "1John.4.16"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.16"
∷ word (ὁ ∷ []) "1John.4.16"
∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1John.4.16"
∷ word (ἐ ∷ ν ∷ []) "1John.4.16"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.4.16"
∷ word (μ ∷ έ ∷ ν ∷ ε ∷ ι ∷ []) "1John.4.16"
∷ word (ἐ ∷ ν ∷ []) "1John.4.17"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1John.4.17"
∷ word (τ ∷ ε ∷ τ ∷ ε ∷ ∙λ ∷ ε ∷ ί ∷ ω ∷ τ ∷ α ∷ ι ∷ []) "1John.4.17"
∷ word (ἡ ∷ []) "1John.4.17"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ []) "1John.4.17"
∷ word (μ ∷ ε ∷ θ ∷ []) "1John.4.17"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.4.17"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.4.17"
∷ word (π ∷ α ∷ ρ ∷ ρ ∷ η ∷ σ ∷ ί ∷ α ∷ ν ∷ []) "1John.4.17"
∷ word (ἔ ∷ χ ∷ ω ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.17"
∷ word (ἐ ∷ ν ∷ []) "1John.4.17"
∷ word (τ ∷ ῇ ∷ []) "1John.4.17"
∷ word (ἡ ∷ μ ∷ έ ∷ ρ ∷ ᾳ ∷ []) "1John.4.17"
∷ word (τ ∷ ῆ ∷ ς ∷ []) "1John.4.17"
∷ word (κ ∷ ρ ∷ ί ∷ σ ∷ ε ∷ ω ∷ ς ∷ []) "1John.4.17"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.17"
∷ word (κ ∷ α ∷ θ ∷ ὼ ∷ ς ∷ []) "1John.4.17"
∷ word (ἐ ∷ κ ∷ ε ∷ ῖ ∷ ν ∷ ό ∷ ς ∷ []) "1John.4.17"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.4.17"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.17"
∷ word (ἡ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.4.17"
∷ word (ἐ ∷ σ ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.17"
∷ word (ἐ ∷ ν ∷ []) "1John.4.17"
∷ word (τ ∷ ῷ ∷ []) "1John.4.17"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ῳ ∷ []) "1John.4.17"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1John.4.17"
∷ word (φ ∷ ό ∷ β ∷ ο ∷ ς ∷ []) "1John.4.18"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.4.18"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.4.18"
∷ word (ἐ ∷ ν ∷ []) "1John.4.18"
∷ word (τ ∷ ῇ ∷ []) "1John.4.18"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ ῃ ∷ []) "1John.4.18"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ []) "1John.4.18"
∷ word (ἡ ∷ []) "1John.4.18"
∷ word (τ ∷ ε ∷ ∙λ ∷ ε ∷ ί ∷ α ∷ []) "1John.4.18"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ []) "1John.4.18"
∷ word (ἔ ∷ ξ ∷ ω ∷ []) "1John.4.18"
∷ word (β ∷ ά ∷ ∙λ ∷ ∙λ ∷ ε ∷ ι ∷ []) "1John.4.18"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.18"
∷ word (φ ∷ ό ∷ β ∷ ο ∷ ν ∷ []) "1John.4.18"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.18"
∷ word (ὁ ∷ []) "1John.4.18"
∷ word (φ ∷ ό ∷ β ∷ ο ∷ ς ∷ []) "1John.4.18"
∷ word (κ ∷ ό ∷ ∙λ ∷ α ∷ σ ∷ ι ∷ ν ∷ []) "1John.4.18"
∷ word (ἔ ∷ χ ∷ ε ∷ ι ∷ []) "1John.4.18"
∷ word (ὁ ∷ []) "1John.4.18"
∷ word (δ ∷ ὲ ∷ []) "1John.4.18"
∷ word (φ ∷ ο ∷ β ∷ ο ∷ ύ ∷ μ ∷ ε ∷ ν ∷ ο ∷ ς ∷ []) "1John.4.18"
∷ word (ο ∷ ὐ ∷ []) "1John.4.18"
∷ word (τ ∷ ε ∷ τ ∷ ε ∷ ∙λ ∷ ε ∷ ί ∷ ω ∷ τ ∷ α ∷ ι ∷ []) "1John.4.18"
∷ word (ἐ ∷ ν ∷ []) "1John.4.18"
∷ word (τ ∷ ῇ ∷ []) "1John.4.18"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ ῃ ∷ []) "1John.4.18"
∷ word (ἡ ∷ μ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.4.19"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.19"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.19"
∷ word (α ∷ ὐ ∷ τ ∷ ὸ ∷ ς ∷ []) "1John.4.19"
∷ word (π ∷ ρ ∷ ῶ ∷ τ ∷ ο ∷ ς ∷ []) "1John.4.19"
∷ word (ἠ ∷ γ ∷ ά ∷ π ∷ η ∷ σ ∷ ε ∷ ν ∷ []) "1John.4.19"
∷ word (ἡ ∷ μ ∷ ᾶ ∷ ς ∷ []) "1John.4.19"
∷ word (ἐ ∷ ά ∷ ν ∷ []) "1John.4.20"
∷ word (τ ∷ ι ∷ ς ∷ []) "1John.4.20"
∷ word (ε ∷ ἴ ∷ π ∷ ῃ ∷ []) "1John.4.20"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.4.20"
∷ word (Ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ []) "1John.4.20"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.20"
∷ word (θ ∷ ε ∷ ό ∷ ν ∷ []) "1John.4.20"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.20"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.20"
∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ὸ ∷ ν ∷ []) "1John.4.20"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.4.20"
∷ word (μ ∷ ι ∷ σ ∷ ῇ ∷ []) "1John.4.20"
∷ word (ψ ∷ ε ∷ ύ ∷ σ ∷ τ ∷ η ∷ ς ∷ []) "1John.4.20"
∷ word (ἐ ∷ σ ∷ τ ∷ ί ∷ ν ∷ []) "1John.4.20"
∷ word (ὁ ∷ []) "1John.4.20"
∷ word (γ ∷ ὰ ∷ ρ ∷ []) "1John.4.20"
∷ word (μ ∷ ὴ ∷ []) "1John.4.20"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ ν ∷ []) "1John.4.20"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.20"
∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ὸ ∷ ν ∷ []) "1John.4.20"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.4.20"
∷ word (ὃ ∷ ν ∷ []) "1John.4.20"
∷ word (ἑ ∷ ώ ∷ ρ ∷ α ∷ κ ∷ ε ∷ ν ∷ []) "1John.4.20"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.20"
∷ word (θ ∷ ε ∷ ὸ ∷ ν ∷ []) "1John.4.20"
∷ word (ὃ ∷ ν ∷ []) "1John.4.20"
∷ word (ο ∷ ὐ ∷ χ ∷ []) "1John.4.20"
∷ word (ἑ ∷ ώ ∷ ρ ∷ α ∷ κ ∷ ε ∷ ν ∷ []) "1John.4.20"
∷ word (ο ∷ ὐ ∷ []) "1John.4.20"
∷ word (δ ∷ ύ ∷ ν ∷ α ∷ τ ∷ α ∷ ι ∷ []) "1John.4.20"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ᾶ ∷ ν ∷ []) "1John.4.20"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.21"
∷ word (τ ∷ α ∷ ύ ∷ τ ∷ η ∷ ν ∷ []) "1John.4.21"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.4.21"
∷ word (ἐ ∷ ν ∷ τ ∷ ο ∷ ∙λ ∷ ὴ ∷ ν ∷ []) "1John.4.21"
∷ word (ἔ ∷ χ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.4.21"
∷ word (ἀ ∷ π ∷ []) "1John.4.21"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.4.21"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.4.21"
∷ word (ὁ ∷ []) "1John.4.21"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ ν ∷ []) "1John.4.21"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.21"
∷ word (θ ∷ ε ∷ ὸ ∷ ν ∷ []) "1John.4.21"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ᾷ ∷ []) "1John.4.21"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.4.21"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.4.21"
∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ὸ ∷ ν ∷ []) "1John.4.21"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.4.21"
∷ word (Π ∷ ᾶ ∷ ς ∷ []) "1John.5.1"
∷ word (ὁ ∷ []) "1John.5.1"
∷ word (π ∷ ι ∷ σ ∷ τ ∷ ε ∷ ύ ∷ ω ∷ ν ∷ []) "1John.5.1"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.1"
∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ ς ∷ []) "1John.5.1"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.5.1"
∷ word (ὁ ∷ []) "1John.5.1"
∷ word (χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ὸ ∷ ς ∷ []) "1John.5.1"
∷ word (ἐ ∷ κ ∷ []) "1John.5.1"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.1"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.5.1"
∷ word (γ ∷ ε ∷ γ ∷ έ ∷ ν ∷ ν ∷ η ∷ τ ∷ α ∷ ι ∷ []) "1John.5.1"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.1"
∷ word (π ∷ ᾶ ∷ ς ∷ []) "1John.5.1"
∷ word (ὁ ∷ []) "1John.5.1"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ ν ∷ []) "1John.5.1"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.5.1"
∷ word (γ ∷ ε ∷ ν ∷ ν ∷ ή ∷ σ ∷ α ∷ ν ∷ τ ∷ α ∷ []) "1John.5.1"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ᾷ ∷ []) "1John.5.1"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.1"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.5.1"
∷ word (γ ∷ ε ∷ γ ∷ ε ∷ ν ∷ ν ∷ η ∷ μ ∷ έ ∷ ν ∷ ο ∷ ν ∷ []) "1John.5.1"
∷ word (ἐ ∷ ξ ∷ []) "1John.5.1"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.5.1"
∷ word (ἐ ∷ ν ∷ []) "1John.5.2"
∷ word (τ ∷ ο ∷ ύ ∷ τ ∷ ῳ ∷ []) "1John.5.2"
∷ word (γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.2"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.2"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.2"
∷ word (τ ∷ ὰ ∷ []) "1John.5.2"
∷ word (τ ∷ έ ∷ κ ∷ ν ∷ α ∷ []) "1John.5.2"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.2"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.5.2"
∷ word (ὅ ∷ τ ∷ α ∷ ν ∷ []) "1John.5.2"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.5.2"
∷ word (θ ∷ ε ∷ ὸ ∷ ν ∷ []) "1John.5.2"
∷ word (ἀ ∷ γ ∷ α ∷ π ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.2"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.2"
∷ word (τ ∷ ὰ ∷ ς ∷ []) "1John.5.2"
∷ word (ἐ ∷ ν ∷ τ ∷ ο ∷ ∙λ ∷ ὰ ∷ ς ∷ []) "1John.5.2"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.5.2"
∷ word (π ∷ ο ∷ ι ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.2"
∷ word (α ∷ ὕ ∷ τ ∷ η ∷ []) "1John.5.3"
∷ word (γ ∷ ά ∷ ρ ∷ []) "1John.5.3"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.5.3"
∷ word (ἡ ∷ []) "1John.5.3"
∷ word (ἀ ∷ γ ∷ ά ∷ π ∷ η ∷ []) "1John.5.3"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.3"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.5.3"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.5.3"
∷ word (τ ∷ ὰ ∷ ς ∷ []) "1John.5.3"
∷ word (ἐ ∷ ν ∷ τ ∷ ο ∷ ∙λ ∷ ὰ ∷ ς ∷ []) "1John.5.3"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.5.3"
∷ word (τ ∷ η ∷ ρ ∷ ῶ ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.3"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.3"
∷ word (α ∷ ἱ ∷ []) "1John.5.3"
∷ word (ἐ ∷ ν ∷ τ ∷ ο ∷ ∙λ ∷ α ∷ ὶ ∷ []) "1John.5.3"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.5.3"
∷ word (β ∷ α ∷ ρ ∷ ε ∷ ῖ ∷ α ∷ ι ∷ []) "1John.5.3"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.5.3"
∷ word (ε ∷ ἰ ∷ σ ∷ ί ∷ ν ∷ []) "1John.5.3"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.4"
∷ word (π ∷ ᾶ ∷ ν ∷ []) "1John.5.4"
∷ word (τ ∷ ὸ ∷ []) "1John.5.4"
∷ word (γ ∷ ε ∷ γ ∷ ε ∷ ν ∷ ν ∷ η ∷ μ ∷ έ ∷ ν ∷ ο ∷ ν ∷ []) "1John.5.4"
∷ word (ἐ ∷ κ ∷ []) "1John.5.4"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.4"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.5.4"
∷ word (ν ∷ ι ∷ κ ∷ ᾷ ∷ []) "1John.5.4"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.5.4"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ ν ∷ []) "1John.5.4"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.4"
∷ word (α ∷ ὕ ∷ τ ∷ η ∷ []) "1John.5.4"
∷ word (ἐ ∷ σ ∷ τ ∷ ὶ ∷ ν ∷ []) "1John.5.4"
∷ word (ἡ ∷ []) "1John.5.4"
∷ word (ν ∷ ί ∷ κ ∷ η ∷ []) "1John.5.4"
∷ word (ἡ ∷ []) "1John.5.4"
∷ word (ν ∷ ι ∷ κ ∷ ή ∷ σ ∷ α ∷ σ ∷ α ∷ []) "1John.5.4"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.5.4"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ ν ∷ []) "1John.5.4"
∷ word (ἡ ∷ []) "1John.5.4"
∷ word (π ∷ ί ∷ σ ∷ τ ∷ ι ∷ ς ∷ []) "1John.5.4"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.5.4"
∷ word (τ ∷ ί ∷ ς ∷ []) "1John.5.5"
∷ word (δ ∷ έ ∷ []) "1John.5.5"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.5.5"
∷ word (ὁ ∷ []) "1John.5.5"
∷ word (ν ∷ ι ∷ κ ∷ ῶ ∷ ν ∷ []) "1John.5.5"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.5.5"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ ν ∷ []) "1John.5.5"
∷ word (ε ∷ ἰ ∷ []) "1John.5.5"
∷ word (μ ∷ ὴ ∷ []) "1John.5.5"
∷ word (ὁ ∷ []) "1John.5.5"
∷ word (π ∷ ι ∷ σ ∷ τ ∷ ε ∷ ύ ∷ ω ∷ ν ∷ []) "1John.5.5"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.5"
∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ ς ∷ []) "1John.5.5"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.5.5"
∷ word (ὁ ∷ []) "1John.5.5"
∷ word (υ ∷ ἱ ∷ ὸ ∷ ς ∷ []) "1John.5.5"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.5"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.5.5"
∷ word (Ο ∷ ὗ ∷ τ ∷ ό ∷ ς ∷ []) "1John.5.6"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.5.6"
∷ word (ὁ ∷ []) "1John.5.6"
∷ word (ἐ ∷ ∙λ ∷ θ ∷ ὼ ∷ ν ∷ []) "1John.5.6"
∷ word (δ ∷ ι ∷ []) "1John.5.6"
∷ word (ὕ ∷ δ ∷ α ∷ τ ∷ ο ∷ ς ∷ []) "1John.5.6"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.6"
∷ word (α ∷ ἵ ∷ μ ∷ α ∷ τ ∷ ο ∷ ς ∷ []) "1John.5.6"
∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ ς ∷ []) "1John.5.6"
∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ό ∷ ς ∷ []) "1John.5.6"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.5.6"
∷ word (ἐ ∷ ν ∷ []) "1John.5.6"
∷ word (τ ∷ ῷ ∷ []) "1John.5.6"
∷ word (ὕ ∷ δ ∷ α ∷ τ ∷ ι ∷ []) "1John.5.6"
∷ word (μ ∷ ό ∷ ν ∷ ο ∷ ν ∷ []) "1John.5.6"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ []) "1John.5.6"
∷ word (ἐ ∷ ν ∷ []) "1John.5.6"
∷ word (τ ∷ ῷ ∷ []) "1John.5.6"
∷ word (ὕ ∷ δ ∷ α ∷ τ ∷ ι ∷ []) "1John.5.6"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.6"
∷ word (ἐ ∷ ν ∷ []) "1John.5.6"
∷ word (τ ∷ ῷ ∷ []) "1John.5.6"
∷ word (α ∷ ἵ ∷ μ ∷ α ∷ τ ∷ ι ∷ []) "1John.5.6"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.6"
∷ word (τ ∷ ὸ ∷ []) "1John.5.6"
∷ word (π ∷ ν ∷ ε ∷ ῦ ∷ μ ∷ ά ∷ []) "1John.5.6"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.5.6"
∷ word (τ ∷ ὸ ∷ []) "1John.5.6"
∷ word (μ ∷ α ∷ ρ ∷ τ ∷ υ ∷ ρ ∷ ο ∷ ῦ ∷ ν ∷ []) "1John.5.6"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.6"
∷ word (τ ∷ ὸ ∷ []) "1John.5.6"
∷ word (π ∷ ν ∷ ε ∷ ῦ ∷ μ ∷ ά ∷ []) "1John.5.6"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.5.6"
∷ word (ἡ ∷ []) "1John.5.6"
∷ word (ἀ ∷ ∙λ ∷ ή ∷ θ ∷ ε ∷ ι ∷ α ∷ []) "1John.5.6"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.7"
∷ word (τ ∷ ρ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.5.7"
∷ word (ε ∷ ἰ ∷ σ ∷ ι ∷ ν ∷ []) "1John.5.7"
∷ word (ο ∷ ἱ ∷ []) "1John.5.7"
∷ word (μ ∷ α ∷ ρ ∷ τ ∷ υ ∷ ρ ∷ ο ∷ ῦ ∷ ν ∷ τ ∷ ε ∷ ς ∷ []) "1John.5.7"
∷ word (τ ∷ ὸ ∷ []) "1John.5.8"
∷ word (π ∷ ν ∷ ε ∷ ῦ ∷ μ ∷ α ∷ []) "1John.5.8"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.8"
∷ word (τ ∷ ὸ ∷ []) "1John.5.8"
∷ word (ὕ ∷ δ ∷ ω ∷ ρ ∷ []) "1John.5.8"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.8"
∷ word (τ ∷ ὸ ∷ []) "1John.5.8"
∷ word (α ∷ ἷ ∷ μ ∷ α ∷ []) "1John.5.8"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.8"
∷ word (ο ∷ ἱ ∷ []) "1John.5.8"
∷ word (τ ∷ ρ ∷ ε ∷ ῖ ∷ ς ∷ []) "1John.5.8"
∷ word (ε ∷ ἰ ∷ ς ∷ []) "1John.5.8"
∷ word (τ ∷ ὸ ∷ []) "1John.5.8"
∷ word (ἕ ∷ ν ∷ []) "1John.5.8"
∷ word (ε ∷ ἰ ∷ σ ∷ ι ∷ ν ∷ []) "1John.5.8"
∷ word (ε ∷ ἰ ∷ []) "1John.5.9"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.5.9"
∷ word (μ ∷ α ∷ ρ ∷ τ ∷ υ ∷ ρ ∷ ί ∷ α ∷ ν ∷ []) "1John.5.9"
∷ word (τ ∷ ῶ ∷ ν ∷ []) "1John.5.9"
∷ word (ἀ ∷ ν ∷ θ ∷ ρ ∷ ώ ∷ π ∷ ω ∷ ν ∷ []) "1John.5.9"
∷ word (∙λ ∷ α ∷ μ ∷ β ∷ ά ∷ ν ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.9"
∷ word (ἡ ∷ []) "1John.5.9"
∷ word (μ ∷ α ∷ ρ ∷ τ ∷ υ ∷ ρ ∷ ί ∷ α ∷ []) "1John.5.9"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.9"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.5.9"
∷ word (μ ∷ ε ∷ ί ∷ ζ ∷ ω ∷ ν ∷ []) "1John.5.9"
∷ word (ἐ ∷ σ ∷ τ ∷ ί ∷ ν ∷ []) "1John.5.9"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.9"
∷ word (α ∷ ὕ ∷ τ ∷ η ∷ []) "1John.5.9"
∷ word (ἐ ∷ σ ∷ τ ∷ ὶ ∷ ν ∷ []) "1John.5.9"
∷ word (ἡ ∷ []) "1John.5.9"
∷ word (μ ∷ α ∷ ρ ∷ τ ∷ υ ∷ ρ ∷ ί ∷ α ∷ []) "1John.5.9"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.9"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.5.9"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.9"
∷ word (μ ∷ ε ∷ μ ∷ α ∷ ρ ∷ τ ∷ ύ ∷ ρ ∷ η ∷ κ ∷ ε ∷ ν ∷ []) "1John.5.9"
∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "1John.5.9"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.9"
∷ word (υ ∷ ἱ ∷ ο ∷ ῦ ∷ []) "1John.5.9"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.5.9"
∷ word (ὁ ∷ []) "1John.5.10"
∷ word (π ∷ ι ∷ σ ∷ τ ∷ ε ∷ ύ ∷ ω ∷ ν ∷ []) "1John.5.10"
∷ word (ε ∷ ἰ ∷ ς ∷ []) "1John.5.10"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.5.10"
∷ word (υ ∷ ἱ ∷ ὸ ∷ ν ∷ []) "1John.5.10"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.10"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.5.10"
∷ word (ἔ ∷ χ ∷ ε ∷ ι ∷ []) "1John.5.10"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.5.10"
∷ word (μ ∷ α ∷ ρ ∷ τ ∷ υ ∷ ρ ∷ ί ∷ α ∷ ν ∷ []) "1John.5.10"
∷ word (ἐ ∷ ν ∷ []) "1John.5.10"
∷ word (α ∷ ὑ ∷ τ ∷ ῷ ∷ []) "1John.5.10"
∷ word (ὁ ∷ []) "1John.5.10"
∷ word (μ ∷ ὴ ∷ []) "1John.5.10"
∷ word (π ∷ ι ∷ σ ∷ τ ∷ ε ∷ ύ ∷ ω ∷ ν ∷ []) "1John.5.10"
∷ word (τ ∷ ῷ ∷ []) "1John.5.10"
∷ word (θ ∷ ε ∷ ῷ ∷ []) "1John.5.10"
∷ word (ψ ∷ ε ∷ ύ ∷ σ ∷ τ ∷ η ∷ ν ∷ []) "1John.5.10"
∷ word (π ∷ ε ∷ π ∷ ο ∷ ί ∷ η ∷ κ ∷ ε ∷ ν ∷ []) "1John.5.10"
∷ word (α ∷ ὐ ∷ τ ∷ ό ∷ ν ∷ []) "1John.5.10"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.10"
∷ word (ο ∷ ὐ ∷ []) "1John.5.10"
∷ word (π ∷ ε ∷ π ∷ ί ∷ σ ∷ τ ∷ ε ∷ υ ∷ κ ∷ ε ∷ ν ∷ []) "1John.5.10"
∷ word (ε ∷ ἰ ∷ ς ∷ []) "1John.5.10"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.5.10"
∷ word (μ ∷ α ∷ ρ ∷ τ ∷ υ ∷ ρ ∷ ί ∷ α ∷ ν ∷ []) "1John.5.10"
∷ word (ἣ ∷ ν ∷ []) "1John.5.10"
∷ word (μ ∷ ε ∷ μ ∷ α ∷ ρ ∷ τ ∷ ύ ∷ ρ ∷ η ∷ κ ∷ ε ∷ ν ∷ []) "1John.5.10"
∷ word (ὁ ∷ []) "1John.5.10"
∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1John.5.10"
∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "1John.5.10"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.10"
∷ word (υ ∷ ἱ ∷ ο ∷ ῦ ∷ []) "1John.5.10"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.5.10"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.11"
∷ word (α ∷ ὕ ∷ τ ∷ η ∷ []) "1John.5.11"
∷ word (ἐ ∷ σ ∷ τ ∷ ὶ ∷ ν ∷ []) "1John.5.11"
∷ word (ἡ ∷ []) "1John.5.11"
∷ word (μ ∷ α ∷ ρ ∷ τ ∷ υ ∷ ρ ∷ ί ∷ α ∷ []) "1John.5.11"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.11"
∷ word (ζ ∷ ω ∷ ὴ ∷ ν ∷ []) "1John.5.11"
∷ word (α ∷ ἰ ∷ ώ ∷ ν ∷ ι ∷ ο ∷ ν ∷ []) "1John.5.11"
∷ word (ἔ ∷ δ ∷ ω ∷ κ ∷ ε ∷ ν ∷ []) "1John.5.11"
∷ word (ὁ ∷ []) "1John.5.11"
∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1John.5.11"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.5.11"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.11"
∷ word (α ∷ ὕ ∷ τ ∷ η ∷ []) "1John.5.11"
∷ word (ἡ ∷ []) "1John.5.11"
∷ word (ζ ∷ ω ∷ ὴ ∷ []) "1John.5.11"
∷ word (ἐ ∷ ν ∷ []) "1John.5.11"
∷ word (τ ∷ ῷ ∷ []) "1John.5.11"
∷ word (υ ∷ ἱ ∷ ῷ ∷ []) "1John.5.11"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.5.11"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.5.11"
∷ word (ὁ ∷ []) "1John.5.12"
∷ word (ἔ ∷ χ ∷ ω ∷ ν ∷ []) "1John.5.12"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.5.12"
∷ word (υ ∷ ἱ ∷ ὸ ∷ ν ∷ []) "1John.5.12"
∷ word (ἔ ∷ χ ∷ ε ∷ ι ∷ []) "1John.5.12"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.5.12"
∷ word (ζ ∷ ω ∷ ή ∷ ν ∷ []) "1John.5.12"
∷ word (ὁ ∷ []) "1John.5.12"
∷ word (μ ∷ ὴ ∷ []) "1John.5.12"
∷ word (ἔ ∷ χ ∷ ω ∷ ν ∷ []) "1John.5.12"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.5.12"
∷ word (υ ∷ ἱ ∷ ὸ ∷ ν ∷ []) "1John.5.12"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.12"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.5.12"
∷ word (τ ∷ ὴ ∷ ν ∷ []) "1John.5.12"
∷ word (ζ ∷ ω ∷ ὴ ∷ ν ∷ []) "1John.5.12"
∷ word (ο ∷ ὐ ∷ κ ∷ []) "1John.5.12"
∷ word (ἔ ∷ χ ∷ ε ∷ ι ∷ []) "1John.5.12"
∷ word (Τ ∷ α ∷ ῦ ∷ τ ∷ α ∷ []) "1John.5.13"
∷ word (ἔ ∷ γ ∷ ρ ∷ α ∷ ψ ∷ α ∷ []) "1John.5.13"
∷ word (ὑ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.5.13"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.5.13"
∷ word (ε ∷ ἰ ∷ δ ∷ ῆ ∷ τ ∷ ε ∷ []) "1John.5.13"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.13"
∷ word (ζ ∷ ω ∷ ὴ ∷ ν ∷ []) "1John.5.13"
∷ word (ἔ ∷ χ ∷ ε ∷ τ ∷ ε ∷ []) "1John.5.13"
∷ word (α ∷ ἰ ∷ ώ ∷ ν ∷ ι ∷ ο ∷ ν ∷ []) "1John.5.13"
∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1John.5.13"
∷ word (π ∷ ι ∷ σ ∷ τ ∷ ε ∷ ύ ∷ ο ∷ υ ∷ σ ∷ ι ∷ ν ∷ []) "1John.5.13"
∷ word (ε ∷ ἰ ∷ ς ∷ []) "1John.5.13"
∷ word (τ ∷ ὸ ∷ []) "1John.5.13"
∷ word (ὄ ∷ ν ∷ ο ∷ μ ∷ α ∷ []) "1John.5.13"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.13"
∷ word (υ ∷ ἱ ∷ ο ∷ ῦ ∷ []) "1John.5.13"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.13"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.5.13"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.14"
∷ word (α ∷ ὕ ∷ τ ∷ η ∷ []) "1John.5.14"
∷ word (ἐ ∷ σ ∷ τ ∷ ὶ ∷ ν ∷ []) "1John.5.14"
∷ word (ἡ ∷ []) "1John.5.14"
∷ word (π ∷ α ∷ ρ ∷ ρ ∷ η ∷ σ ∷ ί ∷ α ∷ []) "1John.5.14"
∷ word (ἣ ∷ ν ∷ []) "1John.5.14"
∷ word (ἔ ∷ χ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.14"
∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "1John.5.14"
∷ word (α ∷ ὐ ∷ τ ∷ ό ∷ ν ∷ []) "1John.5.14"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.14"
∷ word (ἐ ∷ ά ∷ ν ∷ []) "1John.5.14"
∷ word (τ ∷ ι ∷ []) "1John.5.14"
∷ word (α ∷ ἰ ∷ τ ∷ ώ ∷ μ ∷ ε ∷ θ ∷ α ∷ []) "1John.5.14"
∷ word (κ ∷ α ∷ τ ∷ ὰ ∷ []) "1John.5.14"
∷ word (τ ∷ ὸ ∷ []) "1John.5.14"
∷ word (θ ∷ έ ∷ ∙λ ∷ η ∷ μ ∷ α ∷ []) "1John.5.14"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.5.14"
∷ word (ἀ ∷ κ ∷ ο ∷ ύ ∷ ε ∷ ι ∷ []) "1John.5.14"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.5.14"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.15"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.5.15"
∷ word (ο ∷ ἴ ∷ δ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.15"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.15"
∷ word (ἀ ∷ κ ∷ ο ∷ ύ ∷ ε ∷ ι ∷ []) "1John.5.15"
∷ word (ἡ ∷ μ ∷ ῶ ∷ ν ∷ []) "1John.5.15"
∷ word (ὃ ∷ []) "1John.5.15"
∷ word (ἐ ∷ ὰ ∷ ν ∷ []) "1John.5.15"
∷ word (α ∷ ἰ ∷ τ ∷ ώ ∷ μ ∷ ε ∷ θ ∷ α ∷ []) "1John.5.15"
∷ word (ο ∷ ἴ ∷ δ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.15"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.15"
∷ word (ἔ ∷ χ ∷ ο ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.15"
∷ word (τ ∷ ὰ ∷ []) "1John.5.15"
∷ word (α ∷ ἰ ∷ τ ∷ ή ∷ μ ∷ α ∷ τ ∷ α ∷ []) "1John.5.15"
∷ word (ἃ ∷ []) "1John.5.15"
∷ word (ᾐ ∷ τ ∷ ή ∷ κ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.15"
∷ word (ἀ ∷ π ∷ []) "1John.5.15"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.5.15"
∷ word (ἐ ∷ ά ∷ ν ∷ []) "1John.5.16"
∷ word (τ ∷ ι ∷ ς ∷ []) "1John.5.16"
∷ word (ἴ ∷ δ ∷ ῃ ∷ []) "1John.5.16"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.5.16"
∷ word (ἀ ∷ δ ∷ ε ∷ ∙λ ∷ φ ∷ ὸ ∷ ν ∷ []) "1John.5.16"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.5.16"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ά ∷ ν ∷ ο ∷ ν ∷ τ ∷ α ∷ []) "1John.5.16"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ ν ∷ []) "1John.5.16"
∷ word (μ ∷ ὴ ∷ []) "1John.5.16"
∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "1John.5.16"
∷ word (θ ∷ ά ∷ ν ∷ α ∷ τ ∷ ο ∷ ν ∷ []) "1John.5.16"
∷ word (α ∷ ἰ ∷ τ ∷ ή ∷ σ ∷ ε ∷ ι ∷ []) "1John.5.16"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.16"
∷ word (δ ∷ ώ ∷ σ ∷ ε ∷ ι ∷ []) "1John.5.16"
∷ word (α ∷ ὐ ∷ τ ∷ ῷ ∷ []) "1John.5.16"
∷ word (ζ ∷ ω ∷ ή ∷ ν ∷ []) "1John.5.16"
∷ word (τ ∷ ο ∷ ῖ ∷ ς ∷ []) "1John.5.16"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ά ∷ ν ∷ ο ∷ υ ∷ σ ∷ ι ∷ ν ∷ []) "1John.5.16"
∷ word (μ ∷ ὴ ∷ []) "1John.5.16"
∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "1John.5.16"
∷ word (θ ∷ ά ∷ ν ∷ α ∷ τ ∷ ο ∷ ν ∷ []) "1John.5.16"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.5.16"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ []) "1John.5.16"
∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "1John.5.16"
∷ word (θ ∷ ά ∷ ν ∷ α ∷ τ ∷ ο ∷ ν ∷ []) "1John.5.16"
∷ word (ο ∷ ὐ ∷ []) "1John.5.16"
∷ word (π ∷ ε ∷ ρ ∷ ὶ ∷ []) "1John.5.16"
∷ word (ἐ ∷ κ ∷ ε ∷ ί ∷ ν ∷ η ∷ ς ∷ []) "1John.5.16"
∷ word (∙λ ∷ έ ∷ γ ∷ ω ∷ []) "1John.5.16"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.5.16"
∷ word (ἐ ∷ ρ ∷ ω ∷ τ ∷ ή ∷ σ ∷ ῃ ∷ []) "1John.5.16"
∷ word (π ∷ ᾶ ∷ σ ∷ α ∷ []) "1John.5.17"
∷ word (ἀ ∷ δ ∷ ι ∷ κ ∷ ί ∷ α ∷ []) "1John.5.17"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ []) "1John.5.17"
∷ word (ἐ ∷ σ ∷ τ ∷ ί ∷ ν ∷ []) "1John.5.17"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.17"
∷ word (ἔ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.5.17"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ί ∷ α ∷ []) "1John.5.17"
∷ word (ο ∷ ὐ ∷ []) "1John.5.17"
∷ word (π ∷ ρ ∷ ὸ ∷ ς ∷ []) "1John.5.17"
∷ word (θ ∷ ά ∷ ν ∷ α ∷ τ ∷ ο ∷ ν ∷ []) "1John.5.17"
∷ word (Ο ∷ ἴ ∷ δ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.18"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.18"
∷ word (π ∷ ᾶ ∷ ς ∷ []) "1John.5.18"
∷ word (ὁ ∷ []) "1John.5.18"
∷ word (γ ∷ ε ∷ γ ∷ ε ∷ ν ∷ ν ∷ η ∷ μ ∷ έ ∷ ν ∷ ο ∷ ς ∷ []) "1John.5.18"
∷ word (ἐ ∷ κ ∷ []) "1John.5.18"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.18"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.5.18"
∷ word (ο ∷ ὐ ∷ χ ∷ []) "1John.5.18"
∷ word (ἁ ∷ μ ∷ α ∷ ρ ∷ τ ∷ ά ∷ ν ∷ ε ∷ ι ∷ []) "1John.5.18"
∷ word (ἀ ∷ ∙λ ∷ ∙λ ∷ []) "1John.5.18"
∷ word (ὁ ∷ []) "1John.5.18"
∷ word (γ ∷ ε ∷ ν ∷ ν ∷ η ∷ θ ∷ ε ∷ ὶ ∷ ς ∷ []) "1John.5.18"
∷ word (ἐ ∷ κ ∷ []) "1John.5.18"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.18"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.5.18"
∷ word (τ ∷ η ∷ ρ ∷ ε ∷ ῖ ∷ []) "1John.5.18"
∷ word (α ∷ ὐ ∷ τ ∷ ό ∷ ν ∷ []) "1John.5.18"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.18"
∷ word (ὁ ∷ []) "1John.5.18"
∷ word (π ∷ ο ∷ ν ∷ η ∷ ρ ∷ ὸ ∷ ς ∷ []) "1John.5.18"
∷ word (ο ∷ ὐ ∷ χ ∷ []) "1John.5.18"
∷ word (ἅ ∷ π ∷ τ ∷ ε ∷ τ ∷ α ∷ ι ∷ []) "1John.5.18"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.5.18"
∷ word (ο ∷ ἴ ∷ δ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.19"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.19"
∷ word (ἐ ∷ κ ∷ []) "1John.5.19"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.19"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.5.19"
∷ word (ἐ ∷ σ ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.19"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.19"
∷ word (ὁ ∷ []) "1John.5.19"
∷ word (κ ∷ ό ∷ σ ∷ μ ∷ ο ∷ ς ∷ []) "1John.5.19"
∷ word (ὅ ∷ ∙λ ∷ ο ∷ ς ∷ []) "1John.5.19"
∷ word (ἐ ∷ ν ∷ []) "1John.5.19"
∷ word (τ ∷ ῷ ∷ []) "1John.5.19"
∷ word (π ∷ ο ∷ ν ∷ η ∷ ρ ∷ ῷ ∷ []) "1John.5.19"
∷ word (κ ∷ ε ∷ ῖ ∷ τ ∷ α ∷ ι ∷ []) "1John.5.19"
∷ word (ο ∷ ἴ ∷ δ ∷ α ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.20"
∷ word (δ ∷ ὲ ∷ []) "1John.5.20"
∷ word (ὅ ∷ τ ∷ ι ∷ []) "1John.5.20"
∷ word (ὁ ∷ []) "1John.5.20"
∷ word (υ ∷ ἱ ∷ ὸ ∷ ς ∷ []) "1John.5.20"
∷ word (τ ∷ ο ∷ ῦ ∷ []) "1John.5.20"
∷ word (θ ∷ ε ∷ ο ∷ ῦ ∷ []) "1John.5.20"
∷ word (ἥ ∷ κ ∷ ε ∷ ι ∷ []) "1John.5.20"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.20"
∷ word (δ ∷ έ ∷ δ ∷ ω ∷ κ ∷ ε ∷ ν ∷ []) "1John.5.20"
∷ word (ἡ ∷ μ ∷ ῖ ∷ ν ∷ []) "1John.5.20"
∷ word (δ ∷ ι ∷ ά ∷ ν ∷ ο ∷ ι ∷ α ∷ ν ∷ []) "1John.5.20"
∷ word (ἵ ∷ ν ∷ α ∷ []) "1John.5.20"
∷ word (γ ∷ ι ∷ ν ∷ ώ ∷ σ ∷ κ ∷ ω ∷ μ ∷ ε ∷ ν ∷ []) "1John.5.20"
∷ word (τ ∷ ὸ ∷ ν ∷ []) "1John.5.20"
∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ι ∷ ν ∷ ό ∷ ν ∷ []) "1John.5.20"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.20"
∷ word (ἐ ∷ σ ∷ μ ∷ ὲ ∷ ν ∷ []) "1John.5.20"
∷ word (ἐ ∷ ν ∷ []) "1John.5.20"
∷ word (τ ∷ ῷ ∷ []) "1John.5.20"
∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ι ∷ ν ∷ ῷ ∷ []) "1John.5.20"
∷ word (ἐ ∷ ν ∷ []) "1John.5.20"
∷ word (τ ∷ ῷ ∷ []) "1John.5.20"
∷ word (υ ∷ ἱ ∷ ῷ ∷ []) "1John.5.20"
∷ word (α ∷ ὐ ∷ τ ∷ ο ∷ ῦ ∷ []) "1John.5.20"
∷ word (Ἰ ∷ η ∷ σ ∷ ο ∷ ῦ ∷ []) "1John.5.20"
∷ word (Χ ∷ ρ ∷ ι ∷ σ ∷ τ ∷ ῷ ∷ []) "1John.5.20"
∷ word (ο ∷ ὗ ∷ τ ∷ ό ∷ ς ∷ []) "1John.5.20"
∷ word (ἐ ∷ σ ∷ τ ∷ ι ∷ ν ∷ []) "1John.5.20"
∷ word (ὁ ∷ []) "1John.5.20"
∷ word (ἀ ∷ ∙λ ∷ η ∷ θ ∷ ι ∷ ν ∷ ὸ ∷ ς ∷ []) "1John.5.20"
∷ word (θ ∷ ε ∷ ὸ ∷ ς ∷ []) "1John.5.20"
∷ word (κ ∷ α ∷ ὶ ∷ []) "1John.5.20"
∷ word (ζ ∷ ω ∷ ὴ ∷ []) "1John.5.20"
∷ word (α ∷ ἰ ∷ ώ ∷ ν ∷ ι ∷ ο ∷ ς ∷ []) "1John.5.20"
∷ word (Τ ∷ ε ∷ κ ∷ ν ∷ ί ∷ α ∷ []) "1John.5.21"
∷ word (φ ∷ υ ∷ ∙λ ∷ ά ∷ ξ ∷ α ∷ τ ∷ ε ∷ []) "1John.5.21"
∷ word (ἑ ∷ α ∷ υ ∷ τ ∷ ὰ ∷ []) "1John.5.21"
∷ word (ἀ ∷ π ∷ ὸ ∷ []) "1John.5.21"
∷ word (τ ∷ ῶ ∷ ν ∷ []) "1John.5.21"
∷ word (ε ∷ ἰ ∷ δ ∷ ώ ∷ ∙λ ∷ ω ∷ ν ∷ []) "1John.5.21"
∷ []
|
By 16 December , the British 5th Division had completed its move into the line between the New Zealand and the Indian divisions . There followed a period of hostile patrolling and skirmishing on the XIII Corps front . The main burden of the fighting was therefore assumed by V Corps as the Canadians pushed for Ortona with the Indian Division on their left flank attacking toward Villa Grande and <unk> .
|
open import Prelude
module Implicits.Resolution.Deterministic.Expressiveness where
open import Data.Fin.Substitution
open import Implicits.Syntax
open import Implicits.Syntax.Type.Unification
open import Implicits.Resolution.Ambiguous.Resolution as A
open import Implicits.Resolution.Deterministic.Resolution as D
open import Extensions.ListFirst
module Deterministic⊆Ambiguous where
open FirstLemmas
open import Relation.Unary
soundness : ∀ {ν} {Δ : ICtx ν} {r} → Δ D.⊢ᵣ r → Δ A.⊢ᵣ r
soundness (r-simp r x) = lem x (r-ivar (proj₁ $ first⟶∈ r))
where
lem : ∀ {ν} {a τ} {Δ : ICtx ν} → Δ ⊢ a ↓ τ → Δ A.⊢ᵣ a → Δ A.⊢ᵣ simpl τ
lem (i-simp τ) hyp = hyp
lem (i-iabs ih₁ ih₂) hyp = lem ih₂ (r-iapp hyp (soundness ih₁))
lem (i-tabs b ih) hyp = lem ih (r-tapp b hyp)
soundness (r-iabs _ ih) = r-iabs (soundness ih)
soundness (r-tabs ih) = r-tabs (soundness ih)
|
SUBROUTINE MULTIMODEFLOQUETMATRIX_SP_C(ATOM__C,NM,NF,MODES_NUM,FIELDS_C,INFO)!VALUES_,ROW_INDEX_,COLUMN_,SP,INFO)
! THIS SUBROUTINE BUILDS THE MULTIMODE FLOQUET MATRIX
!ATOM_ (IN) : type of quantum system
!NM (IN) : number of modes
!NF (IN) : number of driving fields
!MODES_NUM (IN) : vector indicating the number of harmonics of each driving field (mode)
!FIELDS_C (IN) : Fields
! THE FOLLOWING VARIABLES ARE DECLARED AS GLOBAL ALLOCATABLE ARRAYS. THIS SUBROUTINE SET THEIR VALUES AND SIZE.
!VALUES_ (OUT) : Hamiltonian values
!ROW_INDEX_ (OUT) : vector indicating the row position of values
!COLUMN_ (OUT) : vector indicating the column position of the values
!INFO (INOUT) : error flag. INFO=0 means there is no error
USE TYPES_C !(modes.f90)
USE MERGINGARRAYS !(utils.f90)
USE SPARSE_INTERFACE !(sparse_utils.f90)
USE MODES_4F ! DEFINED IN modes_C.f90, declares atom_,coupling, values__, row_index__, column__
IMPLICIT NONE
INTEGER , INTENT(IN) :: NM,NF
TYPE(MODE_C), DIMENSION(NF), INTENT(INout) :: FIELDS_C
TYPE(ATOM_C), INTENT(IN) :: ATOM__C
INTEGER, DIMENSION(NM), INTENT(IN) :: MODES_NUM
INTEGER, INTENT(INOUT) :: INFO
! COMPLEX*16, DIMENSION(:), ALLOCATABLE :: VALUES__
! INTEGER, DIMENSION(:), ALLOCATABLE :: COLUMN__
! INTEGER, DIMENSION(:), ALLOCATABLE :: ROW_INDEX__
!INTEGER, INTENT(OUT) :: SP
! write(*,*) 'FORTRAN FLOQUETMATRIX_SP SAYS',NM,NF,MODES_NUM!, COULPLIG(3)%OMEGA
IF (INFO.EQ.0 .or. INFO.EQ.6) THEN
CALL MULTIMODEFLOQUETMATRIX_SP(ATOM_,NM,NF,MODES_NUM,COUPLING,VALUES__,ROW_INDEX__,COLUMN__,INFO)
! WRITE(*,*) "FORTRAN MULTIMODEHAMILTONAISPC SAYS: SIZE(VALUES__,1) =)",SIZE(VALUES__,1),SIZE(ROW_INDEX__,1)
H_FLOQUET_SIZE = SIZE(ROW_INDEX__,1)-1
END IF
END SUBROUTINE MULTIMODEFLOQUETMATRIX_SP_C ! _SP sparse packing
SUBROUTINE MULTIMODEFLOQUETMATRIX_PYTHON_SP_C(ATOM__C,NM,NF,MODES_NUM,FIELDS_C,MMF_DIM,INFO)! RESULT(MMF_DIM)
! THIS SUBROUTINE BUILDS THE MULTIMODE FLOQUET MATRIX
!ATOM_ (IN) : type of quantum system
!NM (IN) : number of modes
!NF (IN) : number of driving fields
!MODES_NUM (IN) : vector indicating the number of harmonics of each driving field (mode)
!FIELDS_C (IN) : Fields
! THE FOLLOWING VARIABLES ARE DECLARED AS GLOBAL ALLOCATABLE ARRAYS. THIS SUBROUTINE SET THEIR VALUES AND SIZE.
!VALUES_ (OUT) : Hamiltonian values
!ROW_INDEX_ (OUT) : vector indicating the row position of values
!COLUMN_ (OUT) : vector indicating the column position of the values
!INFO (INOUT) : error flag. INFO=0 means there is no error
USE TYPES_C !(modes.f90)
USE MERGINGARRAYS !(utils.f90)
USE SPARSE_INTERFACE !(sparse_utils.f90)
USE MODES_4F ! DEFINED IN modes_C.f90, declares atom_,coupling, values__, row_index__, column__
IMPLICIT NONE
INTEGER , INTENT(IN) :: NM,NF
TYPE(MODE_C), DIMENSION(NF), INTENT(INout) :: FIELDS_C
TYPE(ATOM_C), INTENT(IN) :: ATOM__C
INTEGER, DIMENSION(NM), INTENT(IN) :: MODES_NUM
INTEGER, DIMENSION(4), INTENT(OUT) :: MMF_DIM
INTEGER, INTENT(INOUT) :: INFO
!INTEGER, DIMENSION(3) :: MMF_DIM
! INTEGER MMF_DIM
! WRITE(*,*) INFO
IF (INFO.EQ.0 .OR. INFO.EQ.6) THEN
CALL MULTIMODEFLOQUETMATRIX_SP(ATOM_,NM,NF,MODES_NUM,COUPLING,VALUES__,ROW_INDEX__,COLUMN__,INFO)
H_FLOQUET_SIZE = INFO!SIZE(ROW_INDEX__,1)-1
MMF_DIM(1) = SIZE(VALUES__,1)
MMF_DIM(2) = SIZE(ROW_INDEX__,1)
MMF_DIM(3) = SIZE(COLUMN__,1)
MMF_DIM(4) = H_FLOQUET_SIZE
!write(*,*) MMF_DIM
END IF
END SUBROUTINE MULTIMODEFLOQUETMATRIX_PYTHON_SP_C
!END FUNCTION MULTIMODEFLOQUETMATRIX_PYTHON_SP_C ! _SP sparse packing
SUBROUTINE GET_H_FLOQUET_SP_C(h_floquet_size_,VALUES,ROW_INDEX,COLUMN,INFO)
!SUBROUTINE GET_H_FLOQUET_SP_C(h_floquet_size_,VALUES)!, VALUES,ROW_INDEX,COLUMN,INFO)
USE MODES_4F ! DEFINED IN modes_C.f90, declares atom_,coupling, values__, row_index__, column__
IMPLICIT NONE
INTEGER, DIMENSION(3), INTENT(IN) :: h_floquet_size_
COMPLEX*16,DIMENSION(h_floquet_size_(1)), intent(OUT) :: VALUES
INTEGER, DIMENSION(h_floquet_size_(2)), intent(OUT) :: ROW_INDEX
INTEGER, DIMENSION(h_floquet_size_(3)), intent(OUT) :: COLUMN
INTEGER, INTENT(INOUT) :: INFO
!write(*,*) h_floquet_size_
!write(*,*) values__
!write(*,*) size(values__,1),h_floquet_size_
VALUES = VALUES__
ROW_INDEX = ROW_INDEX__-1
COLUMN = COLUMN__-1
IF(INFO.EQ.-1) THEN ! THIS MEANS WE SHOULD USE AN EXTERNAL TOOL TO DIAGONALIZSE THE HAMILTONIAN
IF(ALLOCATED(VALUES__)) DEALLOCATE(VALUES__)
IF(ALLOCATED(COLUMN__)) DEALLOCATE(COLUMN__)
IF(ALLOCATED(ROW_INDEX__)) DEALLOCATE(ROW_INDEX__)
INFO = 0
END IF
END SUBROUTINE GET_H_FLOQUET_SP_C
|
#ifndef LAYERED_HARDWARE_DYNAMIXEL_DYNAMIXEL_ACTUATOR_DATA_HPP
#define LAYERED_HARDWARE_DYNAMIXEL_DYNAMIXEL_ACTUATOR_DATA_HPP
#include <cstdint>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include <dynamixel_workbench_toolbox/dynamixel_workbench.h>
#include <hardware_interface_extensions/integer_interface.hpp>
#include <layered_hardware_dynamixel/common_namespaces.hpp>
#include <boost/optional.hpp>
namespace layered_hardware_dynamixel {
struct DynamixelActuatorData {
DynamixelActuatorData(const std::string &_name, DynamixelWorkbench *const _dxl_wb,
const std::uint8_t _id, const double _torque_constant,
const std::vector< std::string > &additional_state_names,
const std::vector< std::string > &additional_cmd_names)
: name(_name), dxl_wb(_dxl_wb), id(_id), torque_constant(_torque_constant), pos(0.), vel(0.),
eff(0.), pos_cmd(0.), vel_cmd(0.), eff_cmd(0.) {
// TODO: this sorts names and breaks the original order.
// use std::vector< std::pair<> > instead of std::map<> .
for (const std::string &name : additional_state_names) {
additional_states[name] = 0;
}
for (const std::string &name : additional_cmd_names) {
additional_cmds[name] = 0;
}
}
// handles
const std::string name;
DynamixelWorkbench *const dxl_wb;
const std::uint8_t id;
// params
const double torque_constant;
// states
boost::optional< bool > has_eff;
double pos, vel, eff;
std::map< std::string, std::int32_t > additional_states;
// commands
double pos_cmd, vel_cmd, eff_cmd;
std::map< std::string, std::int32_t > additional_cmds;
};
typedef std::shared_ptr< DynamixelActuatorData > DynamixelActuatorDataPtr;
typedef std::shared_ptr< const DynamixelActuatorData > DynamixelActuatorDataConstPtr;
} // namespace layered_hardware_dynamixel
#endif |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Structured General Purpose Assignment
% LaTeX Template
%
% This template has been downloaded from:
% http://www.latextemplates.com
%
% Original author:
% Ted Pavlic (http://www.tedpavlic.com)
%
% Note:
% The \lipsum[#] commands throughout this template generate dummy text
% to fill the template out. These commands should all be removed when
% writing assignment content.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass{article}
\usepackage{fancyhdr} % Required for custom headers
\usepackage{lastpage} % Required to determine the last page for the footer
\usepackage{extramarks} % Required for headers and footers
\usepackage{graphicx} % Required to insert images
\usepackage{latexsym}
\usepackage{mathtools}
\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template
%\usepackage[]{algorithm2e}
%\usepackage{algorithmicx}
%\usepackage{algorithm}
%\usepackage{algorithm}
%\usepackage{algorithmic}
%\usepackage{algpseudocode}
%\usepackage{algcompatible}
\usepackage{algorithm}
\usepackage{algorithmic}
%\usepackage{algorithmicx}
%\usepackage{algpseudocode}
%\usepackage{algpseudocode}
%\usepackage[noend]{algpseudocode}
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\newcommand{\algorithmicbreak}{\textbf{break}}
\newcommand{\algorithmicgiven}{\textbf{Given:}}
\newcommand{\BREAK}{\STATE \algorithmicbreak}
\newcommand{\GIVEN}{\STATEx \algorithmicgiven}
%\def\NoNumber#1{{\def\alglinenumber##1{}\State #1}\addtocounter{ALG@line}{-1}}
\usepackage{amsmath}
%\usepackage{multline}
% Margins
\topmargin=-0.45in
\evensidemargin=0in
\oddsidemargin=0in
\textwidth=6.5in
\textheight=9.0in
\headsep=0.25in
\linespread{1.1} % Line spacing
% Set up the header and footer
\pagestyle{fancy}
\lhead{\hmwkAuthorName} % Top left header
\chead{\hmwkClass\ : \hmwkTitle} % Top center header
\rhead{\firstxmark} % Top right header
\lfoot{\lastxmark} % Bottom left footer
\cfoot{} % Bottom center footer
\rfoot{Page\ \thepage\ of\ \pageref{LastPage}} % Bottom right footer
\renewcommand\headrulewidth{0.4pt} % Size of the header rule
\renewcommand\footrulewidth{0.4pt} % Size of the footer rule
\setlength\parindent{0pt} % Removes all indentation from paragraphs
%----------------------------------------------------------------------------------------
% DOCUMENT STRUCTURE COMMANDS
% Skip this unless you know what you're doing
%----------------------------------------------------------------------------------------
% Header and footer for when a page split occurs within a problem environment
\newcommand{\enterProblemHeader}[1]{
\nobreak\extramarks{#1}{#1 continued on next page\ldots}\nobreak
\nobreak\extramarks{#1 (continued)}{#1 continued on next page\ldots}\nobreak
}
% Header and footer for when a page split occurs between problem environments
\newcommand{\exitProblemHeader}[1]{
\nobreak\extramarks{#1 (continued)}{#1 continued on next page\ldots}\nobreak
\nobreak\extramarks{#1}{}\nobreak
}
\setcounter{secnumdepth}{0} % Removes default section numbers
\newcounter{homeworkProblemCounter} % Creates a counter to keep track of the number of problems
\newcommand{\homeworkProblemName}{}
\newenvironment{homeworkProblem}[1][Problem \arabic{homeworkProblemCounter}]{ % Makes a new environment called homeworkProblem which takes 1 argument (custom name) but the default is "Problem #"
\stepcounter{homeworkProblemCounter} % Increase counter for number of problems
\renewcommand{\homeworkProblemName}{#1} % Assign \homeworkProblemName the name of the problem
\section{\homeworkProblemName} % Make a section in the document with the custom problem count
\enterProblemHeader{\homeworkProblemName} % Header and footer within the environment
}{
\exitProblemHeader{\homeworkProblemName} % Header and footer after the environment
}
\newcommand{\problemAnswer}[1]{ % Defines the problem answer command with the content as the only argument
\noindent\framebox[\columnwidth][c]{\begin{minipage}{0.98\columnwidth}#1\end{minipage}} % Makes the box around the problem answer and puts the content inside
}
\newcommand{\homeworkSectionName}{}
\newenvironment{homeworkSection}[1]{ % New environment for sections within homework problems, takes 1 argument - the name of the section
\renewcommand{\homeworkSectionName}{#1} % Assign \homeworkSectionName to the name of the section from the environment argument
\subsection{\homeworkSectionName} % Make a subsection with the custom name of the subsection
\enterProblemHeader{\homeworkProblemName\ [\homeworkSectionName]} % Header and footer within the environment
}{
\enterProblemHeader{\homeworkProblemName} % Header and footer after the environment
}
%----------------------------------------------------------------------------------------
% NAME AND CLASS SECTION
%----------------------------------------------------------------------------------------
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\newcommand{\hmwkTitle}{Homework\ \# 1 } % Assignment title
\newcommand{\hmwkDueDate}{Tuesday,\ March \ 31,\ 2015} % Due date
\newcommand{\hmwkClass}{BISC-577} % Course/class
\newcommand{\hmwkClassTime}{11:00am} % Class/lecture time
\newcommand{\hmwkAuthorName}{Saket Choudhary} % Your name
\newcommand{\hmwkAuthorID}{2170058637} % Teacher/lecturer
%----------------------------------------------------------------------------------------
% TITLE PAGE
%----------------------------------------------------------------------------------------
\title{
\vspace{2in}
\textmd{\textbf{\hmwkClass:\ \hmwkTitle}}\\
\normalsize\vspace{0.1in}\small{Due\ on\ \hmwkDueDate}\\
%\vspace{0.1in}\large{\textit{\hmwkClassTime}}
\vspace{3in}
}
\author{\textbf{\hmwkAuthorName} \\
\textbf{\hmwkAuthorID}
}
\date{} % Insert date here if you want it to appear below your name
%----------------------------------------------------------------------------------------
\begin{document}
\maketitle
%----------------------------------------------------------------------------------------
% TABLE OF CONTENTS
%----------------------------------------------------------------------------------------
%\setcounter{tocdepth}{1} % Uncomment this line if you don't want subsections listed in the ToC
\newpage
\tableofcontents
\newpage
\begin{homeworkSection}{Question \# 1} % Section within problem
\problemAnswer{
SRA is a publically available archive of biological sequencing datasets.
By making raw data and the associated metadata available, SRA aims to make genomics reproducible.
New discoveries are possible using the existing datasets.
}
\end{homeworkSection}
\begin{homeworkSection}{Question \# 2}
\problemAnswer{ FASTQ is ASCII-based format for storing sequences along with their quality scores.
FASTQ originated from FASTA format. FASTA files do not store quality scores.
Eash FASTQ record consists of typically four lines and a .fastq/.fq file is typically a collection of different records.
The first line consists of a unique identifier. The second line is sequence[A/T/C/G/N] where N stands for base not sequenced. The third line is a separator '+' and the fourth line is simply ascii encoded quality scores. These scores are an indicative of how sure the sequencer is that a particular base is infact that and not anything else or noise.
}
\end{homeworkSection}
\begin{homeworkSection}{Question \# 3}
\problemAnswer{
Accession: SRR1287226
Run: SRR1287226
Metadata associated includes the the experimental design, platform used and library preparation strategy.
This sample seems to be missing information about the experimental design. It is not evident if the samples came from "before" or "after" correction as mentioned in the abstract.
}
\end{homeworkSection}
\begin{homeworkSection}{Question \# 4}
\problemAnswer{
Aspera took close to 1260 seconds while wget/ftp took close to 2740 seconds. wget/ftp relies on a 'handshaking' method(TCP)
to ensure reliable data transfer. Metadata exchanges take place at different points to ensure the packet transmiited is
received by the client. Aspera relies on UDP, avoiding the 'handshake' overhead though still maintaining data integrity
at the application layer.
}
\end{homeworkSection}
\begin{homeworkSection}{Question \# 5}
\problemAnswer{
%SRA filesize: 2919274711 byes\\
%FastQ size: 12965100984\\
Accession: ERR505079\\
SRA filesize: 1113333096 bytes\\
FastQ size: 6399124194 bytes\\
gzip size: \\
gzip time: \\
bzip2 size: \\
bzip2 time: \\
pbzip2 size: \\
pbzip2 time: \\
Reference based compression makes use of a sliding window to first store the start position and offsets of reads as aligned to the reference. Mismatches positions and calls are stored explicitly.
While decompressing these offsets are then used to retrieve the original sequence.
}
\end{homeworkSection}
\begin{homeworkSection}{Question \# 6}
\problemAnswer{
}
\begin{homeworkSection}{Question \# 7}
\problemAnswer{
Sequencing adapters are known sequenced used for making the DNA fragments ligate to primers and bind to the flow channel more efficiently.
The sequencer might often treats the ligated sequence as a shotgun sequence.
To remove sequencing adapters, $cutadapt$ {https://github.com/marcelm/cutadapt}
cutadapt was used to performe trimming both $5'$ and $3'$ trimming:
$5'$ adapter sequence: AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT
$s'$ adapter sequence:
CAAGCAGAAGACGGCATACGAGCTCTTCCGATCT
The plot generated using `fastqc` didn't show presence of any sequencing adapters, though there were a few overrepresented sequences and hence trimming resulted in all the reads passing the filter.
$cutadapt$ produces additional statistics about the presence of nucleotides in percentage preceeding the adapter and uses a partial matching scheme to search for possible primers. The trimming was performed with at most $10\%$ error in paired-end mode.
Though the whole of adapter was not present($0$ reads contained the whole adapter sequence), some 3 length sequences were over-represented and were trimmed resulting in few output reads being less than 100bp long. A total of 660417 + 18529 reads had overrepreented 3-mer coming from the adapter and were trimmed.
$cutadapt$ takes into consideration over-representation by taking the base case to be the probability of observing that $k-mer$ in a random sequence.
The nucleotide bar plot will change drastically if all the reads have some part of the adapter sequence. The 'C' and 'G' plot in particular should ideally decrease in height post trimming, since they seem to be abundant in the adapters.
}
\end{homeworkSection}
\end{homeworkSection}
\end{document}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.