Mathematica - Visual Logic
1 Visualizing Logic
""] := {{Inset[Style[label,Purple],Midpoint[{p,q}]], Arrow[{p,q}]}};
AArrow[{p_, q_}, label_:= Graphics@AArrow[{ConstantArray[0,Length[p]],p}];
vec2[p_] := Which[ ArrayQ[q] == False, Graphics@AArrow[{ConstantArray[0,Length[p]],p},q],
vec2[p_,q_] :== True, Graphics@AArrow[{p,q},""] ]
ArrayQ[q] = Graphics@AArrow[{p,q},label];
vec2[p_,q_,label_] :
= Which[ Length[p] == 2, vec2[p],
vec[p_] :== 3, vec2[p] /. Graphics -> Graphics3D ];
Length[p] = Which[ Length[p] == 2, vec2[p,q],
vec[p_,q_] :== 3, vec2[p,q] /. Graphics -> Graphics3D ];
Length[p] = Which[ Length[p] == 2,vec2[p,q,label],
vec[p_,q_,label_] :== 3,vec2[p,q,label] /. Graphics -> Graphics3D];
Length[q]
= expr /. List[p__]-> MatrixForm[List[p]]
matrix[expr_] := TeXForm[Row[{x}]];
cout[x__] := Graphics3D@Point[x]; pnt[x_] :
The paradox of \(\bigcap\limits_{i\in I} A_i \qquad \bigwedge\limits_{i\in I} A_i\) Power vs Constraint
- Constraint: \(\bigcap\limits_{i\in I} A_i \subseteq A_3\) shows the intersection is more constrained than the sets it is composed out of
- Power: \(\bigcap\limits_{i\in I} A_i \vdash ...\) is more powerful than \(A_3 \vdash ..\)
Row[{0.3],ResourceFunction["Disk3D"][{0,0.5,0},2]}],
Show[Graphics3D[{Opacity[0.3],ResourceFunction["Disk3D"][{1,1,3},2]}],
Graphics3D[{Opacity[0.3],ResourceFunction["Disk3D"][{0,0,2},1]}],
Graphics3D[{Opacity[0.3],ResourceFunction["Disk3D"][{2,0,1.5},2]}],
Graphics3D[{Opacity[0,0,5}],
vec[{->Small
ImageSize
],
Show[0.3],Disk[{0,0.5},2]}],
Graphics[{Opacity[0.3],Disk[{1,1},2]}],
Graphics[{Opacity[0.3],Disk[{0,1},1]}],
Graphics[{Opacity[0.3],Disk[{2,0},2]}],
Graphics[{Opacity[@Text["Intersect",{0.6,0.9}],
Graphics->Small
ImageSize
] }]
Vertically, we see the 3d line passing thru 4 stacks giving us more power/evidence for proving.
However in another perspective we see this power is constrained as some subset for any of the other sets.
2 Necessary and Sufficient
2.1 Sufficient
Sufficient can be seen as a type of injectivity.
X is sufficient for Y, we can inject X into Y but that doesnt mean that X is the only injection.
- Sufficient = Must
- Red gene is sufficient for sight
- One can visualize the space of the venn diagram to contain different ways of expressing a certain gene.
- Taken literally: If one expresses red gene then one must have sight
- Reality: If one has expresses a collection of genes along with red gene then one must have sight
- The set of ALL genes is also sufficient for sight (vacuous evidence) An example of Power in \(\bigcap\limits_{i\in I} A_i\)
Biological sufficiency, red gene is sufficient for sight:
- \((\bigcap\limits_{i\in I} Gene_i \cap red) \rightarrow sight\)
Show[
0.3],Disk[{0,0.5},2]}],
Graphics[{Opacity[0.3],Disk[{1,1},2]}],
Graphics[{Opacity[0.3],Disk[{0,1},1]}],
Graphics[{Opacity[0.3],Disk[{2,0},2]}],
Graphics[{Opacity[0.2],Disk[{1.5,2.5},3]}],
Graphics[{Blue,Opacity[@Text["Intersect",{0.6,0.9}],
Graphics@Text["Sight",{2.5,4}],
Graphics
->Small
ImageSize ]
Show[
0.3],Disk[{1.5,2.5},2.8]}],
Graphics[{Red,Opacity[0.3],Disk[{2,7},1]}],
Graphics[{Blue,Opacity[0.3],Disk[{6,3},1]}],
Graphics[{Blue,Opacity[0.3],Disk[{10,6},2]}],
Graphics[{Blue,Opacity[0.4],Disk[{1.5,2.5},3]}],
Graphics[{Blue,Opacity[@Text["Rained",{0.6,0.9}],
Graphics@Text["Wet",{2.5,4}],
Graphics@Text["Wet",{2,7}],
Graphics@Text["NotWet",{6.5,1}],
Graphics-> {LightGray, Rectangle[Scaled[{0, 0}], Scaled[{1, 1}]]},
Prolog ->Small
ImageSize ]
- The red circle aka purple subset of the blue circle represents Rained.
- The blue circle represents Wet Ground
- The gray area represents Not Wet Ground
- The gray area + the thin blue boundary around red Rained circle represents Not Rained
Rain is sufficient for a wet ground.
But there may be many other reasons for a wet ground (the multiple blue circles).
Just because the ground is wet does not mean it must have rained.
But if the ground is not wet then we know it must not have rained. Contrapositive (The grey area is a subset of gray area + thin blue boundary around rained).
Experimenter might induce rain then show that the ground is wet to prove sufficiency.
Row[{0,1}],
Plot[x,{x,=1,{x,0,1}]
Plot[x }]